diff mbox series

[4/8] io_uring/rsrc: add lockdep checks

Message ID 961bbe6e433ec9bc0375127f23468b37b729df99.1681210788.git.asml.silence@gmail.com (mailing list archive)
State New
Headers show
Series for-next cleanups | expand

Commit Message

Pavel Begunkov April 11, 2023, 11:06 a.m. UTC
Add a lockdep chek to make sure that file and buffer updates hold
->uring_lock.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 io_uring/rsrc.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c
index 603a783a0383..24e4e2109549 100644
--- a/io_uring/rsrc.c
+++ b/io_uring/rsrc.c
@@ -534,6 +534,8 @@  static int __io_register_rsrc_update(struct io_ring_ctx *ctx, unsigned type,
 	__u32 tmp;
 	int err;
 
+	lockdep_assert_held(&ctx->uring_lock);
+
 	if (check_add_overflow(up->offset, nr_args, &tmp))
 		return -EOVERFLOW;
 	err = io_rsrc_node_switch_start(ctx);