Repository navigation
Conversation
io_uring can complete an O_DIRECT read with -EAGAIN on kernels without
commit b08e02045002 ("io_uring/rw: don't gate retry on completion
context"), which was merged for Linux 6.14. This happens on XFS for a
read that spans several extents when a concurrent allocating write
holds the inode lock: the bios for the first extents are already in
flight when mapping a later extent fails with -EAGAIN, iomap completes
the request from a workqueue, and io_uring does not retry it outside
the submitting task. virtio-blk then reports VIRTIO_BLK_S_IOERR to the
guest for data that is intact.
Reissue a read or write that completes with -EAGAIN or -EINTR once,
with IOSQE_ASYNC so that io-wq runs it in blocking mode, where it
cannot fail this way again. QEMU resubmits both errors as well.
Signed-off-by: doge <me@crackerben.com>
rbradford
requested changes
Oct 2, 2026
rbradford
left a comment
Member
There was a problem hiding this comment.
Thank you but this needs some very careful review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On our XFS hosts (Linux 6.12), guests logged read errors under concurrent writes:
For each of them the VMM logged:
The data on disk was intact. On the host, each failed request was an
iomap_dio_completetrace event with error -11 in a kworker, followed by anio_uring_completeevent with result -11. Kernels with b08e02045002 (6.14) retry such requests in io_uring.Tested with two new unit tests, the first of which fails on main. They skip on kernels before 6.4, where pipes do not support RWF_NOWAIT. In a Linux guest on an XFS host, 4 threads wrote random 4 KiB blocks with O_DIRECT into a fallocated 32 GiB file while 4 threads read the disk range under it in 1 MiB O_DIRECT reads, for 5 minutes: on main 1,036,069 of 3,714,530 reads failed with EIO, with this change none of 3,168,618 did.