From: Vishal Annapurve Subject: [PATCH] usb-storage: Changing the command result This change updates the returned result to scsi layer to use DID_TIMEOUT flag as a result status rather than DID_ABORT for commands aborted due to timeout. Signed-off-by: Vishal Annapurve --- drivers/usb/storage/scsiglue.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index a74e9d8..e7b532e 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -353,6 +353,15 @@ static int command_abort(struct scsi_cmnd *srb) /* Wait for the aborted command to finish */ wait_for_completion(&us->notify); + /* Given that this bit would be only set in case of timedout + * command, we can return with DID_TIME_OUT, as scsi layer needs + * to use this result rather than DID_ABORT. + * This is a WR to avoid removing DID_ABORT altogether + * and before the final control goes to scsi layer change the + * result to be timedout. + */ + us->srb->result = DID_TIME_OUT << 16; + return SUCCESS; } -- 1.8.4