From 88819308f54785f94febb2f59510c4e50a1052bd Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 13 Apr 2023 12:50:44 -0700 Subject: [PATCH] ANDROID: block: Warn if a zoned write is about to be reordered Make it easier to debug out-of-order zoned writes. Bug: 275581839 Change-Id: I5d1f1cd47ff1b4c10788edeebba5e80bd82b2bf3 Signed-off-by: Bart Van Assche --- block/blk-mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index faf8188133fa..c779780403f7 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1876,6 +1876,8 @@ void blk_mq_request_bypass_insert(struct request *rq, bool at_head, { struct blk_mq_hw_ctx *hctx = rq->mq_hctx; + WARN_ON_ONCE(rq->q->elevator && blk_rq_is_seq_zoned_write(rq)); + spin_lock(&hctx->lock); if (at_head) list_add(&rq->queuelist, &hctx->dispatch);