]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nvme-loop: reset queue count to 1 in nvme_loop_destroy_io_queues()
authorHannes Reinecke <hare@suse.de>
Wed, 26 May 2021 15:23:15 +0000 (17:23 +0200)
committerSasha Levin <sashal@kernel.org>
Wed, 30 Jun 2021 12:48:12 +0000 (08:48 -0400)
commita0a60f6092b50a0cc261e829bb5fbb2ac33dac29
treefa222b90ecfad6a95686b55123b06d541abe5ac1
parentfff7a22c612130ff4e18bdbc4741c7f936caa9ad
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>
drivers/nvme/target/loop.c