Skip to content

Commit 60495b0

Browse files
isilenceaxboe
authored andcommitted
io_uring: silence false positive warnings
If we kill a ring and then immediately exit the task, we'll get cancellattion running by the task and a kthread in io_ring_exit_work. For DEFER_TASKRUN, we do want to limit it to only one entity executing it, however it's currently not an issue as it's protected by uring_lock. Silence lockdep assertions for now, we'll return to it later. Reported-by: syzbot+1bcb75613069ad4957fc@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/7e5f68281acb0f081f65fde435833c68a3b7e02f.1736257837.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent c83c846 commit 60495b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

io_uring/io_uring.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
125125
#if defined(CONFIG_PROVE_LOCKING)
126126
lockdep_assert(in_task());
127127

128+
if (ctx->flags & IORING_SETUP_DEFER_TASKRUN)
129+
lockdep_assert_held(&ctx->uring_lock);
130+
128131
if (ctx->flags & IORING_SETUP_IOPOLL) {
129132
lockdep_assert_held(&ctx->uring_lock);
130133
} else if (!ctx->task_complete) {
@@ -136,9 +139,7 @@ static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
136139
* Not from an SQE, as those cannot be submitted, but via
137140
* updating tagged resources.
138141
*/
139-
if (percpu_ref_is_dying(&ctx->refs))
140-
lockdep_assert(current_work());
141-
else
142+
if (!percpu_ref_is_dying(&ctx->refs))
142143
lockdep_assert(current == ctx->submitter_task);
143144
}
144145
#endif

0 commit comments

Comments
 (0)