Skip to contentSkip to conversation

io_uring: fix fdinfo sqe offsets calculation

PATCH Applied Pavel Begunkov 2 participants 2 messages Oct 11, 2022 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 3b8fdd1dc35e3 ("io_uring/fdinfo: fix sqe dumping for IORING_SETUP_SQE128")
Reported-and-tested-by [email protected]
---
 io_uring/fdinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/fdinfo.c +1 -1
index 4eae088046d0..2e04850a657b 100644
@@ -94,7 +94,7 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
 		sq_idx = READ_ONCE(ctx->sq_array[entry & sq_mask]);
 		if (sq_idx > sq_mask)
 			continue;
-		sqe = &ctx->sq_sqes[sq_idx << 1];
+		sqe = &ctx->sq_sqes[sq_idx << sq_shift];
 		seq_printf(m, "%5u: opcode:%s, fd:%d, flags:%x, off:%llu, "
 			      "addr:0x%llx, rw_flags:0x%x, buf_index:%d "
 			      "user_data:%llu",
Signature · 1 line
2.38.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Pavel Begunkov

Only with the big sqe feature they take 128 bytes per entry, but we unconditionally advance by 128B. Fix it by using sq_shift.

Applied, thanks!

[1/1] io_uring: fix fdinfo sqe offsets calculation

      commit: 9af3f837a9bf59ede807303831892448eaa2ed0b

Best regards,

Signature · 1 line
Jens Axboe