Skip to content

Commit 686b56c

Browse files
committed
io_uring: ensure overflow entries are dropped when ring is exiting
A previous consolidation cleanup missed handling the case where the ring is dying, and __io_cqring_overflow_flush() doesn't flush entries if the CQ ring is already full. This is fine for the normal CQE overflow flushing, but if the ring is going away, we need to flush everything, even if it means simply freeing the overflown entries. Fixes: 6c948ec ("io_uring: consolidate overflow flushing") Signed-off-by: Jens Axboe <[email protected]>
1 parent 4d0f4a5 commit 686b56c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

io_uring/io_uring.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,8 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool dying)
674674

675675
lockdep_assert_held(&ctx->uring_lock);
676676

677-
if (__io_cqring_events(ctx) == ctx->cq_entries)
677+
/* don't abort if we're dying, entries must get freed */
678+
if (!dying && __io_cqring_events(ctx) == ctx->cq_entries)
678679
return;
679680

680681
if (ctx->flags & IORING_SETUP_CQE32)

0 commit comments

Comments
 (0)