[PATCH for-11.0 v2 0/3] linux-aio/io-uring: Resubmit tails of short requests

Hanna Czenczek posted 3 patches 1 week, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260324084338.37453-1-hreitz@redhat.com
Maintainers: Aarushi Mehta <mehta.aaru20@gmail.com>, Julia Suvorova <jusual@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
block/io_uring.c   | 82 +++++++++++++++++++++++-------------------
block/linux-aio.c  | 88 +++++++++++++++++++++++++++++++++++++---------
block/trace-events |  2 +-
3 files changed, 117 insertions(+), 55 deletions(-)
[PATCH for-11.0 v2 0/3] linux-aio/io-uring: Resubmit tails of short requests
Posted by Hanna Czenczek 1 week, 3 days ago
Hi,

v1 is here:

https://lists.nongnu.org/archive/html/qemu-block/2026-03/msg00307.html

Short reads and writes can happen.  One way to reproduce them is via
FUSE export, if you force it to limit the request length in the
read/write path (patch in the commit messages of patches 2 and 3), but
specifically short writes apparently can also happen with NFS.

For the file-posix block driver, aio=threads already takes care of them.
aio=native does not, at all, and aio=io_uring only handles short reads,
but not writes.  This series has both aio=native and aio=io_uring handle
both short reads and writes.  zone-append is not touched, as I don’t
believe resubmitting the tail (if a short append can even happen) is
safe.

v2:
- Patch 1 (kept R-b):
  - Put all 32-bit fields together
  - Removed unnecessary parentheses
- Patch 2 (kept R-b):
  - make qemu_iovec_destroy() call contingent on qiov.iov being non-NULL
  - include total_done in offset in laio_do_submit()
- Patch 3 (kept R-b):
  - make qemu_iovec_destroy() call contingent on qiov.iov being non-NULL
  - include total_done in offset in luring_prep_sqe()

git-backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/3:[0007] [FC] 'linux-aio: Put all parameters into qemu_laiocb'
002/3:[0017] [FC] 'linux-aio: Resubmit tails of short reads/writes'
003/3:[0023] [FC] 'io-uring: Resubmit tails of short writes'

Hanna Czenczek (3):
  linux-aio: Put all parameters into qemu_laiocb
  linux-aio: Resubmit tails of short reads/writes
  io-uring: Resubmit tails of short writes

 block/io_uring.c   | 82 +++++++++++++++++++++++-------------------
 block/linux-aio.c  | 88 +++++++++++++++++++++++++++++++++++++---------
 block/trace-events |  2 +-
 3 files changed, 117 insertions(+), 55 deletions(-)

-- 
2.53.0


Re: [PATCH for-11.0 v2 0/3] linux-aio/io-uring: Resubmit tails of short requests
Posted by Kevin Wolf 1 week, 2 days ago
Am 24.03.2026 um 09:43 hat Hanna Czenczek geschrieben:
> Hi,
> 
> v1 is here:
> 
> https://lists.nongnu.org/archive/html/qemu-block/2026-03/msg00307.html
> 
> Short reads and writes can happen.  One way to reproduce them is via
> FUSE export, if you force it to limit the request length in the
> read/write path (patch in the commit messages of patches 2 and 3), but
> specifically short writes apparently can also happen with NFS.
> 
> For the file-posix block driver, aio=threads already takes care of them.
> aio=native does not, at all, and aio=io_uring only handles short reads,
> but not writes.  This series has both aio=native and aio=io_uring handle
> both short reads and writes.  zone-append is not touched, as I don’t
> believe resubmitting the tail (if a short append can even happen) is
> safe.
> 
> v2:
> - Patch 1 (kept R-b):
>   - Put all 32-bit fields together
>   - Removed unnecessary parentheses
> - Patch 2 (kept R-b):
>   - make qemu_iovec_destroy() call contingent on qiov.iov being non-NULL
>   - include total_done in offset in laio_do_submit()
> - Patch 3 (kept R-b):
>   - make qemu_iovec_destroy() call contingent on qiov.iov being non-NULL
>   - include total_done in offset in luring_prep_sqe()

Thanks, applied to the block branch.

Kevin