aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-01-21 16:21:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2023-01-21 16:21:56 -0800
commit95f184d0e1e14e6fd4368a804db5f870e5f841d2 (patch)
treeb7b860283a186be978414ed5ff2778bc25fde79e
parentf67144022885344375ad03593e7a290cc614da34 (diff)
parent8caa03f10bf92cb8657408a6ece6a8a73f96ce13 (diff)
downloadwpan-95f184d0e1e14e6fd4368a804db5f870e5f841d2.tar.gz
Merge tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux
Pull another io_uring fix from Jens Axboe: "Just a single fix for a regression that happened in this release due to a poll change. Normally I would've just deferred it to next week, but since the original fix got picked up by stable, I think it's better to just send this one off separately. The issue is around the poll race fix, and how it mistakenly also got applied to multishot polling. Those don't need the race fix, and we should not be doing any reissues for that case. Exhaustive test cases were written and committed to the liburing regression suite for the reported issue, and additions for similar issues" * tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux: io_uring/poll: don't reissue in case of poll race on multishot request
-rw-r--r--io_uring/poll.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c
index 32e5fc8365e6a3..2ac1366adbd77e 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -283,8 +283,12 @@ static int io_poll_check_events(struct io_kiocb *req, bool *locked)
* to the waitqueue, so if we get nothing back, we
* should be safe and attempt a reissue.
*/
- if (unlikely(!req->cqe.res))
+ if (unlikely(!req->cqe.res)) {
+ /* Multishot armed need not reissue */
+ if (!(req->apoll_events & EPOLLONESHOT))
+ continue;
return IOU_POLL_REISSUE;
+ }
}
if (req->apoll_events & EPOLLONESHOT)
return IOU_POLL_DONE;