OSDN Git Service

io_uring: allow POLL_ADD with double poll_wait() users
authorJens Axboe <axboe@kernel.dk>
Fri, 15 May 2020 17:56:54 +0000 (11:56 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 15 May 2020 17:56:54 +0000 (11:56 -0600)
commit18bceab101adde8f38de76016bc77f3f25cf22f4
treebd95c924ac8c37d152e1c14a420754c0c69ff652
parent4a38aed2a0a729ccecd84dca5b76d827b9e1294d
io_uring: allow POLL_ADD with double poll_wait() users

Some file descriptors use separate waitqueues for their f_ops->poll()
handler, most commonly one for read and one for write. The io_uring
poll implementation doesn't work with that, as the 2nd poll_wait()
call will cause the io_uring poll request to -EINVAL.

This affects (at least) tty devices and /dev/random as well. This is a
big problem for event loops where some file descriptors work, and others
don't.

With this fix, io_uring handles multiple waitqueues.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c