diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-04-06 17:12:19 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-04-06 17:12:19 +0300 |
commit | 5b3b9197c28c8245c3c13ddf3ddf4eb10c2b23e1 (patch) | |
tree | 13da06210462ccf0402f4a2e3aa914bebe3098b2 | |
parent | 1d1665279a845d16c93687389e364386e3fe0f38 (diff) | |
parent | d3205ab75e99a47539ec91ef85ba488f4ddfeaa9 (diff) | |
download | linux-5b3b9197c28c8245c3c13ddf3ddf4eb10c2b23e1.tar.xz |
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
-rw-r--r-- | drivers/nvme/host/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 53ef028596c6..d6a9bac91a4c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1674,6 +1674,9 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns) struct request_queue *queue = disk->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) { blk_queue_max_discard_sectors(queue, 0); return; @@ -1688,9 +1691,6 @@ static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns) if (queue->limits.max_discard_sectors) 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_segments(queue, ctrl->max_discard_segments); |