Message ID | 20230405000827.2250965-8-cascardo@canonical.com |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/io_uring/poll.c b/io_uring/poll.c index 8c7af09a81d8..92e3fdd3caa1 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -226,6 +226,13 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked) return IOU_POLL_DONE; if (v & IO_POLL_CANCEL_FLAG) return -ECANCELED; + /* + * cqe.res contains only events of the first wake up + * and all others are be lost. Redo vfs_poll() to get + * up to date state. + */ + if ((v & IO_POLL_REF_MASK) != 1) + req->cqe.res = 0; /* the mask was stashed in __io_poll_execute */ if (!req->cqe.res) {