summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorAlan Stern2014-03-28 18:51:15 +0100
committerJames Bottomley2014-04-21 23:27:26 +0200
commit644373a4219add42123df69c8b7ce6a918475ccd (patch)
treebdf8825070f03d622ff3fa715f3ad5f19513bb4f /drivers/scsi/scsi_lib.c
parent[SCSI] Fix spurious request sense in error handling (diff)
downloadkernel-qcow2-linux-644373a4219add42123df69c8b7ce6a918475ccd.tar.gz
kernel-qcow2-linux-644373a4219add42123df69c8b7ce6a918475ccd.tar.xz
kernel-qcow2-linux-644373a4219add42123df69c8b7ce6a918475ccd.zip
[SCSI] Fix command result state propagation
We're seeing a case where the contents of scmd->result isn't being reset after a SCSI command encounters an error, is resubmitted, times out and then gets handled. The error handler acts on the stale result of the previous error instead of the timeout. Fix this by properly zeroing the scmd->status before the command is resubmitted. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 7fa54fe51f63..9db097a28a74 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -137,6 +137,7 @@ static void __scsi_queue_insert(struct scsi_cmnd *cmd, int reason, int unbusy)
* lock such that the kblockd_schedule_work() call happens
* before blk_cleanup_queue() finishes.
*/
+ cmd->result = 0;
spin_lock_irqsave(q->queue_lock, flags);
blk_requeue_request(q, cmd->request);
kblockd_schedule_work(q, &device->requeue_work);