blob: f55575f1b2ba2f965798a2aa827cfd0ea43af2f0 [file] [log] [blame]
From 650badd18a5816546745986e2f2c439bf76a04eb Mon Sep 17 00:00:00 2001
From: Ming Lei <>
Date: Fri, 19 Jun 2020 16:42:14 +0800
Subject: [PATCH] dm rq: don't call blk_mq_queue_stopped() in dm_stop_queue()
commit e766668c6cd49d741cfb49eaeb38998ba34d27bc upstream.
dm_stop_queue() only uses blk_mq_quiesce_queue() so it doesn't
formally stop the blk-mq queue; therefore there is no point making the
blk_mq_queue_stopped() check -- it will never be stopped.
In addition, even though dm_stop_queue() actually tries to quiesce hw
queues via blk_mq_quiesce_queue(), checking with blk_queue_quiesced()
to avoid unnecessary queue quiesce isn't reliable because: the
QUEUE_FLAG_QUIESCED flag is set before synchronize_rcu() and
dm_stop_queue() may be called when synchronize_rcu() from another
blk_mq_quiesce_queue() is in-progress.
Fixes: 7b17c2f7292ba ("dm: Fix a race condition related to stopping and starting queues")
Signed-off-by: Ming Lei <>
Signed-off-by: Mike Snitzer <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index b41ecb451c78..99784f16cb56 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -70,9 +70,6 @@ void dm_start_queue(struct request_queue *q)
void dm_stop_queue(struct request_queue *q)
- if (blk_mq_queue_stopped(q))
- return;