[PATCH for-4.5 04/13] NVMe: Set queue limits max_dev_sectors

Christoph Hellwig hch at infradead.org
Wed Feb 10 10:40:31 PST 2016


On Wed, Feb 10, 2016 at 06:24:17PM +0000, Keith Busch wrote:
> On Wed, Feb 10, 2016 at 10:20:51AM -0800, Christoph Hellwig wrote:
> > On Wed, Feb 10, 2016 at 11:17:21AM -0700, Keith Busch wrote:
> > > Signed-off-by: Keith Busch <keith.busch at intel.com>
> > 
> > why?
> 
> Ah, missing change log here.
> 
> It is so the queue limits will be correct. The max_hw_sectors will be
> wrong without this.

How so?  We only ever look at max_dev_sectors in blk_queue_max_hw_sectors
and blk_stack_limits, and both do a min_not_zero.  A zero max_dev_sectors
should thus be perfectly fine, and in fact no one but the SCSI disk
driver even bothers to set one.

Ohh, I see now - blk_set_default_limits initializes max_dev_sectors to
BLK_SAFE_MAX_SECTORS instead of leaving it as zero.  I think that's the
issue which needs to be fixed.




More information about the Linux-nvme mailing list