io_uring/net: only retry recv bundle for a full transfer
authorJens Axboe <axboe@kernel.dk>
Thu, 22 May 2025 00:51:49 +0000 (18:51 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 22 May 2025 01:24:18 +0000 (19:24 -0600)
commit3a08988123c868dbfdd054541b1090fb891fa49e
tree5588f4cfeb588a32e2c06dba4c22f1c71e0e85cc
parenta7d755ed9ce9738af3db602eb29d32774a180bc7
io_uring/net: only retry recv bundle for a full transfer

If a shorter than assumed transfer was seen, a partial buffer will have
been filled. For that case it isn't sane to attempt to fill more into
the bundle before posting a completion, as that will cause a gap in
the received data.

Check if the iterator has hit zero and only allow to continue a bundle
operation if that is the case.

Also ensure that for putting finished buffers, only the current transfer
is accounted. Otherwise too many buffers may be put for a short transfer.

Link: https://github.com/axboe/liburing/issues/1409
Cc: stable@vger.kernel.org
Fixes: 7c71a0af81ba ("io_uring/net: improve recv bundles")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/net.c