[PATCH 6.1 234/312] Revert "ext4: avoid infinite loops caused by residual data"

Greg Kroah-Hartman
2026-04-08T18:18:21Z

This reverts commit 4fee3f2f4839571a6294946a2efcdb69caa61393.

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

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 42a06360086a8..bb27c04798d2b 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4424,13 +4424,9 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
path = ext4_ext_insert_extent(handle, inode, path, &newex, flags);
if (IS_ERR(path)) {
err = PTR_ERR(path);
- /*
- * Gracefully handle out of space conditions. If the filesystem
- * is inconsistent, we'll just leak allocated blocks to avoid
- * causing even more damage.
- */
- if (allocated_clusters && (err == -EDQUOT || err == -ENOSPC)) {
+ if (allocated_clusters) {
int fb_flags = 0;
+
/*
* free data blocks we just allocated.
* not a good idea to call discard here directly,
--
2.53.0