Re: [PATCH RFC v2] btrfs: disable direct reads to avoid dirty folios without fs knowing

Christoph Hellwig <[email protected]> Thu, 23 Jul 2026 04:31:37 -0700
Newsgroups org.kernel.vger.linux-btrfs
Message-ID <[email protected]>
On Thu, Jul 23, 2026 at 03:43:40PM +0930, Qu Wenruo wrote:
> There is a bug report that a reproducer which doing the following
> workloads in two threads:
> 
> - Direct read into memory mapped from page cache
> - Sync the above range
> 
> This can lead to dirty folios without fs knowing, this can be a huge
> problem for btrfs, as even on the very basic bs == ps cases without
> large folios, such reproducer can screw up the ordered extent accounting
> already:

Disabling direct I/O on btrfs is not going to help you with that,
as you could still call the direct I/O read operation on another
file system (or a block device, or various other direct I/O like
things) on the btrfs file mapping.