sq and cq are both ring, once sq head gets back and cq not yet then
the expression get wrong.

Signed-off-by: Zhengyuan Liu <[email protected]>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 0fbb486..56fe6e1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -423,7 +423,7 @@ static inline bool io_sequence_defer(struct io_ring_ctx 
*ctx,
        if ((req->flags & (REQ_F_IO_DRAIN|REQ_F_IO_DRAINED)) != REQ_F_IO_DRAIN)
                return false;
 
-       return req->sequence > ctx->cached_cq_tail + ctx->sq_ring->dropped;
+       return req->sequence != ctx->cached_cq_tail + ctx->sq_ring->dropped;
 }
 
 static struct io_kiocb *io_get_deferred_req(struct io_ring_ctx *ctx)
-- 
2.7.4



Reply via email to