Skip to content

Commit daa5de5

Browse files
yangerkunaxboe
authored andcommitted
io_uring: compare cached_cq_tail with cq.head in_io_uring_poll
After 75b28af("io_uring: allocate the two rings together"), we compare sq.head with cached_cq_tail to determine does there any cq invalid. Actually, we should use cq.head. Fixes: 75b28af ("io_uring: allocate the two rings together") Signed-off-by: yangerkun <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 3296061 commit daa5de5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,7 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait)
34553455
if (READ_ONCE(ctx->rings->sq.tail) - ctx->cached_sq_head !=
34563456
ctx->rings->sq_ring_entries)
34573457
mask |= EPOLLOUT | EPOLLWRNORM;
3458-
if (READ_ONCE(ctx->rings->sq.head) != ctx->cached_cq_tail)
3458+
if (READ_ONCE(ctx->rings->cq.head) != ctx->cached_cq_tail)
34593459
mask |= EPOLLIN | EPOLLRDNORM;
34603460

34613461
return mask;

0 commit comments

Comments
 (0)