Skip to content

Commit 5b3b919

Browse files
committed
Merge tag 'nvme-6.3-2023-04-06' of git://git.infradead.org/nvme into block-6.3
Pull NVMe fix from Christoph: "nvme fixes for Linux 6.3 - fix discard support without oncs (Keith Busch)" * tag 'nvme-6.3-2023-04-06' of git://git.infradead.org/nvme: nvme: fix discard support without oncs
2 parents 1d16652 + d3205ab commit 5b3b919

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/nvme/host/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1674,6 +1674,9 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
16741674
struct request_queue *queue = disk->queue;
16751675
u32 size = queue_logical_block_size(queue);
16761676

1677+
if (ctrl->dmrsl && ctrl->dmrsl <= nvme_sect_to_lba(ns, UINT_MAX))
1678+
ctrl->max_discard_sectors = nvme_lba_to_sect(ns, ctrl->dmrsl);
1679+
16771680
if (ctrl->max_discard_sectors == 0) {
16781681
blk_queue_max_discard_sectors(queue, 0);
16791682
return;
@@ -1688,9 +1691,6 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
16881691
if (queue->limits.max_discard_sectors)
16891692
return;
16901693

1691-
if (ctrl->dmrsl && ctrl->dmrsl <= nvme_sect_to_lba(ns, UINT_MAX))
1692-
ctrl->max_discard_sectors = nvme_lba_to_sect(ns, ctrl->dmrsl);
1693-
16941694
blk_queue_max_discard_sectors(queue, ctrl->max_discard_sectors);
16951695
blk_queue_max_discard_segments(queue, ctrl->max_discard_segments);
16961696

0 commit comments

Comments
 (0)