Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[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>

authored by

Alan Stern and committed by
James Bottomley
644373a4 d555a2ab

+2
+1
drivers/scsi/scsi_error.c
··· 924 924 memset(scmd->cmnd, 0, BLK_MAX_CDB); 925 925 memset(&scmd->sdb, 0, sizeof(scmd->sdb)); 926 926 scmd->request->next_rq = NULL; 927 + scmd->result = 0; 927 928 928 929 if (sense_bytes) { 929 930 scmd->sdb.length = min_t(unsigned, SCSI_SENSE_BUFFERSIZE,
+1
drivers/scsi/scsi_lib.c
··· 137 137 * lock such that the kblockd_schedule_work() call happens 138 138 * before blk_cleanup_queue() finishes. 139 139 */ 140 + cmd->result = 0; 140 141 spin_lock_irqsave(q->queue_lock, flags); 141 142 blk_requeue_request(q, cmd->request); 142 143 kblockd_schedule_work(q, &device->requeue_work);