[PATCH 1/4] block: don't unconditionally set max_discard_sectors in blk_queue_max_discard_sectors

Christoph Hellwig hch at lst.de
Wed Jul 12 09:23:10 PDT 2023


On Mon, Jul 10, 2023 at 06:42:36PM +0800, Ming Lei wrote:
> Userspace may write 0 to discard_max_bytes, and this patch still can
> override user setting.

True.  Maybe the right thing is to have a user_limit field, and just
looks at the min of that and the hw limit everywhere.  These hardware
vs user limits are a pain, and we'll probably need some proper
infrastructure for them :P




More information about the Linux-nvme mailing list