Subject: Re: [PATCH] io_uring/fdinfo: show SQEs for no array setup

From: Jens Axboe <[email-masked]>
Date: Wed, 22 Oct 2025 16:10:01 -0600

On Wed, 22 Oct 2025 13:56:07 -0700, Keith Busch wrote:
> 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,
-- 
Jens Axboe

---

From: Jens Axboe <[email-masked]>
Date: Wed, 22 Oct 2025 16:09:11 -0600

On 10/22/25 2:56 PM, Keith Busch wrote:
> From: Keith Busch <[email-masked]>
> 
> Signed-off-by: Keith Busch <[email-masked]>
> ---
>  io_uring/fdinfo.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
> index 5b26b2a97e1b9..f034786030105 100644
> --- a/io_uring/fdinfo.c
> +++ b/io_uring/fdinfo.c
> @@ -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;

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?

-- 
Jens Axboe

---

From: Keith Busch <[email-masked]>
Date: Wed, 22 Oct 2025 13:56:07 -0700

-- 
2.47.3