[PATCH -next v5 05/32] ext4: set EXT4_MAP_NEW flag for delayed allocated blocks
From: Zhang Yi
Date: Fri Aug 14 2026 - 05:47:35 EST
From: Zhang Yi <yi.zhang@xxxxxxxxxx>
Set EXT4_MAP_NEW in ext4_da_map_blocks() to properly indicate that a
new delayed allocation block has been inserted, allowing callers to
distinguish newly created delayed extents from existing ones.
Reported-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx>
Link: https://lore.kernel.org/linux-ext4/cc05c17d-163e-4251-b2c9-aa3a6f9555d7@xxxxxxxxxxxxxxx/
Signed-off-by: Zhang Yi <yi.zhang@xxxxxxxxxx>
---
fs/ext4/inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 7601fe3618b1..9dbece14ae56 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -1990,7 +1990,7 @@ static int ext4_da_map_blocks(struct inode *inode, struct ext4_map_blocks *map)
}
}
- map->m_flags |= EXT4_MAP_DELAYED;
+ map->m_flags |= EXT4_MAP_DELAYED | EXT4_MAP_NEW;
retval = ext4_insert_delayed_blocks(inode, map->m_lblk, map->m_len);
if (!retval)
map->m_seq = READ_ONCE(EXT4_I(inode)->i_es_seq);
--
2.52.0