From: Sagi Grimberg Date: Tue, 4 Jul 2017 06:57:09 +0000 (+0300) Subject: nbd: quiesce request queues to make sure no submissions are inflight X-Git-Tag: v4.14-rc1~495^2~1^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b52c2e92546ee794a5bbab4d8ea435c1de85a8cb;p=platform%2Fkernel%2Flinux-rpi.git 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 Acked-by: Josef Bacik Signed-off-by: Sagi Grimberg --- diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 977ec96..dea7d85 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -661,9 +661,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"); }