
From: yu kuai <yukuai3@huawei.com> hulk inclusion category: bugfix bugzilla: 34280 CVE: NA --------------------------- blk_mq_tagset_busy_iter() is not safe that it could get stale request in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter() here. Signed-off-by: yu kuai <yukuai3@huawei.com> Reviewed-by: Hou Tao <houtao1@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- block/blk-mq-debugfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index f0865b6..e098b79 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -427,7 +427,8 @@ struct show_busy_params { * Note: the state of a request may change while this function is in progress, * e.g. due to a concurrent blk_mq_finish_request() call. */ -static void hctx_show_busy_rq(struct request *rq, void *data, bool reserved) +static void hctx_show_busy_rq(struct blk_mq_hw_ctx *hctx, + struct request *rq, void *data, bool reserved) { const struct show_busy_params *params = data; @@ -442,7 +443,7 @@ static int hctx_busy_show(void *data, struct seq_file *m) struct blk_mq_hw_ctx *hctx = data; struct show_busy_params params = { .m = m, .hctx = hctx }; - blk_mq_tagset_busy_iter(hctx->queue->tag_set, hctx_show_busy_rq, + blk_mq_queue_tag_inflight_iter(hctx->queue, hctx_show_busy_rq, ¶ms); return 0; -- 1.8.3