]> Git Repo - J-linux.git/commitdiff
nvme: wait until quiesce is done
authorMing Lei <[email protected]>
Tue, 9 Nov 2021 07:11:44 +0000 (15:11 +0800)
committerJens Axboe <[email protected]>
Tue, 9 Nov 2021 15:14:27 +0000 (08:14 -0700)
NVMe uses one atomic flag to check if quiesce is needed. If quiesce is
started, the helper returns immediately. This way is wrong, since we
have to wait until quiesce is done.

Fixes: e70feb8b3e68 ("blk-mq: support concurrent queue quiesce/unquiesce")
Reviewed-by: Keith Busch <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
drivers/nvme/host/core.c

index eb284f45fc441ab87f7b2e5b696787229f3f3932..2fc5ea9a77938eb32db982fa5edde942481226cd 100644 (file)
@@ -4476,6 +4476,8 @@ static void nvme_stop_ns_queue(struct nvme_ns *ns)
 {
        if (!test_and_set_bit(NVME_NS_STOPPED, &ns->flags))
                blk_mq_quiesce_queue(ns->queue);
+       else
+               blk_mq_wait_quiesce_done(ns->queue);
 }
 
 /*
@@ -4595,6 +4597,8 @@ void nvme_stop_admin_queue(struct nvme_ctrl *ctrl)
 {
        if (!test_and_set_bit(NVME_CTRL_ADMIN_Q_STOPPED, &ctrl->flags))
                blk_mq_quiesce_queue(ctrl->admin_q);
+       else
+               blk_mq_wait_quiesce_done(ctrl->admin_q);
 }
 EXPORT_SYMBOL_GPL(nvme_stop_admin_queue);
 
This page took 0.059611 seconds and 4 git commands to generate.