Skip to content

Commit 5fe56de

Browse files
John Garryaxboe
authored andcommitted
blk-mq: Put driver tag in blk_mq_dispatch_rq_list() when no budget
If in blk_mq_dispatch_rq_list() we find no budget, then we break of the dispatch loop, but the request may keep the driver tag, evaulated in 'nxt' in the previous loop iteration. Fix by putting the driver tag for that request. Reviewed-by: Ming Lei <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 8f3d9f3 commit 5fe56de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

block/blk-mq.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,10 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
12221222
rq = list_first_entry(list, struct request, queuelist);
12231223

12241224
hctx = rq->mq_hctx;
1225-
if (!got_budget && !blk_mq_get_dispatch_budget(hctx))
1225+
if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) {
1226+
blk_mq_put_driver_tag(rq);
12261227
break;
1228+
}
12271229

12281230
if (!blk_mq_get_driver_tag(rq)) {
12291231
/*

0 commit comments

Comments
 (0)