summaryrefslogtreecommitdiff
path: root/drivers/nvme/target/loop.c
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2021-05-26 18:23:15 +0300
committerChristoph Hellwig <hch@lst.de>2021-06-02 10:06:53 +0300
commita6c144f3d2e230f2b3ac5ed8c51e0f0391556197 (patch)
tree161825fb24ebecc1fbced384b6eaf081906a2e1a /drivers/nvme/target/loop.c
parent12b2aaadb6d5ef77434e8db21f469f46fe2d392e (diff)
downloadlinux-a6c144f3d2e230f2b3ac5ed8c51e0f0391556197.tar.xz
nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues()
The queue count is increased in nvme_loop_init_io_queues(), so we need to reset it to 1 at the end of nvme_loop_destroy_io_queues(). Otherwise the function is not re-entrant safe, and crash will happen during concurrent reset and remove calls. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/target/loop.c')
-rw-r--r--drivers/nvme/target/loop.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
index cb30cb942e1d..93fca31e5043 100644
--- a/drivers/nvme/target/loop.c
+++ b/drivers/nvme/target/loop.c
@@ -299,6 +299,7 @@ static void nvme_loop_destroy_io_queues(struct nvme_loop_ctrl *ctrl)
clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[i].flags);
nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
}
+ ctrl->ctrl.queue_count = 1;
}
static int nvme_loop_init_io_queues(struct nvme_loop_ctrl *ctrl)