nvme: Fix a race condition related to stopping queues
authorBart Van Assche <bart.vanassche@sandisk.com>
Sat, 29 Oct 2016 00:23:19 +0000 (17:23 -0700)
committerJens Axboe <axboe@fb.com>
Wed, 2 Nov 2016 18:50:19 +0000 (12:50 -0600)
Avoid that nvme_queue_rq() is still running when nvme_stop_queues()
returns.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/nvme/host/core.c

index e8070e3cc7c756eab284daa1e6cb9ceb13ff7921..75565b5951d92afbacd58e814f72edea4da9c514 100644 (file)
@@ -2081,7 +2081,7 @@ void nvme_stop_queues(struct nvme_ctrl *ctrl)
                queue_flag_set(QUEUE_FLAG_STOPPED, ns->queue);
                spin_unlock_irq(ns->queue->queue_lock);
 
-               blk_mq_stop_hw_queues(ns->queue);
+               blk_mq_quiesce_queue(ns->queue);
        }
        mutex_unlock(&ctrl->namespaces_mutex);
 }