OSDN Git Service

io_uring: fix stalled deferred requests
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 30 Jul 2020 15:43:48 +0000 (18:43 +0300)
committerJens Axboe <axboe@kernel.dk>
Thu, 30 Jul 2020 17:42:21 +0000 (11:42 -0600)
Always do io_commit_cqring() after completing a request, even if it was
accounted as overflowed on the CQ side. Failing to do that may lead to
not to pushing deferred requests when needed, and so stalling the whole
ring.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 6e23225..11c1abe 100644 (file)
@@ -7849,6 +7849,7 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx,
                        }
                        WRITE_ONCE(ctx->rings->cq_overflow,
                                atomic_inc_return(&ctx->cached_cq_overflow));
+                       io_commit_cqring(ctx);
                        spin_unlock_irq(&ctx->completion_lock);
 
                        /*