summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_error.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2014-03-28 21:51:15 +0400
committerJames Bottomley <JBottomley@Parallels.com>2014-04-22 01:27:26 +0400
commit644373a4219add42123df69c8b7ce6a918475ccd (patch)
treebdf8825070f03d622ff3fa715f3ad5f19513bb4f /drivers/scsi/scsi_error.c
parentd555a2abf3481f81303d835046a5ec2c4fb3ca8e (diff)
downloadlinux-644373a4219add42123df69c8b7ce6a918475ccd.tar.xz
[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_error.c')
-rw-r--r--drivers/scsi/scsi_error.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index d020149ea8d4..2953bfa92da7 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -924,6 +924,7 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses,
memset(scmd->cmnd, 0, BLK_MAX_CDB);
memset(&scmd->sdb, 0, sizeof(scmd->sdb));
scmd->request->next_rq = NULL;
+ scmd->result = 0;
if (sense_bytes) {
scmd->sdb.length = min_t(unsigned, SCSI_SENSE_BUFFERSIZE,