]> www.infradead.org Git - users/jedix/linux-maple.git/commit
io_uring/poll: clear single/double poll flags on poll arming
authorJens Axboe <axboe@kernel.dk>
Tue, 28 Mar 2023 01:56:18 +0000 (19:56 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:51 +0000 (12:10 +0200)
commit3eb2138d4693d81aa6e5514f439be255117cae63
tree0760e7457477b380650839948ec96bc0623d777c
parente5da11825ef7c3f4760b235e04e225e7c8746279
io_uring/poll: clear single/double poll flags on poll arming

commit 005308f7bdacf5685ed1a431244a183dbbb9e0e8 upstream.

Unless we have at least one entry queued, then don't call into
io_poll_remove_entries(). Normally this isn't possible, but if we
retry poll then we can have ->nr_entries cleared again as we're
setting it up. If this happens for a poll retry, then we'll still have
at least REQ_F_SINGLE_POLL set. io_poll_remove_entries() then thinks
it has entries to remove.

Clear REQ_F_SINGLE_POLL and REQ_F_DOUBLE_POLL unconditionally when
arming a poll request.

Fixes: c16bda37594f ("io_uring/poll: allow some retries for poll triggering spuriously")
Cc: stable@vger.kernel.org
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/poll.c