Re: [PATCH RFC] statx.2: Add stx_atomic_write_unit_max_opt

Christoph Hellwig
2025-03-20T07:00:59Z

On Wed, Mar 19, 2025 at 11:44:02AM +0000, John Garry wrote:
> XFS supports atomic writes - or untorn writes - based on different methods:
> - HW offload in the disk
> - Software emulation
>
> The value reported in stx_atomic_write_unit_max will be the max of the
> software emulation method.

I don't think emulation is a good word. A file system implementing
file systems things is not emulation.

> We want STATX_WRITE_ATOMIC to get this new member in addition to the
> already-existing members, so mention that a value of 0 means that
> stx_atomic_write_unit_max holds this limit.

Does that actually work? Can userspace assume all unknown statx
fields are padded to zero? If so my dio read align change could have
done away with the extra flag.