diff options
author | Andreas Herrmann <aherrman@de.ibm.com> | 2005-06-13 07:20:35 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-06-13 22:32:48 -0400 |
commit | 1db2c9c0931a53fe013db55fd2ff58859db31e8d (patch) | |
tree | 1134627ac98d91896dcdb161d5df7ecef60a4de3 /drivers/s390/scsi/zfcp_erp.c | |
parent | 64b29a130901d5b8578e9f602cf2dae56aaff224 (diff) |
[SCSI] zfcp: fix bug during adapter shutdown
Fixes a race between zfcp_fsf_req_dismiss_all and
zfcp_qdio_reqid_check. During adapter shutdown it occurred that a
request was cleaned up twice. First during its normal
completion. Second when dismiss_all was called. The fix is to
serialize access to fsf request list between zfcp_fsf_req_dismiss_all
and zfcp_qdio_reqid_check and delete a fsf request from the list if
its completion is triggered. (Additionally a rwlock was replaced by a
spinlock and fsf_req_cleanup was eliminated.)
Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 41c67e1ec4f7..6d73891eec9e 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -891,7 +891,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) | |||
891 | 891 | ||
892 | if (erp_action->fsf_req) { | 892 | if (erp_action->fsf_req) { |
893 | /* take lock to ensure that request is not being deleted meanwhile */ | 893 | /* take lock to ensure that request is not being deleted meanwhile */ |
894 | write_lock(&adapter->fsf_req_list_lock); | 894 | spin_lock(&adapter->fsf_req_list_lock); |
895 | /* check whether fsf req does still exist */ | 895 | /* check whether fsf req does still exist */ |
896 | list_for_each_entry(fsf_req, &adapter->fsf_req_list_head, list) | 896 | list_for_each_entry(fsf_req, &adapter->fsf_req_list_head, list) |
897 | if (fsf_req == erp_action->fsf_req) | 897 | if (fsf_req == erp_action->fsf_req) |
@@ -934,7 +934,7 @@ zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *erp_action) | |||
934 | */ | 934 | */ |
935 | erp_action->fsf_req = NULL; | 935 | erp_action->fsf_req = NULL; |
936 | } | 936 | } |
937 | write_unlock(&adapter->fsf_req_list_lock); | 937 | spin_unlock(&adapter->fsf_req_list_lock); |
938 | } else | 938 | } else |
939 | debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq"); | 939 | debug_text_event(adapter->erp_dbf, 3, "a_ca_noreq"); |
940 | 940 | ||