From: Luis Chamberlain mcgrof@kernel.org
mainline inclusion from mainline-v5.9-rc1 commit a67549c8e568627290234e9fbe833cb9dfd36b55 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAGRKP CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=...
--------------------------------
Ensure it is clear which lock is required on do_blk_trace_setup().
Suggested-by: Bart Van Assche bvanassche@acm.org Signed-off-by: Luis Chamberlain mcgrof@kernel.org Reviewed-by: Bart Van Assche bvanassche@acm.org Signed-off-by: Jens Axboe axboe@kernel.dk Signed-off-by: Yu Kuai yukuai3@huawei.com --- kernel/trace/blktrace.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 2591b245fe76..ab824d742bfd 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -515,6 +515,8 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, struct dentry *dir = NULL; int ret;
+ lockdep_assert_held(&q->blk_trace_mutex); + if (!buts->buf_size || !buts->buf_nr) return -EINVAL;