summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangerkun <yangerkun@huawei.com>2019-09-24 20:53:34 +0800
committerJens Axboe <axboe@kernel.dk>2019-09-24 07:04:15 -0600
commitdaa5de5415849b9a53056ec1e1e88fe4c5c9aa2b (patch)
tree57e6f539eb3582046f05bfad7ca1b34401ace56b
parent32960613b7c3352ddf38c42596e28a16ae36335e (diff)
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: 75b28affdd6a ("io_uring: allocate the two rings together") Signed-off-by: yangerkun <yangerkun@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-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 ca7570aca430..9b84232e5cc4 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -3455,7 +3455,7 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait)
if (READ_ONCE(ctx->rings->sq.tail) - ctx->cached_sq_head !=
ctx->rings->sq_ring_entries)
mask |= EPOLLOUT | EPOLLWRNORM;
- if (READ_ONCE(ctx->rings->sq.head) != ctx->cached_cq_tail)
+ if (READ_ONCE(ctx->rings->cq.head) != ctx->cached_cq_tail)
mask |= EPOLLIN | EPOLLRDNORM;
return mask;