From: Long Li <longli@microsoft.com>
To: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Long Li <longli@microsoft.com>, KY Srinivasan <kys@microsoft.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Use the correct size to set block max sectors
Date: Thu, 26 May 2016 17:08:28 -0700 [thread overview]
Message-ID: <1464307708-4315-1-git-send-email-longli@microsoft.com> (raw)
The block sector size should be in unit of 512 bytes, not in bytes.
Signed-off-by: Long Li <longli@microsoft.com>
---
drivers/scsi/sd.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 428c03e..4bce17e 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2862,9 +2862,11 @@ static int sd_revalidate_disk(struct gendisk *disk)
if (sdkp->opt_xfer_blocks &&
sdkp->opt_xfer_blocks <= dev_max &&
sdkp->opt_xfer_blocks <= SD_DEF_XFER_BLOCKS &&
- sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_SIZE)
- rw_max = q->limits.io_opt =
+ sdkp->opt_xfer_blocks * sdp->sector_size >= PAGE_SIZE) {
+ q->limits.io_opt =
sdkp->opt_xfer_blocks * sdp->sector_size;
+ rw_max = (q->limits.io_opt >> 9);
+ }
else
rw_max = BLK_DEF_MAX_SECTORS;
--
1.8.5.6
next reply other threads:[~2016-05-26 22:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 0:08 Long Li [this message]
2016-05-27 0:40 ` Fam Zheng
2016-05-27 1:35 ` Joe Perches
2016-05-27 2:18 ` Bart Van Assche
2016-05-27 4:06 ` Long Li
2016-06-01 2:44 ` Martin K. Petersen
2016-06-03 22:42 ` Long Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1464307708-4315-1-git-send-email-longli@microsoft.com \
--to=longli@microsoft.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®