aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libiscsi.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2007-12-13 13:43:29 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-11 19:28:33 -0500
commit2697478903d0ad8bdbf868b1346ae4b891662bb1 (patch)
tree8b40d774c0a6f33f9320333a20e08fa920f154fc /drivers/scsi/libiscsi.c
parentbc436b278776d22eb10e7e75bf3e5257d14550a9 (diff)
[SCSI] libiscsi: fix shutdown
We were using the device delete sysfs file to remove each device then logout. Now in 2.6.21 this will not work because the sysfs delete file returns immediately and does not wait for the device removal to complete. This causes a hang if a cache sync is needed during shutdown. Before .21, that approach had other problems, so this patch fixes the shutdown code so that we remove the target and unbind the session before logging out and shut down the session Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/libiscsi.c')
-rw-r--r--drivers/scsi/libiscsi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 441e351b4456..5205ef2c29b2 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1662,7 +1662,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
1662 struct iscsi_session *session = iscsi_hostdata(shost->hostdata); 1662 struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
1663 struct module *owner = cls_session->transport->owner; 1663 struct module *owner = cls_session->transport->owner;
1664 1664
1665 iscsi_unblock_session(cls_session); 1665 iscsi_remove_session(cls_session);
1666 scsi_remove_host(shost); 1666 scsi_remove_host(shost);
1667 1667
1668 iscsi_pool_free(&session->mgmtpool); 1668 iscsi_pool_free(&session->mgmtpool);
@@ -1677,7 +1677,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
1677 kfree(session->hwaddress); 1677 kfree(session->hwaddress);
1678 kfree(session->initiatorname); 1678 kfree(session->initiatorname);
1679 1679
1680 iscsi_destroy_session(cls_session); 1680 iscsi_free_session(cls_session);
1681 scsi_host_put(shost); 1681 scsi_host_put(shost);
1682 module_put(owner); 1682 module_put(owner);
1683} 1683}