]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb8bfe2cc3d0886ae981cbaa6300368a32d49a2ba
tree6c42683080d192ad03285947bd2aec9867859aae
parent6a553e74112e80d06df3c57a5b75babbb3ab0899
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: 3eb58ddb51297 ("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