summaryrefslogtreecommitdiffstats
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorStefano Garzarella <sgarzare@redhat.com>2020-02-07 13:18:28 +0100
committerJens Axboe <axboe@kernel.dk>2020-02-08 21:06:58 +0100
commit63e5d81f72af1bf370bf8a6745b0a8d71a7bb37d (patch)
tree03881aa43362cda36af3f669d5da499563a37b0c /fs/io_uring.c
parentio_uring: statx/openat/openat2 don't support fixed files (diff)
downloadlinux-63e5d81f72af1bf370bf8a6745b0a8d71a7bb37d.tar.xz
linux-63e5d81f72af1bf370bf8a6745b0a8d71a7bb37d.zip
io_uring: flush overflowed CQ events in the io_uring_poll()
In io_uring_poll() we must flush overflowed CQ events before to check if there are CQ events available, to avoid missing events. We call the io_cqring_events() that checks and flushes any overflow and returns the number of CQ events available. Signed-off-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-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 d03846822062..2954a8bdf824 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6283,7 +6283,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->cq.head) != ctx->cached_cq_tail)
+ if (io_cqring_events(ctx, false))
mask |= EPOLLIN | EPOLLRDNORM;
return mask;