diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 5b4bc93fd6e0..4c6a5666541c 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -72,10 +72,12 @@ static bool io_kill_timeout(struct io_kiocb *req, int status) __cold void io_flush_timeouts(struct io_ring_ctx *ctx) __must_hold(&ctx->completion_lock) { - u32 seq = ctx->cached_cq_tail - atomic_read(&ctx->cq_timeouts); + u32 seq; struct io_timeout *timeout, *tmp; spin_lock_irq(&ctx->timeout_lock); + seq = ctx->cached_cq_tail - atomic_read(&ctx->cq_timeouts); + list_for_each_entry_safe(timeout, tmp, &ctx->timeout_list, list) { struct io_kiocb *req = cmd_to_io_kiocb(timeout); u32 events_needed, events_got;