summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-04-11 12:06:04 +0100
committerJens Axboe <axboe@kernel.dk>2023-04-12 12:09:41 -0600
commit786788a8cfe03056e9c7b1c6e418c1db92a0ce80 (patch)
treeca1b957506daec14157674a3c71db9173fda5386 /io_uring
parent8ce4269eeedc5b31f5817f610b42cba8be8fa9de (diff)
downloadlinux-stable-786788a8cfe03056e9c7b1c6e418c1db92a0ce80.tar.gz
linux-stable-786788a8cfe03056e9c7b1c6e418c1db92a0ce80.tar.bz2
linux-stable-786788a8cfe03056e9c7b1c6e418c1db92a0ce80.zip
io_uring/rsrc: add lockdep checks
Add a lockdep chek to make sure that file and buffer updates hold ->uring_lock. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/961bbe6e433ec9bc0375127f23468b37b729df99.1681210788.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/rsrc.c2
1 files changed, 2 insertions, 0 deletions
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);