io_uring: harder fdinfo sq/cq ring iterating
authorJens Axboe <axboe@kernel.dk>
Fri, 29 Oct 2021 12:36:45 +0000 (06:36 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 29 Oct 2021 15:49:33 +0000 (09:49 -0600)
commitf75d118349be055d47407b4ba4ceb98e6437e472
treea215817815a3f606191b6a73327df1f516bf9b0c
parent3884b83dff245e41def99ceacca8ed2056baf0a8
io_uring: harder fdinfo sq/cq ring iterating

The ring iteration is racy, which isn't necessarily a problem except it
can cause us to iterate the whole thing. That isn't desired or ideal,
and it can lead to excessive runtimes of reading fdinfo.

Cap the iteration at tail - head OR the ring size. While in there, clean
up the ring masking and just dump the raw values along with the masks.
That provides more useful debug info.

Fixes: 83f84356bc8f ("io_uring: add more uring info to fdinfo for debug")
Reported-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c