* [PATCH] io_uring/fdinfo: only print ->sq_array[] if it's there
@ 2023-09-01 20:01 Jens Axboe
2023-09-01 20:58 ` Gabriel Krisman Bertazi
0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2023-09-01 20:01 UTC (permalink / raw)
To: io-uring, Pavel Begunkov
If a ring is setup with IORING_SETUP_NO_SQARRAY, then we don't have
the SQ array. Don't try to dump info from it through fdinfo if that
is the case.
Reported-by: [email protected]
Fixes: 2af89abda7d9 ("io_uring: add option to remove SQ indirection")
Signed-off-by: Jens Axboe <[email protected]>
---
diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
index 300455b4bc12..c53678875416 100644
--- a/io_uring/fdinfo.c
+++ b/io_uring/fdinfo.c
@@ -93,6 +93,8 @@ __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *f)
struct io_uring_sqe *sqe;
unsigned int sq_idx;
+ if (ctx->flags & IORING_SETUP_NO_SQARRAY)
+ break;
sq_idx = READ_ONCE(ctx->sq_array[entry & sq_mask]);
if (sq_idx > sq_mask)
continue;
--
Jens Axboe
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] io_uring/fdinfo: only print ->sq_array[] if it's there
2023-09-01 20:01 [PATCH] io_uring/fdinfo: only print ->sq_array[] if it's there Jens Axboe
@ 2023-09-01 20:58 ` Gabriel Krisman Bertazi
0 siblings, 0 replies; 2+ messages in thread
From: Gabriel Krisman Bertazi @ 2023-09-01 20:58 UTC (permalink / raw)
To: Jens Axboe; +Cc: io-uring, Pavel Begunkov
Jens Axboe <[email protected]> writes:
> If a ring is setup with IORING_SETUP_NO_SQARRAY, then we don't have
> the SQ array. Don't try to dump info from it through fdinfo if that
> is the case.
>
> Reported-by: [email protected]
> Fixes: 2af89abda7d9 ("io_uring: add option to remove SQ indirection")
> Signed-off-by: Jens Axboe <[email protected]>
>
> ---
>
> diff --git a/io_uring/fdinfo.c b/io_uring/fdinfo.c
> index 300455b4bc12..c53678875416 100644
> --- a/io_uring/fdinfo.c
> +++ b/io_uring/fdinfo.c
> @@ -93,6 +93,8 @@ __cold void io_uring_show_fdinfo(struct seq_file *m, struct file *f)
> struct io_uring_sqe *sqe;
> unsigned int sq_idx;
>
> + if (ctx->flags & IORING_SETUP_NO_SQARRAY)
> + break;
> sq_idx = READ_ONCE(ctx->sq_array[entry & sq_mask]);
> if (sq_idx > sq_mask)
> continue;
Reviewed-by: Gabriel Krisman Bertazi <[email protected]>
--
Gabriel Krisman Bertazi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-01 20:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-01 20:01 [PATCH] io_uring/fdinfo: only print ->sq_array[] if it's there Jens Axboe
2023-09-01 20:58 ` Gabriel Krisman Bertazi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox