On 11/10/2010 05:04 PM, Eddie Wai wrote:
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<[email protected]>
Acked-by: Anil Veerabhadrappa<[email protected]>
---
  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;

Don't you still leak what bnx2i_free_ep frees?

In userspace you should have iscsid/iscsi_sync_session match the iscsi endpoint with the iscsi conn and set transport_ep_handle. ep_disconnect will then get called like normal to clean up the old connection.

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

Reply via email to