
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I9QJ1S CVE: NA ---------------------------------------- Move debugfs_mutex back to it's old position to prevent kabi broken. Signed-off-by: Yu Kuai <yukuai3@huawei.com> --- block/blk-sysfs.c | 4 ++-- include/linux/blkdev.h | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 18dfd2fe3b3e..d717cde56c4f 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -1087,10 +1087,10 @@ void blk_unregister_queue(struct gendisk *disk) mutex_lock(&q->debugfs_mutex); blk_trace_shutdown(q); + if (queue_is_mq(q)) + blk_mq_debugfs_unregister(q); debugfs_remove_recursive(q->debugfs_dir); q->debugfs_dir = NULL; - q->sched_debugfs_dir = NULL; - q->rqos_debugfs_dir = NULL; mutex_unlock(&q->debugfs_mutex); kobject_put(&disk_to_dev(disk)->kobj); diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index eea753a46419..af6e6196cd27 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -540,6 +540,10 @@ struct request_queue { unsigned int sg_timeout; unsigned int sg_reserved_size; int node; + /* + * Serializes all debugfs metadata operations using the above dentries. + */ + struct mutex debugfs_mutex; #ifdef CONFIG_BLK_DEV_IO_TRACE struct blk_trace __rcu *blk_trace; #endif @@ -587,12 +591,10 @@ struct request_queue { struct bio_set bio_split; struct dentry *debugfs_dir; +#ifdef CONFIG_BLK_DEBUG_FS struct dentry *sched_debugfs_dir; struct dentry *rqos_debugfs_dir; - /* - * Serializes all debugfs metadata operations using the above dentries. - */ - struct mutex debugfs_mutex; +#endif bool mq_sysfs_init_done; -- 2.39.2