hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAGRKP CVE: NA
----------------------------------------
Commit 99d055b4fd4b ("block: remove per-disk debugfs files in blk_unregister_queue") move blk_trace_shutdown() from blk_release_queue() to blk_unregister_queue(). However, blktrace can still be enabled through ioctl after blk_unregister_queue(), and blktrace will be leaked in this case.
Fix the problem by calling blk_trace_shutdown() in blk_release_queue().
Signed-off-by: Yu Kuai yukuai3@huawei.com --- block/blk-sysfs.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 225823ddd810..b23d82fbe736 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -895,6 +895,10 @@ static void __blk_release_queue(struct work_struct *work) blk_mq_release(q); }
+ mutex_lock(&q->debugfs_mutex); + blk_trace_shutdown(q); + mutex_unlock(&q->debugfs_mutex); + bioset_exit(&q->bio_split);
ida_simple_remove(&blk_queue_ida, q->id);