]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: ensure double poll additions work with both request types
authorJens Axboe <axboe@kernel.dk>
Fri, 17 Jul 2020 23:09:27 +0000 (17:09 -0600)
committerJens Axboe <axboe@kernel.dk>
Sat, 18 Jul 2020 01:41:05 +0000 (19:41 -0600)
commit8c3106a96b497f55231c8296b217ce45b943929e
treee5716367b72f698c390168843b735aed0130c598
parente3da84ac565b990649f510c67187bad3d2ce5e19
io_uring: ensure double poll additions work with both request types

The double poll additions were centered around doing POLL_ADD on file
descriptors that use more than one waitqueue (typically one for read,
one for write) when being polled. However, it can also end up being
triggered for when we use poll triggered retry. For that case, we cannot
safely use req->io, as that could be used by the request type itself.

Add a second io_poll_iocb pointer in the structure we allocate for poll
based retry, and ensure we use the right one from the two paths.

Fixes: 374aa5b0b032 ("io_uring: allow POLL_ADD with double poll_wait() users")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c