[PATCH] nvme: respect user max_discard_sectors setting

Keith Busch kbusch at kernel.org
Fri Jan 5 08:07:40 PST 2024


On Fri, Jan 05, 2024 at 05:34:01AM +0100, Christoph Hellwig wrote:
> On Thu, Jan 04, 2024 at 11:12:44AM -0800, Keith Busch wrote:
> > From: Keith Busch <kbusch at kernel.org>
> > 
> > A user can change that attribute to 0 through sysfs, but they can't
> > change the hw limit. Check the hw limit instead to know if the driver
> > previously set up discard capabilities.
> 
> blk_queue_max_discard_sectors updates the hardware and user limit.
> It's a bit of a mess, but Jens didn't quite like my half-hearted fix
> last time.  If we want to do this properly we probably need a separate
> user limit and recalculate the effective limit when either the hw or
> user limit changes.  For early in the 6.9 merge window I plan to redo
> how all the limits are set, and that should give us a better opportunity
> for these kinds of things

Cool, I look forward to seeing what improvements you have in mind for
this error prone area. In the meantime, is this patch okay with you or
is that a 'Nak'?



More information about the Linux-nvme mailing list