[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20250811052702.145189-3-shivani.agarwal@broadcom.com>
Date: Sun, 10 Aug 2025 22:27:02 -0700
From: Shivani Agarwal <shivani.agarwal@...adcom.com>
To: stable@...r.kernel.org,
gregkh@...uxfoundation.org
Cc: bcm-kernel-feedback-list@...adcom.com,
linux-kernel@...r.kernel.org,
ajay.kaher@...adcom.com,
alexey.makhalov@...adcom.com,
tapas.kundu@...adcom.com,
agk@...hat.com,
snitzer@...nel.org,
mpatocka@...hat.com,
dm-devel@...ts.linux.dev,
Ming Lei <ming.lei@...hat.com>,
Mike Snitzer <snitzer@...hat.com>,
Shivani Agarwal <shivani.agarwal@...adcom.com>
Subject: [PATCH 2/2 v5.10] dm rq: don't queue request to blk-mq during DM suspend
From: Ming Lei <ming.lei@...hat.com>
commit b4459b11e84092658fa195a2587aff3b9637f0e7 upstream.
DM uses blk-mq's quiesce/unquiesce to stop/start device mapper queue.
But blk-mq's unquiesce may come from outside events, such as elevator
switch, updating nr_requests or others, and request may come during
suspend, so simply ask for blk-mq to requeue it.
Fixes one kernel panic issue when running updating nr_requests and
dm-mpath suspend/resume stress test.
Cc: stable@...r.kernel.org
Signed-off-by: Ming Lei <ming.lei@...hat.com>
Signed-off-by: Mike Snitzer <snitzer@...hat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
[Shivani: Modified to apply on 5.10.y]
Signed-off-by: Shivani Agarwal <shivani.agarwal@...adcom.com>
---
drivers/md/dm-rq.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 7762bde40963..a6ea77432e34 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -490,6 +490,14 @@ static blk_status_t dm_mq_queue_rq(struct blk_mq_hw_ctx *hctx,
struct mapped_device *md = tio->md;
struct dm_target *ti = md->immutable_target;
+ /*
+ * blk-mq's unquiesce may come from outside events, such as
+ * elevator switch, updating nr_requests or others, and request may
+ * come during suspend, so simply ask for blk-mq to requeue it.
+ */
+ if (unlikely(test_bit(DMF_BLOCK_IO_FOR_SUSPEND, &md->flags)))
+ return BLK_STS_RESOURCE;
+
if (unlikely(!ti)) {
int srcu_idx;
struct dm_table *map;
--
2.40.4
Powered by blists - more mailing lists