[v6,4/6] blktrace: annotate required lock on do_blk_trace_setup()
diff mbox series

Message ID 20200608170127.20419-5-mcgrof@kernel.org
State New
Headers show
Series
  • block: fix blktrace debugfs use after free
Related show

Commit Message

Luis Chamberlain June 8, 2020, 5:01 p.m. UTC
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>
---
 kernel/trace/blktrace.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Christoph Hellwig June 9, 2020, 2:18 p.m. UTC | #1
On Mon, Jun 08, 2020 at 05:01:24PM +0000, Luis Chamberlain wrote:
> 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>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Bart Van Assche June 13, 2020, 1:54 a.m. UTC | #2
On 2020-06-08 10:01, Luis Chamberlain wrote:
> Ensure it is clear which lock is required on do_blk_trace_setup().

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

Patch
diff mbox series

diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c
index 7f60029bdaff..7ff2ea5cd05e 100644
--- a/kernel/trace/blktrace.c
+++ b/kernel/trace/blktrace.c
@@ -483,6 +483,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;