[PATCH 0/2] ext4: ensure WRITE_ZEROES is power-failure-safe.
From: Zhang Yi
Date: Wed Jul 29 2026 - 05:18:25 EST
From: Zhang Yi <yi.zhang@xxxxxxxxxx>
Hello!
This series is extracted from the last patch of my previous series
"ext4: fix unaligned edge handling in FALLOC_FL_WRITE_ZEROES"[1]. It
fixes the issue where FALLOC_FL_WRITE_ZEROES could leave written extents
beyond EOF after a power failure (reported by Jan). This series fixes
the on-disk orphan list corruption and filesystem corruption that could
occur during partial extent conversion in
ext4_convert_unwritten_extents() as reported by sashiko in the previous
version.
The first patch modifies ext4_convert_unwritten_extents() to return the
length that has been successfully converted in case of partial
conversion. The second first uses the converted length to determine
whether to add an orphan list entry, ensuring that any newly converted
written extents are protected by the orphan list before i_disksize is
updated, then well document the behavior of ext4_alloc_file_blocks() as
Ted suggested.
[1] https://lore.kernel.org/linux-ext4/20260714080044.4038124-1-yi.zhang@xxxxxxxxxxxxxxx/
Thanks,
Yi.
Zhang Yi (2):
ext4: export converted block count from
ext4_convert_unwritten_extents()
ext4: protect WRITE_ZEROES written extents with orphan list
fs/ext4/ext4.h | 3 +-
fs/ext4/extents.c | 129 ++++++++++++++++++++++++++++++++++++----------
fs/ext4/file.c | 3 +-
3 files changed, 107 insertions(+), 28 deletions(-)
--
2.52.0