Re: [PATCH RFC v2 0/3] ext4: don't complete atomic writes through buffered I/O

From: Theodore Ts'o

Date: Thu Nov 19 2026 - 09:56:35 EST



On Mon, 12 Oct 2026 13:17:39 -0400, Tal Zussman wrote:
> ext4_dio_write_iter() has two ways to finish a write through the page
> cache: the fallback for inodes that can't do direct I/O at all, and the
> completion of a short direct write. Neither provides torn-write
> protection, and neither refuses IOCB_ATOMIC.
>
> Patch 1 fixes a reachable bug: an atomic write to a data-journaled
> inode is advertised by statx() and then silently done as a buffered
> write. Patch 2 makes a short atomic direct write fail with -EIO instead
> of falling back. That path should be unreachable today, so this is
> defensive. Patch 3 closes the same kind of gap for DAX inodes,
> which ext4_file_write_iter() hands to the DAX path before any atomic
> write handling. No DAX-capable device advertises atomic write limits
> today, so this one is defensive too, and matches XFS.
>
> [...]

Applied, thanks!

[1/3] ext4: reject atomic writes on inodes that can't do direct I/O
commit: 44805e53d2cab4cfc58faaae9c70fde0206eecb6
[2/3] ext4: never fall back to buffered I/O for atomic direct writes
commit: 4562556caa2bedd549038690a4a1481c6446ec41
[3/3] ext4: don't advertise atomic writes for DAX inodes
commit: 078b328cafee53d4284528a3b07454e0cab955a4

Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>