]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: sd: Optimal I/O size should be a multiple of physical block size
authorMartin K. Petersen <martin.petersen@oracle.com>
Tue, 12 Feb 2019 21:21:05 +0000 (16:21 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Feb 2019 15:08:36 +0000 (10:08 -0500)
commitdd13fc0f321ef6c9de37f978240ef5afaef6bc8a
tree83b3e9c1ee9892d95bb0b5ecf9c9c0837a9c72a1
parentf3b057a31f914e540ff0a8b178cbca87e1c6b3b5
scsi: sd: Optimal I/O size should be a multiple of physical block size

It was reported that some devices report an OPTIMAL TRANSFER LENGTH of
0xFFFF blocks. That looks bogus, especially for a device with a
4096-byte physical block size.

Ignore OPTIMAL TRANSFER LENGTH if it is not a multiple of the device's
reported physical block size.

To make the sanity checking conditionals more readable--and to
facilitate printing warnings--relocate the checking to a helper
function. No functional change aside from the printks.

Cc: <stable@vger.kernel.org>
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199759
Reported-by: Christoph Anton Mitterer <calestyo@scientia.net>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/sd.c