diff options
| author | Hannes Reinecke <hare@suse.de> | 2021-05-26 17:23:15 +0200 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2021-06-30 08:48:46 -0400 |
| commit | 41e4946a5b4405b264243d2119a0aee313d0c1af (patch) | |
| tree | 2d4c401ea3d768193f6c9b184e345ac1f2c1451c /drivers | |
| parent | 46ce76b0bc3949b39e45eb19733712b946e5e3f3 (diff) | |
| download | linux-41e4946a5b4405b264243d2119a0aee313d0c1af.tar.gz linux-41e4946a5b4405b264243d2119a0aee313d0c1af.tar.bz2 linux-41e4946a5b4405b264243d2119a0aee313d0c1af.zip | |
nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues()
[ Upstream commit a6c144f3d2e230f2b3ac5ed8c51e0f0391556197 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/nvme/target/loop.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 3388d2788fe0..5f33c3a9469b 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -322,6 +322,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) |
