提交 2d5ba0e2 编写于 作者: M Ming Lei 提交者: 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 <josef@toxicpanda.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Mark Brown <broonie@kernel.org>
Cc: Matt Hart <matthew.hart@linaro.org>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: John Garry <john.garry@huawei.com>
Cc: Hannes Reinecke <hare@suse.com>,
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Cc: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: linux-scsi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: NBart Van Assche <bart.vanassche@wdc.com>
Tested-by: NGuenter Roeck <linux@roeck-us.net>
Reported-by: NMark Brown <broonie@kernel.org>
Reported-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NMing Lei <ming.lei@redhat.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 5151842b
...@@ -271,7 +271,7 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data) ...@@ -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[]. * test and set the bit before assining ->rqs[].
*/ */
rq = tags->rqs[bitnr]; 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); iter_data->fn(rq, iter_data->data, reserved);
return true; return true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册