io_uring: allow POLL_ADD with double poll_wait() users io_uring-5.6-poll
authorJens Axboe <axboe@kernel.dk>
Mon, 10 Feb 2020 20:48:46 +0000 (13:48 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 13 Feb 2020 00:44:07 +0000 (17:44 -0700)
commitac346aacdbfb66fa5bc4eb24ee211cf2f39305ae
treec87a061c3da129f73d857cb2d726446072e9a320
parent09aacd048781ff1f99dc8ac8e019442dd859dc0b
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 is particularly a problem now that pipes were switched to using
multiple wait queues (commit 0ddad21d3e99), but it also affects 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