Re: [MAINTAINERS/KERNEL SUMMIT] Trust and maintenance of file systems

Theodore Ts'o
2023-09-19T16:34:40Z

On Tue, Sep 19, 2023 at 06:17:21AM +0100, Matthew Wilcox wrote:
> Frustratingly, it looks like buffer_heads were intended to be used as
> extents; each one has a b_size of its own. But there's a ridiculous
> amount of code that assumes that all BHs attached to a folio have the
> same b_size as each other.

The primary reason why we need a per-bh b_size is for the benefit of
non-iomap O_DIRECT code paths. If that goes away, then we can
simplify this significantly, since we flush the buffer cache whenever
we change the blocksize used in the buffer cache; the O_DIRECT bh's
aren't part of the buffer cache, which is when you might have bh's with
a b_size of 8200k (when doing a 8200k O_DIRECT read or write).

Cheers,

- Ted