nvme: update the explanation for not updating the limits in nvme_config_discard

Expeand the comment a bit to explain what is going on.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
This commit is contained in:
Christoph Hellwig 2023-12-26 08:58:41 +00:00 committed by Keith Busch
parent 3a96bff229
commit d3074e9a73

View File

@ -1743,7 +1743,13 @@ static void nvme_config_discard(struct nvme_ctrl *ctrl, struct gendisk *disk,
queue->limits.discard_granularity = size;
/* If discard is already enabled, don't reset queue limits */
/*
* If discard is already enabled, don't reset queue limits.
*
* This works around the fact that the block layer can't cope well with
* updating the hardware limits when overridden through sysfs. This is
* harmless because discard limits in NVMe are purely advisory.
*/
if (queue->limits.max_discard_sectors)
return;