Re: [PATCH 1/4] iomap: Lift blocksize restriction on atomic writes

Christoph Hellwig
2025-01-16T06:52:34Z

On Tue, Jan 14, 2025 at 03:57:26PM -0800, Darrick J. Wong wrote:
> Ok, let's do that then. Just to be clear -- for any RWF_ATOMIC direct
> write that's correctly aligned and targets a single mapping in the
> correct state, we can build the untorn bio and submit it. For
> everything else, prealloc some post EOF blocks, write them there, and
> exchange-range them.
>
> Tricky questions: How do we avoid collisions between overlapping writes?
> I guess we find a free file range at the top of the file that is long
> enough to stage the write, and put it there? And purge it later?
>
> Also, does this imply that the maximum file size is less than the usual
> 8EB?

I think literally using the exchrange code for anything but an
initial prototype is a bad idea for the above reasons. If we go
beyond proving this is possible you'd want a version of exchrange
where the exchange partners is not a file mapping, but a cow staging
record.