Re: fall back from direct to buffered I/O when stable writes are required

Ming Lei
2025-11-12T14:19:09Z

On Thu, Nov 06, 2025 at 01:49:00PM +0100, hch wrote:
> On Thu, Nov 06, 2025 at 09:50:10AM +0000, Johannes Thumshirn wrote:
> > On 11/5/25 10:44 PM, Darrick J. Wong wrote:
> > > Just out of curiosity -- is qemu itself mutating the buffers that it is
> > > passing down to the lower levels via dio? Or is it a program in the
> > > guest that's mutating buffers that are submitted for dio, which then get
> > > zerocopied all the way down to the hypervisor?
> >
> > If my memory serves me right it is the guest (or at least can be). I
> > remember a bug report on btrfs where a Windows guest had messed up
> > checksums because of modifying inflight I/O.
>
> qemu passes I/O through, so yes it is guest controller. Windows is most
> famous, but the Linux swap code can trigger it easily too.

Looks buffer overwrite is actually done by buggy software in guest side,
why is qemu's trouble? Or will qemu IO emulator write to the IO buffer
when guest IO is inflight?

Thanks,
Ming