diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2009-08-18 09:43:14 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-09-05 09:49:18 -0400 |
commit | 058b8647892ed49ba6a0d2c0966a72e20e2e69ff (patch) | |
tree | ba8baad2244bbacc5974207fb2274fb6c355d385 /drivers/s390/scsi/zfcp_scsi.c | |
parent | bd63eaf4b8d783e6033930e377e516169abcadc4 (diff) |
[SCSI] zfcp: Replace fsf_req wait_queue with completion
The combination wait_queue/wakeup in conjunction with the flag
ZFCP_STATUS_FSFREQ_COMPLETED to signal the completion of an fsfreq
was not race-safe and can be better solved by a completion.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 0bd80a90426a..0de059161b35 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -206,8 +206,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
206 | if (!abrt_req) | 206 | if (!abrt_req) |
207 | return FAILED; | 207 | return FAILED; |
208 | 208 | ||
209 | wait_event(abrt_req->completion_wq, | 209 | wait_for_completion(&abrt_req->completion); |
210 | abrt_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | ||
211 | 210 | ||
212 | if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) | 211 | if (abrt_req->status & ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED) |
213 | dbf_tag = "okay"; | 212 | dbf_tag = "okay"; |
@@ -246,8 +245,7 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags) | |||
246 | if (!fsf_req) | 245 | if (!fsf_req) |
247 | return FAILED; | 246 | return FAILED; |
248 | 247 | ||
249 | wait_event(fsf_req->completion_wq, | 248 | wait_for_completion(&fsf_req->completion); |
250 | fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | ||
251 | 249 | ||
252 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) { | 250 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_TMFUNCFAILED) { |
253 | zfcp_scsi_dbf_event_devreset("fail", tm_flags, unit, scpnt); | 251 | zfcp_scsi_dbf_event_devreset("fail", tm_flags, unit, scpnt); |