[PATCH 0/2] ext4: ensure WRITE_ZEROES is power-failure-safe.
Zhang Yi <[email protected]> Wed, 29 Jul 2026 16:59:16 +0800
| Newsgroups | org.kernel.vger.linux-ext4,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
From: Zhang Yi <[email protected]> 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/[email protected]/ 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