[PATCH] fs: remove power of 2 and length boundary atomic write restrictions

Vitaliy Filippov vitalifster at gmail.com
Tue Jan 6 05:08:57 PST 2026


> For ext4, the maximum atomic write size is limited to the bigalloc
> cluster size. Disk blocks are allocated to this cluster size granularity
> and alignment. As such, a properly aligned atomic write <= cluster size
> can never span discontiguous disk blocks.

Ok, thank you for the explanation.

But it seems that it's an internal implementation detail of ext4,
right? So this check should be done inside ext4 code. And in fact I
suspect it's actually already done there because generic checks which
I suggest to remove can't take ext4 cluster size into account, so at
least some atomic write validation is already done inside ext4. The
only thing that's left is to move the write alignment check there too.

Another thing that suggests that it's an internal implementation
detail is that a CoW filesystem like ZFS or btrfs can probably provide
atomic write guarantees for unaligned writes too, and probably even
without hardware atomic write support.

Can my change be limited to raw block devices then? Thanks to your
explanation now I understand the motivation for these checks with
ext4, but they still make no sense for the raw NVMe disk.

I mean, can you approve my change if I rework it to only lift 2^N and
alignment checks for raw block devices and not for file systems? For
example if I move these checks directly to the related ext4 and xfs
code? I think it's the right place to do them.



More information about the Linux-nvme mailing list