summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/scsi/scsi_lib.c')
-rw-r--r--kernel/drivers/scsi/scsi_lib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/kernel/drivers/scsi/scsi_lib.c b/kernel/drivers/scsi/scsi_lib.c
index dd8ad2a44..cf5b99e1f 100644
--- a/kernel/drivers/scsi/scsi_lib.c
+++ b/kernel/drivers/scsi/scsi_lib.c
@@ -910,9 +910,12 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
}
/*
- * If we finished all bytes in the request we are done now.
+ * special case: failed zero length commands always need to
+ * drop down into the retry code. Otherwise, if we finished
+ * all bytes in the request we are done now.
*/
- if (!scsi_end_request(req, error, good_bytes, 0))
+ if (!(blk_rq_bytes(req) == 0 && error) &&
+ !scsi_end_request(req, error, good_bytes, 0))
return;
/*