[PATCH 6.1 237/312] Revert "ext4: dont zero the entire extent if EXT4_EXT_DATA_PARTIAL_VALID1"

Greg Kroah-Hartman
2026-04-08T18:17:01Z

This reverts commit ddf854e59166533b0f46ba32cd6cd9aca3197d1b.

Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ext4/extents.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index da7414e84ead8..e2f9c27c7e161 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3298,15 +3298,6 @@ static struct ext4_ext_path *ext4_split_extent_at(handle_t *handle,
}

if (!err) {
- /*
- * The first half contains partially valid data, the
- * splitting of this extent has not been completed, fix
- * extent length and ext4_split_extent() split will the
- * first half again.
- */
- if (split_flag & EXT4_EXT_DATA_PARTIAL_VALID1)
- goto fix_extent_len;
-
/* update the extent length and mark as initialized */
ex->ee_len = cpu_to_le16(ee_len);
ext4_ext_try_to_merge(handle, inode, path, ex);
@@ -3382,9 +3373,7 @@ static int ext4_split_extent(handle_t *handle,
split_flag1 |= EXT4_EXT_MARK_UNWRIT1 |
EXT4_EXT_MARK_UNWRIT2;
if (split_flag & EXT4_EXT_DATA_VALID2)
- split_flag1 |= map->m_lblk > ee_block ?
- EXT4_EXT_DATA_PARTIAL_VALID1 :
- EXT4_EXT_DATA_ENTIRE_VALID1;
+ split_flag1 |= EXT4_EXT_DATA_ENTIRE_VALID1;
path = ext4_split_extent_at(handle, inode, path,
map->m_lblk + map->m_len, split_flag1, flags1);
if (IS_ERR(path)) {
--
2.53.0