summaryrefslogtreecommitdiff
path: root/io_uring
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-04-12 22:16:20 +0300
committerJens Axboe <axboe@kernel.dk>2024-04-15 17:10:27 +0300
commit686b56cbeedc9f4c72f9bb781918194a9a3e8334 (patch)
tree8c5cab653001baeef0064e514c7345c5c8f14a5f /io_uring
parent4d0f4a5413490391c6cd16407a0f71b51700a68a (diff)
downloadlinux-686b56cbeedc9f4c72f9bb781918194a9a3e8334.tar.xz
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: 6c948ec44b29 ("io_uring: consolidate overflow flushing") Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index c4419eef7e63..3c9087f37c43 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -674,7 +674,8 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool dying)
lockdep_assert_held(&ctx->uring_lock);
- if (__io_cqring_events(ctx) == ctx->cq_entries)
+ /* don't abort if we're dying, entries must get freed */
+ if (!dying && __io_cqring_events(ctx) == ctx->cq_entries)
return;
if (ctx->flags & IORING_SETUP_CQE32)