Skip to content

Commit d3074e9

Browse files
Christoph Hellwigkeithbusch
authored andcommitted
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>
1 parent 3a96bff commit d3074e9

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/nvme/host/core.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,13 @@ static void nvme_config_discard(struct nvme_ctrl *ctrl, struct gendisk *disk,
17431743

17441744
queue->limits.discard_granularity = size;
17451745

1746-
/* If discard is already enabled, don't reset queue limits */
1746+
/*
1747+
* If discard is already enabled, don't reset queue limits.
1748+
*
1749+
* This works around the fact that the block layer can't cope well with
1750+
* updating the hardware limits when overridden through sysfs. This is
1751+
* harmless because discard limits in NVMe are purely advisory.
1752+
*/
17471753
if (queue->limits.max_discard_sectors)
17481754
return;
17491755

0 commit comments

Comments
 (0)