Skip to contentSkip to conversation

io_uring/fdinfo: show SQEs for no array setup

PATCH Applied Keith Busch 2 participants 3 messages Oct 22, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring/fdinfo: show SQEs for no array setup

From: Keith Busch <[email protected]>

The sq_head indicates the index directly in the submission queue when the IORING_SETUP_NO_SQARRAY option is used, so use that instead of skipping showing the entries.

---
 io_uring/fdinfo.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
io_uring/fdinfo.c +4 -2
index 5b26b2a97e1b9..f034786030105 100644
@@ -95,8 +95,10 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
 		u8 opcode;
 
 		if (ctx->flags & IORING_SETUP_NO_SQARRAY)
-			break;
-		sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
+			sq_idx = sq_head & sq_mask;
+		else
+			sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
+
 		if (sq_idx > sq_mask)
 			continue;
 
Signature · 1 line
2.47.3
maintainer
#1 lore raw
Quoted 17 lines · Keith Busch

From: Keith Busch <[email protected]>

The sq_head indicates the index directly in the submission queue when the IORING_SETUP_NO_SQARRAY option is used, so use that instead of skipping showing the entries.

---
 io_uring/fdinfo.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
io_uring/fdinfo.c +0 -0
index 5b26b2a97e1b9..f034786030105 100644
@@ -95,8 +95,10 @@ static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m)
 		u8 opcode;

io_uring/fdinfo.c static void __io_uring_show_fdinfo(struct io_ring_ctx *ctx, struct seq_file *m) · line 103

Quoted 10 lines
io_uring/fdinfo.c +4 -2
 
 		if (ctx->flags & IORING_SETUP_NO_SQARRAY)
-			break;
-		sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
+			sq_idx = sq_head & sq_mask;
+		else
+			sq_idx = READ_ONCE(ctx->sq_array[sq_head & sq_mask]);
+
 		if (sq_idx > sq_mask)
 			continue;

Huh indeed, I wonder why that was never done...

/checks notes - oh it's me. NO_SQARRAY originally forgot about fdinfo, and hence we got a crash. Rather than change it to display, it just added the break.

Could argue that:

Fixes 32f5dea040ee ("io_uring/fdinfo: only print ->sq_array[] if it's there")

would be useful here?

Signature · 1 line
Jens Axboe
maintainer Applied
#2 lore raw
In reply to Keith Busch
Quoted 5 lines · Keith Busch

The sq_head indicates the index directly in the submission queue when the IORING_SETUP_NO_SQARRAY option is used, so use that instead of skipping showing the entries.

Applied, thanks!

[1/1] io_uring/fdinfo: show SQEs for no array setup

      commit: 0ecf0e6748120842700efc5dbf22a18580f7efcf

Best regards,

Signature · 1 line
Jens Axboe