io_uring: allow re-poll if we made progress
authorJens Axboe <axboe@kernel.dk>
Sat, 21 Jan 2023 17:39:22 +0000 (10:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:22:43 +0000 (07:22 +0100)
commita79b13f24967b68b49aa23eda5fa9eb14d07b3a4
treeffe7c7d82cced224fe2516f836aec6bc42de708a
parent3c1a3d02690fc22890aa038bbdb76aacdf561bd5
io_uring: allow re-poll if we made progress

commit 10c873334febaeea9aa0c25c10b5ac0951b77a5f upstream.

We currently check REQ_F_POLLED before arming async poll for a
notification to retry. If it's set, then we don't allow poll and will
punt to io-wq instead. This is done to prevent a situation where a buggy
driver will repeatedly return that there's space/data available yet we
get -EAGAIN.

However, if we already transferred data, then it should be safe to rely
on poll again. Gate the check on whether or not REQ_F_PARTIAL_IO is
also set.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/io_uring.c