]> www.infradead.org Git - users/jedix/linux-maple.git/commit
scsi: sd: Check for unaligned partial completion
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 1 Mar 2017 08:27:00 +0000 (17:27 +0900)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 20:56:17 +0000 (13:56 -0700)
commit08d3944f8e9804740f15b6f045e275cf29701619
treedbe7c8ea59ab4557485747f3f5bba0a37bbb4e39
parenteb0cf52e9820d8ea9a82b88f90917d99105f94a4
scsi: sd: Check for unaligned partial completion

Commit <f2e767bb5d6e> ("mpt3sas: Force request partial completion
alignment") was not considering the case of commands not operating on
logical block size units (e.g. REQ_OP_ZONE_REPORT and its 64B aligned
partial replies). In this case, forcing alignment of resid to the device
logical block size can break the command result, e.g. in the case of
REQ_OP_ZONE_REPORT, the exact number of zone reported by the device.

Move the partial completion alignement check of mpt3sas to a generic
implementation in sd_done(). The check is added within the default
section of the initial req_op() switch case so that the report and reset
zone commands are ignored. In addition, as sd_done() is not called for
passthrough requests, resid corrections are not done as intended by the
initial mpt3sas patch.

Fixes: f2e767bb5d6e ("mpt3sas: Force request partial completion alignment")
Cc: <stable@vger.kernel.org> # v4.10
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit c46f09175dabd5dd6a1507f36250bfa734a0156e
 change sd.c modification to avoid req_op conversion in current kernel)

Orabug: 26178369
Signed-off-by: shan.hai@oracle.com
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/scsi/sd.c