summaryrefslogtreecommitdiff
path: root/drivers/scsi/sd.h
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2022-03-02 00:35:53 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2022-05-02 16:59:11 -0400
commit631669a256f96c7115c34cc19578a461c72568de (patch)
tree1c8bc1bb9d084540662ba5a6c5a701fc249dc4b2 /drivers/scsi/sd.h
parent7fb019c46eeea4e3cc3ddfd3e01a24e610f34fac (diff)
scsi: sd: Optimal I/O size should be a multiple of reported granularity
Commit a83da8a4509d ("scsi: sd: Optimal I/O size should be a multiple of physical block size") validated the reported optimal I/O size against the physical block size to overcome problems with devices reporting nonsensical transfer sizes. However, some devices claim conformity to older SCSI versions that predate the physical block size being reported. Other devices do not report a physical block size at all. We need to be able to validate the optimal I/O size on those devices as well. Many devices report an OPTIMAL TRANSFER LENGTH GRANULARITY in the same VPD page as the OPTIMAL TRANSFER LENGTH. Use this value to validate the optimal I/O size. Also check that the reported granularity is a multiple of the physical block size, if supported. Link: https://lore.kernel.org/r/33fb522e-4f61-1b76-914f-c9e6a3553c9b@gmail.com Link: https://lore.kernel.org/r/20220302053559.32147-9-martin.petersen@oracle.com Reported-by: Bernhard Sulzer <micraft.b@gmail.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/sd.h')
-rw-r--r--drivers/scsi/sd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
index d249933ba69e..2abad54fd23f 100644
--- a/drivers/scsi/sd.h
+++ b/drivers/scsi/sd.h
@@ -114,6 +114,7 @@ struct scsi_disk {
atomic_t openers;
sector_t capacity; /* size in logical blocks */
int max_retries;
+ u32 min_xfer_blocks;
u32 max_xfer_blocks;
u32 opt_xfer_blocks;
u32 max_ws_blocks;