All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	Laurence Oberman <loberman@redhat.com>,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Subject: Re: [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable
Date: Thu, 30 Mar 2017 12:13:11 +0800	[thread overview]
Message-ID: <20170330041311.GA32392@lemon.lan> (raw)
In-Reply-To: <yq1k2774hht.fsf@oracle.com>

On Wed, 03/29 22:37, Martin K. Petersen wrote:
> Fam Zheng <famz@redhat.com> writes:
> 
> Fam,
> 
> > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> > index fcfeddc..a5c7e67 100644
> > --- a/drivers/scsi/sd.c
> > +++ b/drivers/scsi/sd.c
> > @@ -2957,6 +2957,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
> >  		rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks);
> >  	} else
> >  		rw_max = BLK_DEF_MAX_SECTORS;
> > +	rw_max = min_not_zero(rw_max, logical_to_sectors(sdp, dev_max));
> >  
> >  	/* Combine with controller limits */
> >  	q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q));
> 
> Instead of updating rw_max twice, how about:
> 
> } else
> 	rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
>                               BLK_DEF_MAX_SECTORS);

Yes, it is better. Is it okay to make the change when you apply?

Fam

  reply	other threads:[~2017-03-30  4:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28  4:41 [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable Fam Zheng
2017-03-28  7:14 ` kbuild test robot
2017-03-28  7:14   ` kbuild test robot
2017-03-30  2:37 ` Martin K. Petersen
2017-03-30  4:13   ` Fam Zheng [this message]
2017-03-30 15:30     ` Martin K. Petersen
2017-03-31  4:05       ` Fam Zheng

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=20170330041311.GA32392@lemon.lan \
    --to=famz@redhat.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=loberman@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.