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

Christoph Hellwig
2025-11-07T13:55:29Z

On Wed, Nov 05, 2025 at 02:23:50PM -0800, Darrick J. Wong wrote:
> Then we change the interface so that ->iomap_begin always sets read_map
> to a mapping from which file data can be read, and write_map is always
> set to a mapping into which file data can be written. If a filesystem
> doesn't support out of place writes, then it can ignore write_map and
> write_map.type will be IOMAP_NULL.

Please don't. The whole two maps in one operation thing was a giant
mistake, let's not double down on that. The only places that actually
need it is the buffered write read-modify-write code, and the unshare
and zeroing code that reuse that in ugly ways. We need to untangle
that properly:

- for the buffered write read-modify-write just do a separate iomap
operation for the partial read
- for zeroing do a separate query for holes and for the overwrite
space allocation if the file system needs it due to COW
- same for unshare