[RHEL7,COMMIT] ms/nbd: quiesce request queues to make sure no submissions are inflight

Submitted by Konstantin Khorenko on Nov. 6, 2019, 3:30 p.m.


Message ID 201911061530.xA6FUlEA032733@finist-ce7.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko Nov. 6, 2019, 3:30 p.m.
The commit is pushed to "branch-rh7-3.10.0-1062.4.1.vz7.115.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1062.4.1.vz7.115.11
commit dacc5d2772100fa69c598ada80283e82f2652a89
Author: Sagi Grimberg <sagi@grimberg.me>
Date:   Wed Nov 6 18:30:47 2019 +0300

    ms/nbd: quiesce request queues to make sure no submissions are inflight
    Unlike blk_mq_stop_hw_queues, blk_mq_quiesce_queue respects the
    submission path rcu grace. quiesce the queue before iterating
    on live tags.
    Reviewed-by: Ming Lei <ming.lei@redhat.com>
    Acked-by: Josef Bacik <jbacik@fb.com>
    Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
    (cherry picked from commit b52c2e92546ee794a5bbab4d8ea435c1de85a8cb)
    Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
 drivers/block/nbd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 8e43eac169f4..4a17d320d7fa 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -642,9 +642,9 @@  static void nbd_clear_req(struct request *req, void *data, bool reserved)
 static void nbd_clear_que(struct nbd_device *nbd)
-	blk_mq_stop_hw_queues(nbd->disk->queue);
+	blk_mq_quiesce_queue(nbd->disk->queue);
 	blk_mq_tagset_busy_iter(&nbd->tag_set, nbd_clear_req, NULL);
-	blk_mq_start_hw_queues(nbd->disk->queue);
+	blk_mq_unquiesce_queue(nbd->disk->queue);
 	dev_dbg(disk_to_dev(nbd->disk), "queue cleared\n");