Commit 5b3b9197 authored by Jens Axboe's avatar Jens Axboe

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
parents 1d166527 d3205ab7
...@@ -1674,6 +1674,9 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns) ...@@ -1674,6 +1674,9 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
struct request_queue *queue = disk->queue; struct request_queue *queue = disk->queue;
u32 size = queue_logical_block_size(queue); u32 size = queue_logical_block_size(queue);
if (ctrl->dmrsl && ctrl->dmrsl <= nvme_sect_to_lba(ns, UINT_MAX))
ctrl->max_discard_sectors = nvme_lba_to_sect(ns, ctrl->dmrsl);
if (ctrl->max_discard_sectors == 0) { if (ctrl->max_discard_sectors == 0) {
blk_queue_max_discard_sectors(queue, 0); blk_queue_max_discard_sectors(queue, 0);
return; return;
...@@ -1688,9 +1691,6 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns) ...@@ -1688,9 +1691,6 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
if (queue->limits.max_discard_sectors) if (queue->limits.max_discard_sectors)
return; return;
if (ctrl->dmrsl && ctrl->dmrsl <= nvme_sect_to_lba(ns, UINT_MAX))
ctrl->max_discard_sectors = nvme_lba_to_sect(ns, ctrl->dmrsl);
blk_queue_max_discard_sectors(queue, ctrl->max_discard_sectors); blk_queue_max_discard_sectors(queue, ctrl->max_discard_sectors);
blk_queue_max_discard_segments(queue, ctrl->max_discard_segments); blk_queue_max_discard_segments(queue, ctrl->max_discard_segments);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment