Commit f60ba77c authored by Yu Kuai's avatar Yu Kuai
Browse files

block: shutdown blktrace in blk_release_queue()

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IAGRKP


CVE: NA

----------------------------------------

Commit 99d055b4 ("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: default avatarYu Kuai <yukuai3@huawei.com>
parent 5ac14e7f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);