Skip to content

Commit 0092793

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix fdinfo sqe offsets calculation
Only with the big sqe feature they take 128 bytes per entry, but we unconditionally advance by 128B. Fix it by using sq_shift. Fixes: 3b8fdd1 ("io_uring/fdinfo: fix sqe dumping for IORING_SETUP_SQE128") Reported-and-tested-by: [email protected] Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/8b41287cb75d5efb8fcb5cccde845ddbbadd8372.1665449983.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent c86416c commit 0092793

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/fdinfo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
9494
sq_idx = READ_ONCE(ctx->sq_array[entry & sq_mask]);
9595
if (sq_idx > sq_mask)
9696
continue;
97-
sqe = &ctx->sq_sqes[sq_idx << 1];
97+
sqe = &ctx->sq_sqes[sq_idx << sq_shift];
9898
seq_printf(m, "%5u: opcode:%s, fd:%d, flags:%x, off:%llu, "
9999
"addr:0x%llx, rw_flags:0x%x, buf_index:%d "
100100
"user_data:%llu",

0 commit comments

Comments
 (0)