diff options
author | Hannes Reinecke <hare@suse.de> | 2021-05-26 18:23:17 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-06-02 10:06:53 +0300 |
commit | 4237de2f73a669e4f89ac0aa2b44fb1a1d9ec583 (patch) | |
tree | 1d2b051abc8306f5ea9f77efd182435c0604a759 /drivers/nvme | |
parent | 1c5f8e882a05de5c011e8c3fbeceb0d1c590eb53 (diff) | |
download | linux-4237de2f73a669e4f89ac0aa2b44fb1a1d9ec583.tar.xz |
nvme-loop: check for NVME_LOOP_Q_LIVE in nvme_loop_destroy_admin_queue()
We need to check the NVME_LOOP_Q_LIVE flag in
nvme_loop_destroy_admin_queue() to protect against duplicate
invocations eg 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')
-rw-r--r-- | drivers/nvme/target/loop.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c index 8643c71953ad..209ad4bc2695 100644 --- a/drivers/nvme/target/loop.c +++ b/drivers/nvme/target/loop.c @@ -263,7 +263,8 @@ static const struct blk_mq_ops nvme_loop_admin_mq_ops = { static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl) { - clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags); + if (!test_and_clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags)) + return; nvmet_sq_destroy(&ctrl->queues[0].nvme_sq); blk_cleanup_queue(ctrl->ctrl.admin_q); blk_cleanup_queue(ctrl->ctrl.fabrics_q); |