Skip to content

Commit a6c144f

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

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/nvme/target/loop.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ static void nvme_loop_destroy_io_queues(struct nvme_loop_ctrl *ctrl)
299299
clear_bit(NVME_LOOP_Q_LIVE, &ctrl->queues[i].flags);
300300
nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
301301
}
302+
ctrl->ctrl.queue_count = 1;
302303
}
303304

304305
static int nvme_loop_init_io_queues(struct nvme_loop_ctrl *ctrl)

0 commit comments

Comments
 (0)