hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAGRKP CVE: NA
----------------------------------------
Commit 17ab4994ddcc ("block: create the request_queue debugfs_dir on registration") changed that "q->debugfs_dir" will always be created even if CONFIG_BLK_DEBUG_FS is disabled, in this case create the same dir in do_blk_trace_setup() will fail hence blktrace can't be used.
Fix the problem by always use "q->debugfs_dir" for the whole bdev, and always create new debugfs_dir for partitions.
Fixes: 17ab4994ddcc ("block: create the request_queue debugfs_dir on registration") Signed-off-by: Yu Kuai yukuai3@huawei.com --- kernel/trace/blktrace.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 8310695efd3d..7295c4ee2425 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -553,18 +553,15 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, if (!bt->msg_data) goto err;
-#ifdef CONFIG_BLK_DEBUG_FS /* - * When tracing whole make_request drivers (multiqueue) block devices, - * reuse the existing debugfs directory created by the block layer on - * init. For request-based block devices, all partitions block devices, + * When tracing the whole disk reuse the existing debugfs directory + * created by the block layer on init. For partitions block devices, * and scsi-generic block devices we create a temporary new debugfs * directory that will be removed once the trace ends. */ - if (q->mq_ops && bdev && bdev == bdev->bd_contains) + if (bdev && bdev == bdev->bd_contains) dir = q->debugfs_dir; else -#endif bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root);
/*
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/11777 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/V...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/11777 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/V...