]> git.baikalelectronics.ru Git - kernel.git/commitdiff
io_uring: io_rw_reissue lockdep annotations
authorPavel Begunkov <asml.silence@gmail.com>
Fri, 8 Jan 2021 20:57:22 +0000 (20:57 +0000)
committerJens Axboe <axboe@kernel.dk>
Sat, 9 Jan 2021 16:21:43 +0000 (09:21 -0700)
We expect io_rw_reissue() to take place only during submission with
uring_lock held. Add a lockdep annotation to check that invariant.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index cb57e0360fcbba245646fcb53225df4da5464e02..55ba1922a349763e77d658dba3a29ef87de77d80 100644 (file)
@@ -2692,6 +2692,8 @@ static bool io_rw_reissue(struct io_kiocb *req, long res)
        if ((res != -EAGAIN && res != -EOPNOTSUPP) || io_wq_current_is_worker())
                return false;
 
+       lockdep_assert_held(&req->ctx->uring_lock);
+
        ret = io_sq_thread_acquire_mm_files(req->ctx, req);
 
        if (io_resubmit_prep(req, ret)) {