• Jens Axboe's avatar
    io_uring: harder fdinfo sq/cq ring iterating · f75d1183
    Jens Axboe authored
    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: 83f84356 ("io_uring: add more uring info to fdinfo for debug")
    Reported-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    f75d1183
io_uring.c 273 KB