From 4c41fd4c596524a3a9bc42bbb5c143b8a66a7f70 Mon Sep 17 00:00:00 2001 From: liyouhong Date: Wed, 20 May 2026 17:50:24 +0800 Subject: [PATCH] block, bfq: skip dispatch when selected queue has no next_rq bfq_dispatch_rq_from_bfqq() dispatches bfqq->next_rq directly. Add a guard in __bfq_dispatch_request() so that dispatch is skipped if the selected queue unexpectedly has no next request. This keeps behavior unchanged in normal paths while avoiding entering the dispatch helper with a missing next_rq. Signed-off-by: liyouhong --- block/bfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 141c602d5e858..c3d9d02064b75 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5226,7 +5226,7 @@ static struct request *__bfq_dispatch_request(struct blk_mq_hw_ctx *hctx) goto exit; bfqq = bfq_select_queue(bfqd); - if (!bfqq) + if (!bfqq || !bfqq->next_rq) goto exit; rq = bfq_dispatch_rq_from_bfqq(bfqd, bfqq);