linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sd: Optimal I/O size is in bytes, not sectors
@ 2016-01-20 16:01 Martin K. Petersen
  2016-01-20 16:11 ` Johannes Thumshirn
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Martin K. Petersen @ 2016-01-20 16:01 UTC (permalink / raw)
  To: linux-scsi; +Cc: borntraeger, Martin K. Petersen

Commit ca369d51b3e1 ("block/sd: Fix device-imposed transfer length
limits") accidentally switched optimal I/O size reporting from bytes to
block layer sectors.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 drivers/scsi/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 4e08d1cd704d..ec163d08f6c3 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2893,7 +2893,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
 	    sdkp->opt_xfer_blocks <= SD_DEF_XFER_BLOCKS &&
 	    sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_CACHE_SIZE)
 		rw_max = q->limits.io_opt =
-			logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
+			sdkp->opt_xfer_blocks * sdp->sector_size;
 	else
 		rw_max = BLK_DEF_MAX_SECTORS;
 
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-05-13  2:32 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-20 16:01 [PATCH] sd: Optimal I/O size is in bytes, not sectors Martin K. Petersen
2016-01-20 16:11 ` Johannes Thumshirn
2016-01-20 16:19 ` James Bottomley
2016-01-20 16:40   ` Martin K. Petersen
2016-01-20 16:47     ` James Bottomley
2016-01-22  8:16       ` Greg Kroah-Hartman
2016-01-20 16:19 ` Matthew R. Ochs
2016-01-20 17:17 ` Ewan Milne
2016-01-20 18:28 ` Christian Borntraeger
2016-05-12  4:04 ` Fam Zheng
2016-05-12 17:13   ` Tom Yan
2016-05-13  2:32   ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).