From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755703AbcE0AkR (ORCPT ); Thu, 26 May 2016 20:40:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41340 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755533AbcE0AkP (ORCPT ); Thu, 26 May 2016 20:40:15 -0400 Date: Fri, 27 May 2016 08:40:13 +0800 From: Fam Zheng To: Long Li Cc: "James E.J. Bottomley" , "Martin K. Petersen" , KY Srinivasan , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Use the correct size to set block max sectors Message-ID: <20160527004013.GH31052@ad.usersys.redhat.com> References: <1464307708-4315-1-git-send-email-longli@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464307708-4315-1-git-send-email-longli@microsoft.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 27 May 2016 00:40:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > 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