Skip to content

Commit 2631857

Browse files
Christoph Hellwigaxboe
authored andcommitted
nvme: add proper discard setup for the multipath device
Add a gendisk argument to nvme_config_discard so that the call to nvme_update_disk_info for the multipath device node updates the proper request_queue. Signed-off-by: Christoph Hellwig <hch@lst.de> Reported-by: Sagi Grimberg <sagi@grimberg.me> Reviewed-by: Keith Busch <keith.busch@intel.com> Reviewed-by: Max Gurtovoy <maxg@mellanox.com> Tested-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent b1aafb3 commit 2631857

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
@@ -1495,10 +1495,10 @@ static void nvme_set_chunk_size(struct nvme_ns *ns)
14951495
blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(chunk_size));
14961496
}
14971497

1498-
static void nvme_config_discard(struct nvme_ns *ns)
1498+
static void nvme_config_discard(struct gendisk *disk, struct nvme_ns *ns)
14991499
{
15001500
struct nvme_ctrl *ctrl = ns->ctrl;
1501-
struct request_queue *queue = ns->queue;
1501+
struct request_queue *queue = disk->queue;
15021502
u32 size = queue_logical_block_size(queue);
15031503

15041504
if (!(ctrl->oncs & NVME_CTRL_ONCS_DSM)) {
@@ -1606,7 +1606,7 @@ static void nvme_update_disk_info(struct gendisk *disk,
16061606

16071607
set_capacity(disk, capacity);
16081608

1609-
nvme_config_discard(ns);
1609+
nvme_config_discard(disk, ns);
16101610
nvme_config_write_zeroes(ns);
16111611

16121612
if (id->nsattr & (1 << 0))

0 commit comments

Comments
 (0)