[PATCH v2 12/13] ext4: don't drop the extents in case extent split fails
From: Ojaswin Mujoo
Date: Fri Nov 27 2026 - 10:12:38 EST
This was originally added in [1] to avoid leaving stale extents in
cache when the zeroout operation failed. Now, with the recent refactoring
and fixes, this issue no longer exists as the callers handle the split
error correctly and make sure to update the es cache once zeroout and
convertsion is successfully complete.
In fact, we NEED the extent status cache here to exist because we don't
want to drop the CONVERT_PENDING extent entries, as they are used in making
zeroout decision.
Hence, don't drop the extent status cache if we run into an error while
splitting
[1] 6d882ea3b093 ("ext4: drop extent cache after doing PARTIAL_VALID1 zeroout")
Signed-off-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx>
---
fs/ext4/extents.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index e8ebc518e58b..5130416aa8b4 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3325,9 +3325,6 @@ static struct ext4_ext_path *ext4_split_extent_at(handle_t *handle,
path = err ? ERR_PTR(err) : ERR_PTR(insert_err);
}
out_path:
- if (IS_ERR(path))
- /* Remove all remaining potentially stale extents. */
- ext4_es_remove_extent(inode, ee_block, ee_len);
ext4_ext_show_leaf(inode, path);
return path;
}
--
2.55.0