Re: [PATCH 2/6] iomap, xfs: lift zero range hole mapping flush into xfs

Christoph Hellwig
2025-11-07T13:57:43Z

On Thu, Nov 06, 2025 at 10:52:34AM -0500, Brian Foster wrote:
> > An unaligned pagecache write to an uncached region uses the read mapping
> > to pull data into the pagecache. For writeback, we'd use the write
> > mapping if it's non-null, or else the read mapping.
> >
>
> Or perhaps let the read/write mappings overlap? It's not clear to me if
> that's better or worse. ;P

It is much better for the case where they actually are different.

> > This might not move the needle much wrt to fixing your problem, but at
> > least it eliminates the weirdness around "@iomap is for reads except
> > when you're doing a write but you have to do a read *and* @srcmap isn't
> > a hole".
> >
>
> Yeah.. it might be reaching a pedantic level, but to me having a couple
> mappings that say "you can read from this range, write to that range,
> and they might be the same" is more clear than the srcmap/dstmap/maybe
> both logic we have today.

It is a lot better.