]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: explicitly count entries for poll reqs
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 20 Jul 2021 09:50:43 +0000 (10:50 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 20 Jul 2021 13:50:42 +0000 (07:50 -0600)
commitfc7348d2e98b63d102bc3efbf6641e206a08e77a
treece8fb3195acafbed4b79ad1a4a371402ba8770ec
parent75d4cde79dbccd07f3c8fa3e30d05b3df8f6a5c3
io_uring: explicitly count entries for poll reqs

If __io_queue_proc() fails to add a second poll entry, e.g. kmalloc()
failed, but it goes on with a third waitqueue, it may succeed and
overwrite the error status. Count the number of poll entries we added,
so we can set pt->error to zero at the beginning and find out when the
mentioned scenario happens.

Cc: stable@vger.kernel.org
Fixes: 374aa5b0b032f ("io_uring: allow POLL_ADD with double poll_wait() users")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9d6b9e561f88bcc0163623b74a76c39f712151c3.1626774457.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c