io_uring: fix req->apoll_events
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 21 Jun 2022 12:25:06 +0000 (13:25 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 21 Jun 2022 13:49:05 +0000 (07:49 -0600)
commitaacf2f9f382c91df73f33317e28a4c34c8038986
tree6c42683080d192ad03285947bd2aec9867859aae
parentb60cac14bb3c88cff2a7088d9095b01a80938c41
io_uring: fix req->apoll_events

apoll_events should be set once in the beginning of poll arming just as
poll->events and not change after. However, currently io_uring resets it
on each __io_poll_execute() for no clear reason. There is also a place
in __io_arm_poll_handler() where we add EPOLLONESHOT to downgrade a
multishot, but forget to do the same thing with ->apoll_events, which is
buggy.

Fixes: 81459350d581e ("io_uring: cache req->apoll->events in req->cflags")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Hao Xu <howeyxu@tencent.com>
Link: https://lore.kernel.org/r/0aef40399ba75b1a4d2c2e85e6e8fd93c02fc6e4.1655814213.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c