]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs
authorJens Axboe <axboe@kernel.dk>
Tue, 3 Feb 2026 16:56:55 +0000 (09:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Feb 2026 17:58:32 +0000 (10:58 -0700)
commit38cfdd9dd279473a73814df9fd7e6e716951d361
treee60a82275805c20883f8cc2843728610c4a30c8e
parentb1dfe4e0fcef0cc01233a70ec8fd95b900024a5a
io_uring/fdinfo: be a bit nicer when looping a lot of SQEs/CQEs

Add cond_resched() in those dump loops, just in case a lot of entries
are being dumped. And detect invalid CQ ring head/tail entries, to avoid
iterating more than what is necessary. Generally not an issue, but can be
if things like KASAN or other debugging metrics are enabled.

Reported-by: 是参差 <shicenci@gmail.com>
Link: https://lore.kernel.org/all/PS1PPF7E1D7501FE5631002D242DD89403FAB9BA@PS1PPF7E1D7501F.apcprd02.prod.outlook.com/
Reviewed-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/fdinfo.c