Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ming.lei@redhat.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

John Garry and committed by
Jens Axboe
5fe56de7 8f3d9f35

+3 -1
+3 -1
block/blk-mq.c
··· 1222 1222 rq = list_first_entry(list, struct request, queuelist); 1223 1223 1224 1224 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); 1226 1227 break; 1228 + } 1227 1229 1228 1230 if (!blk_mq_get_driver_tag(rq)) { 1229 1231 /*