io_uring: only wake when the correct events are set
authorDylan Yudaken <dylany@fb.com>
Thu, 12 May 2022 09:18:34 +0000 (02:18 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 26 Jan 2023 19:35:57 +0000 (12:35 -0700)
commitd30f4ef00c764ff98996e676d4815d445ea86ede
tree296ddccbd08a64678bbf332ea64033823f28cbef
parentaabd5ba7e9b03e9a211a4842ab4a93d46f684d2c
io_uring: only wake when the correct events are set

commit 1b1d7b4bf1d9948c8dba5ee550459ce7c65ac019 upstream.

The check for waking up a request compares the poll_t bits, however this
will always contain some common flags so this always wakes up.

For files with single wait queues such as sockets this can cause the
request to be sent to the async worker unnecesarily. Further if it is
non-blocking will complete the request with EAGAIN which is not desired.

Here exclude these common events, making sure to not exclude POLLERR which
might be important.

Fixes: d7718a9d25a6 ("io_uring: use poll driven retry for files that support it")
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220512091834.728610-3-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c