提交 d0eb20a8 编写于 作者: M Martin K. Petersen

sd: Optimal I/O size is in bytes, not sectors

Commit ca369d51 ("block/sd: Fix device-imposed transfer length
limits") accidentally switched optimal I/O size reporting from bytes to
block layer sectors.
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Reported-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Tested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
Fixes: ca369d51
Cc: stable@vger.kernel.org # 4.4+
Reviewed-by: NJames E.J. Bottomley <James.Bottomley@HansenPartnership.com>
Reviewed-by: NEwan D. Milne <emilne@redhat.com>
Reviewed-by: NMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
上级 c142ce0d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册