aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index b35300e4c9a7..f65f85d89217 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -338,7 +338,7 @@ static struct io_uring_cqe *io_get_cqring(struct io_ring_ctx *ctx)
338 tail = ctx->cached_cq_tail; 338 tail = ctx->cached_cq_tail;
339 /* See comment at the top of the file */ 339 /* See comment at the top of the file */
340 smp_rmb(); 340 smp_rmb();
341 if (tail + 1 == READ_ONCE(ring->r.head)) 341 if (tail - READ_ONCE(ring->r.head) == ring->ring_entries)
342 return NULL; 342 return NULL;
343 343
344 ctx->cached_cq_tail++; 344 ctx->cached_cq_tail++;