Skip to content

Commit

Permalink
Merge tag 'io_uring-6.2-2023-01-21' of git://git.kernel.dk/linux
Browse files Browse the repository at this point in the history
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
  • Loading branch information
torvalds committed Jan 22, 2023
2 parents f671440 + 8caa03f commit 95f184d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion io_uring/poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 95f184d

Please sign in to comment.