diff --git a/fs/io_uring.c b/fs/io_uring.c index 383b8f61359d0f44444333c9e9c5518d76f25a50..141bfe720ce2eeff47db7320cb49673957c9b7c7 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2266,9 +2266,10 @@ static void io_free_batch_list(struct io_ring_ctx *ctx, struct io_kiocb *req = container_of(node, struct io_kiocb, comp_list); - if (!req_ref_put_and_test(req)) { + if (unlikely(req->flags & REQ_F_REFCOUNT)) { node = req->comp_list.next; - continue; + if (!req_ref_put_and_test(req)) + continue; } io_queue_next(req);