From: Jens Axboe <axboe@kernel.dk>
To: Keith Busch <kbusch@meta.com>, io-uring@vger.kernel.org
Cc: Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] io_uring/fdinfo: show SQEs for no array setup
Date: Wed, 22 Oct 2025 16:09:11 -0600 [thread overview]
Message-ID: <48302ec5-22d6-44f8-a18f-749175df8c39@kernel.dk> (raw)
In-Reply-To: <20251022205607.4035359-1-kbusch@meta.com>
On 10/22/25 2:56 PM, Keith Busch wrote:
> From: Keith Busch <kbusch@kernel.org>
>
> 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.
>
> Signed-off-by: Keith Busch <kbusch@kernel.org>
> ---
> 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
next prev parent reply other threads:[~2025-10-22 22:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-22 20:56 [PATCH] io_uring/fdinfo: show SQEs for no array setup Keith Busch
2025-10-22 22:09 ` Jens Axboe [this message]
2025-10-22 22:10 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48302ec5-22d6-44f8-a18f-749175df8c39@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=kbusch@kernel.org \
--cc=kbusch@meta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox