Commit 2d5ba0e2 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe

blk-mq: fix blk_mq_tagset_busy_iter

Commit d250bf4e("blk-mq: only iterate over inflight requests
in blk_mq_tagset_busy_iter") uses 'blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT'
to replace 'blk_mq_request_started(req)', this way is wrong, and causes
lots of test system hang during booting.

Fix the issue by using blk_mq_request_started(req) inside bt_tags_iter().

Fixes: d250bf4e ("blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter")
Cc: Josef Bacik <>
Cc: Christoph Hellwig <>
Cc: Guenter Roeck <>
Cc: Mark Brown <>
Cc: Matt Hart <>
Cc: Johannes Thumshirn <>
Cc: John Garry <>
Cc: Hannes Reinecke <>,
Cc: "Martin K. Petersen" <>,
Cc: James Bottomley <>
Reviewed-by: default avatarBart Van Assche <>
Tested-by: default avatarGuenter Roeck <>
Reported-by: default avatarMark Brown <>
Reported-by: default avatarGuenter Roeck <>
Signed-off-by: default avatarMing Lei <>
Signed-off-by: default avatarJens Axboe <>
parent 5151842b
......@@ -271,7 +271,7 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data)
* test and set the bit before assining ->rqs[].
rq = tags->rqs[bitnr];
if (rq && blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT)
if (rq && blk_mq_request_started(rq))
iter_data->fn(rq, iter_data->data, reserved);
return true;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment