[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>
This commit is contained in:

committed by
James Bottomley

parent
bc436b2787
commit
2697478903
@@ -1662,7 +1662,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
|
||||
struct iscsi_session *session = iscsi_hostdata(shost->hostdata);
|
||||
struct module *owner = cls_session->transport->owner;
|
||||
|
||||
iscsi_unblock_session(cls_session);
|
||||
iscsi_remove_session(cls_session);
|
||||
scsi_remove_host(shost);
|
||||
|
||||
iscsi_pool_free(&session->mgmtpool);
|
||||
@@ -1677,7 +1677,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session)
|
||||
kfree(session->hwaddress);
|
||||
kfree(session->initiatorname);
|
||||
|
||||
iscsi_destroy_session(cls_session);
|
||||
iscsi_free_session(cls_session);
|
||||
scsi_host_put(shost);
|
||||
module_put(owner);
|
||||
}
|
||||
|
Reference in New Issue
Block a user