linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] btrfs: always fallback to buffered write if the inode requires checksum
       [not found] <e9b8716e2d613cac27e59ceb141f973540f40eef.1738639778.git.wqu@suse.com>
@ 2025-02-06 14:13 ` hch
  2025-02-06 20:32   ` Qu Wenruo
  0 siblings, 1 reply; 2+ messages in thread
From: hch @ 2025-02-06 14:13 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: linux-btrfs, Jan Kara, linux-fsdevel, linux-mm

On Tue, Feb 04, 2025 at 02:00:23PM +1030, Qu Wenruo wrote:
> [BUG]
> It is a long known bug that VM image on btrfs can lead to data csum
> mismatch, if the qemu is using direct-io for the image (this is commonly
> known as cache mode none).
> 
> [CAUSE]
> Inside the VM, if the fs is EXT4 or XFS, or even NTFS from Windows, the
> fs is allowed to dirty/modify the folio even the folio is under
> writeback (as long as the address space doesn't have AS_STABLE_WRITES
> flag inherited from the block device).

Btw, can you add an xfstests that reproduces this by modifying pages
under direct I/O?  That would be really helpful to verify the code when
we want to turn back on real direct I/O eventually when the VM is fixed
to prevent the modifications.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] btrfs: always fallback to buffered write if the inode requires checksum
  2025-02-06 14:13 ` [PATCH v2] btrfs: always fallback to buffered write if the inode requires checksum hch
@ 2025-02-06 20:32   ` Qu Wenruo
  0 siblings, 0 replies; 2+ messages in thread
From: Qu Wenruo @ 2025-02-06 20:32 UTC (permalink / raw)
  To: hch, Qu Wenruo; +Cc: linux-btrfs, Jan Kara, linux-fsdevel, linux-mm



在 2025/2/7 00:43, hch@infradead.org 写道:
> On Tue, Feb 04, 2025 at 02:00:23PM +1030, Qu Wenruo wrote:
>> [BUG]
>> It is a long known bug that VM image on btrfs can lead to data csum
>> mismatch, if the qemu is using direct-io for the image (this is commonly
>> known as cache mode none).
>>
>> [CAUSE]
>> Inside the VM, if the fs is EXT4 or XFS, or even NTFS from Windows, the
>> fs is allowed to dirty/modify the folio even the folio is under
>> writeback (as long as the address space doesn't have AS_STABLE_WRITES
>> flag inherited from the block device).
>
> Btw, can you add an xfstests that reproduces this by modifying pages
> under direct I/O?  That would be really helpful to verify the code when
> we want to turn back on real direct I/O eventually when the VM is fixed
> to prevent the modifications.

Sure, although I'm afraid it will need to be a C program instead.

Thanks,
Qu


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-06 20:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <e9b8716e2d613cac27e59ceb141f973540f40eef.1738639778.git.wqu@suse.com>
2025-02-06 14:13 ` [PATCH v2] btrfs: always fallback to buffered write if the inode requires checksum hch
2025-02-06 20:32   ` Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox