This is the case when iscsid gets re-launched due to features like
iSCSI boot which requires the daemon to re-launch due to
pivot root.  If the code detected the connection had an existing
endpoint, the old endpoint must get cleaned up.

Signed-off-by: Eddie Wai <eddie....@broadcom.com>
Acked-by: Anil Veerabhadrappa <ani...@broadcom.com>
---
 drivers/scsi/bnx2i/bnx2i_iscsi.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index 823e4fa..3b65c64 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -1410,6 +1410,13 @@ static int bnx2i_conn_bind(struct iscsi_cls_session 
*cls_session,
                                  hba->netdev->name);
                return -EEXIST;
        }
+       if (bnx2i_conn->ep) {
+               printk(KERN_ALERT "bnx2i: Binding to an existing endpoint "
+                       "detected.  Disconnecting the old...\n");
+               mutex_lock(&hba->net_dev_lock);
+               bnx2i_hw_ep_disconnect(bnx2i_conn->ep);
+               mutex_unlock(&hba->net_dev_lock);
+       }
        bnx2i_ep->conn = bnx2i_conn;
        bnx2i_conn->ep = bnx2i_ep;
        bnx2i_conn->iscsi_conn_cid = bnx2i_ep->ep_iscsi_cid;
-- 
1.7.0.5


-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-is...@googlegroups.com.
To unsubscribe from this group, send email to 
open-iscsi+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/open-iscsi?hl=en.

Reply via email to