summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-27 21:01:09 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-06-27 21:01:09 -0300
commitb907a8622e39eecfc4b243f3be3ad26559d1faee (patch)
treeb99ead386fccde5ea8252b5b5ebff8ffd83cd03d /drivers/scsi/scsi_lib.c
parent68f052d01b53b858897d80beb0095920abe5868e (diff)
Linux-libre 4.6.3-gnupck-4.6.3-gnu
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 8106515d1..f704d0264 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -911,9 +911,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;
/*