io_uring: add irq lockdep checks
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 11 Apr 2023 11:06:03 +0000 (12:06 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 12 Apr 2023 18:09:41 +0000 (12:09 -0600)
We don't post CQEs from the IRQ context, add a check catching that.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/f23f7a24dbe8027b3d37873fece2b6488f878b31.1681210788.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.h

index ef449e4..25515d6 100644 (file)
@@ -94,6 +94,8 @@ bool io_match_task_safe(struct io_kiocb *head, struct task_struct *task,
 
 #define io_lockdep_assert_cq_locked(ctx)                               \
        do {                                                            \
+               lockdep_assert(in_task());                              \
+                                                                       \
                if (ctx->flags & IORING_SETUP_IOPOLL) {                 \
                        lockdep_assert_held(&ctx->uring_lock);          \
                } else if (!ctx->task_complete) {                       \