mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Long Li <longli@microsoft.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	KY Srinivasan <kys@microsoft.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Use the correct size to set block max sectors
Date: Fri, 27 May 2016 08:40:13 +0800	[thread overview]
Message-ID: <20160527004013.GH31052@ad.usersys.redhat.com> (raw)
In-Reply-To: <1464307708-4315-1-git-send-email-longli@microsoft.com>

On Thu, 05/26 17:08, Long Li wrote:
> 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);

Other than the superfluous parenthesis, looks good to me.

Fam

> +	}
>  	else
>  		rw_max = BLK_DEF_MAX_SECTORS;
>  
> -- 
> 1.8.5.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-05-27  0:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27  0:08 Long Li
2016-05-27  0:40 ` Fam Zheng [this message]
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=20160527004013.GH31052@ad.usersys.redhat.com \
    --to=famz@redhat.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=longli@microsoft.com \
    --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®