]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi_lib: correctly retry failed zero length REQ_TYPE_FS commands
authorJames Bottomley <James.Bottomley@HansenPartnership.com>
Fri, 13 May 2016 19:04:06 +0000 (12:04 -0700)
committerJim Quigley <Jim.Quigley@oracle.com>
Thu, 26 Oct 2017 13:39:02 +0000 (14:39 +0100)
commit58ab89b0edcd033f9036710b95e2cb389197bb50
tree6a78d038b425675c3c71fa1a63fd9003656b459f
parent8d11f28e89a4f18e90ad718d6b03785b84011435
scsi_lib: correctly retry failed zero length REQ_TYPE_FS commands

When SCSI was written, all commands coming from the filesystem
(REQ_TYPE_FS commands) had data.  This meant that our signal for needing
to complete the command was the number of bytes completed being equal to
the number of bytes in the request.  Unfortunately, with the advent of
flush barriers, we can now get zero length REQ_TYPE_FS commands, which
confuse this logic because they satisfy the condition every time.  This
means they never get retried even for retryable conditions, like UNIT
ATTENTION because we complete them early assuming they're done.  Fix
this by special casing the early completion condition to recognise zero
length commands with errors and let them drop through to the retry code.

Cc: stable@vger.kernel.org
Reported-by: Sebastian Parschauer <s.parschauer@gmx.de>
Signed-off-by: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Tested-by: Jack Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit a621bac3044ed6f7ec5fa0326491b2d4838bfa93)

Orabug: 26824565

Signed-off-by: Jim Quigley <Jim.Quigley@oracle.com>
reviewed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_lib.c