diff options
author | David Jeffery <djeffery@redhat.com> | 2016-10-28 12:27:26 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2016-11-01 13:31:23 -0400 |
commit | aac173e9618faadf8f92af6cc05e64f7acc64d79 (patch) | |
tree | 2b1145a0b142843a566dac4221bf9e385896bc44 /drivers/scsi/vmw_pvscsi.c | |
parent | 6d3a56ed098566bc83d6c2afa74b4199c12ea074 (diff) |
scsi: vmw_pvscsi: return SUCCESS for successful command aborts
The vmw_pvscsi driver reports most successful aborts as FAILED to the
scsi error handler. This is do to a misunderstanding of how
completion_done() works and its interaction with a successful wait using
wait_for_completion_timeout(). The vmw_pvscsi driver is expecting
completion_done() to always return true if complete() has been called on
the completion structure. But completion_done() returns true after
complete() has been called only if no function like
wait_for_completion_timeout() has seen the completion and cleared it as
part of successfully waiting for the completion.
Instead of using completion_done(), vmw_pvscsi should just use the
return value from wait_for_completion_timeout() to know if the wait
timed out or not.
[mkp: bumped driver version per request]
Signed-off-by: David Jeffery <djeffery@redhat.com>
Reviewed-by: Laurence Oberman <loberman@redhat.com>
Reviewed-by: Ewan D. Milne <emilne@redhat.com>
Acked-by: Jim Gill <jgill@vmware.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/vmw_pvscsi.c')
-rw-r--r-- | drivers/scsi/vmw_pvscsi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c index 4a0d3cdc607c..15ca09cd16f3 100644 --- a/drivers/scsi/vmw_pvscsi.c +++ b/drivers/scsi/vmw_pvscsi.c | |||
@@ -793,6 +793,7 @@ static int pvscsi_abort(struct scsi_cmnd *cmd) | |||
793 | unsigned long flags; | 793 | unsigned long flags; |
794 | int result = SUCCESS; | 794 | int result = SUCCESS; |
795 | DECLARE_COMPLETION_ONSTACK(abort_cmp); | 795 | DECLARE_COMPLETION_ONSTACK(abort_cmp); |
796 | int done; | ||
796 | 797 | ||
797 | scmd_printk(KERN_DEBUG, cmd, "task abort on host %u, %p\n", | 798 | scmd_printk(KERN_DEBUG, cmd, "task abort on host %u, %p\n", |
798 | adapter->host->host_no, cmd); | 799 | adapter->host->host_no, cmd); |
@@ -824,10 +825,10 @@ static int pvscsi_abort(struct scsi_cmnd *cmd) | |||
824 | pvscsi_abort_cmd(adapter, ctx); | 825 | pvscsi_abort_cmd(adapter, ctx); |
825 | spin_unlock_irqrestore(&adapter->hw_lock, flags); | 826 | spin_unlock_irqrestore(&adapter->hw_lock, flags); |
826 | /* Wait for 2 secs for the completion. */ | 827 | /* Wait for 2 secs for the completion. */ |
827 | wait_for_completion_timeout(&abort_cmp, msecs_to_jiffies(2000)); | 828 | done = wait_for_completion_timeout(&abort_cmp, msecs_to_jiffies(2000)); |
828 | spin_lock_irqsave(&adapter->hw_lock, flags); | 829 | spin_lock_irqsave(&adapter->hw_lock, flags); |
829 | 830 | ||
830 | if (!completion_done(&abort_cmp)) { | 831 | if (!done) { |
831 | /* | 832 | /* |
832 | * Failed to abort the command, unmark the fact that it | 833 | * Failed to abort the command, unmark the fact that it |
833 | * was requested to be aborted. | 834 | * was requested to be aborted. |