Re: [PATCH v2 2/7] iomap: Add zero unwritten mappings dio support

Christoph Hellwig
2024-12-13T14:47:45Z

On Thu, Dec 12, 2024 at 12:40:07PM -0800, Darrick J. Wong wrote:
> > However, I still think that we should be able to atomic write mixed extents,
> > even though it is a pain to implement. To that end, I could be convinced
> > again that we don't require it...
>
> Well... if you /did/ add a few entries to include/uapi/linux/fs.h for
> ways that an untorn write can fail, then we could define the programming
> interface as so:
>
> "If you receive -EBADMAP, then call fallocate(FALLOC_FL_MAKE_OVERWRITE)
> to force all the mappings to pure overwrites."

Ewwwwwwwwwwwwwwwwwwwww.

That's not a sane API in any way.

> ...since there have been a few people who have asked about that ability
> so that they can write+fdatasync without so much overhead from file
> metadata updates.

And all of them fundamentally misunderstood file system semantics and/or
used weird bypasses that are dommed to corrupt the file system sooner
or later.