io_uring: don't halt iopoll too early
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 9 Aug 2021 12:04:09 +0000 (13:04 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Aug 2021 19:52:06 +0000 (13:52 -0600)
commitd487bf90d1e0dd1a9bf9627752257337a7505626
treed468f537ae51937b1c1dd455a58b2b6889763752
parentdc49e7bdd5b6ef53fc9f77e1b587157d4e6ae290
io_uring: don't halt iopoll too early

IOPOLL users should care more about getting completions for requests
they submitted, but not in "device did/completed something". Currently,
io_do_iopoll() may return a positive number, which will instruct
io_iopoll_check() to break the loop and end the syscall, even if there
is not enough CQEs or none at all.

Don't return positive numbers, so io_iopoll_check() exits only when it
gets an actual error, need reschedule or got enough CQEs.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/641a88f751623b6758303b3171f0a4141f06726e.1628471125.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c