Skip to contentSkip to conversation

io_uring: add lockdep asserts to io_add_aux_cqe

PATCH Applied Pavel Begunkov 2 participants 2 messages May 9, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: add lockdep asserts to io_add_aux_cqe

io_add_aux_cqe() can only be called for rings with uring_lock protected completion queues, add a couple of assertions in regards to that.

---
 io_uring/io_uring.c | 3 +++
 1 file changed, 3 insertions(+)
io_uring/io_uring.c +3 -0
index 0fda1b1a33ae..13b8baaef834 100644
@@ -844,6 +844,9 @@ bool io_post_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags
  */
 void io_add_aux_cqe(struct io_ring_ctx *ctx, u64 user_data, s32 res, u32 cflags)
 {
+	lockdep_assert_held(&ctx->uring_lock);
+	lockdep_assert(ctx->lockless_cq);
+
 	if (!io_fill_cqe_aux(ctx, user_data, res, cflags)) {
 		spin_lock(&ctx->completion_lock);
 		io_cqring_event_overflow(ctx, user_data, res, cflags, 0, 0);
Signature · 1 line
2.49.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Pavel Begunkov

io_add_aux_cqe() can only be called for rings with uring_lock protected completion queues, add a couple of assertions in regards to that.

Applied, thanks!

[1/1] io_uring: add lockdep asserts to io_add_aux_cqe

      commit: 81a22c86ec7060be43404d4e6d68fca03dbafcf4

Best regards,

Signature · 1 line
Jens Axboe