Commit 3174dd33 authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe
Browse files

nvme: Fix a race condition related to stopping queues



Avoid that nvme_queue_rq() is still running when nvme_stop_queues()
returns.

Signed-off-by: default avatarBart Van Assche <bart.vanassche@sandisk.com>
Cc: Keith Busch <keith.busch@intel.com>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 7b17c2f7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
}