io_uring: fix -EAGAIN retry with IOPOLL
authorJens Axboe <axboe@kernel.dk>
Mon, 1 Mar 2021 20:56:00 +0000 (13:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Mar 2021 16:46:05 +0000 (09:46 -0700)
commitf52e06c8e8a1e42a83329bb898985b851821ca99
tree1802618c924ecaa21671f24b47eeb85aca7c6616
parentdbe043aeda7c68b0029c862e297f34bea6904053
io_uring: fix -EAGAIN retry with IOPOLL

We no longer revert the iovec on -EIOCBQUEUED, see commit ab2125df921d,
and this started causing issues for IOPOLL on devies that run out of
request slots. Turns out what outside of needing a revert for those, we
also had a bug where we didn't properly setup retry inside the submission
path. That could cause re-import of the iovec, if any, and that could lead
to spurious results if the application had those allocated on the stack.

Catch -EAGAIN retry and make the iovec stable for IOPOLL, just like we do
for !IOPOLL retries.

Cc: <stable@vger.kernel.org> # 5.9+
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Reported-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c