Skip to content

Commit f6dc5a3

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix mixed cqe overflow handling
I started to see zcrx data corruptions. That turned out to be due to CQ tail pointing to a stale entry which happened to be from a zcrx request. I.e. the tail is incremented without the CQE memory being changed. The culprit is __io_cqring_overflow_flush() passing "cqe32=true" to io_get_cqe_overflow() for non-mixed CQE32 setups, which only expects it to be set for mixed 32B CQEs and not for SETUP_CQE32. The fix is slightly hacky, long term it's better to unify mixed and CQE32 handling. Fixes: e26dca6 ("io_uring: add support for IORING_SETUP_CQE_MIXED") Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent f604180 commit f6dc5a3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

io_uring/io_uring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,8 @@ static void __io_cqring_overflow_flush(struct io_ring_ctx *ctx, bool dying)
634634
is_cqe32 = true;
635635
cqe_size <<= 1;
636636
}
637+
if (ctx->flags & IORING_SETUP_CQE32)
638+
is_cqe32 = false;
637639

638640
if (!dying) {
639641
if (!io_get_cqe_overflow(ctx, &cqe, true, is_cqe32))

0 commit comments

Comments
 (0)