Skip to content

Commit 4237de2

Browse files
hreineckeChristoph Hellwig
authored andcommitted
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 <[email protected]> Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 1c5f8e8 commit 4237de2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/target/loop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,8 @@ static const struct blk_mq_ops nvme_loop_admin_mq_ops = {
263263

264264
static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl)
265265
{
266-
clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags);
266+
if (!test_and_clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[0].flags))
267+
return;
267268
nvmet_sq_destroy(&ctrl->queues[0].nvme_sq);
268269
blk_cleanup_queue(ctrl->ctrl.admin_q);
269270
blk_cleanup_queue(ctrl->ctrl.fabrics_q);

0 commit comments

Comments
 (0)