[RFC PATCH 2/9] ext4: stop creating inline data for new regular files
From: Yun Zhou
Date: Mon Jul 27 2026 - 07:06:57 EST
Stop setting EXT4_STATE_MAY_INLINE_DATA for newly allocated regular
file inodes. New files always use block-based storage. Directories
retain inline data capability as it still provides value for small
directories without the write path complexity.
Existing file inodes with inline data are not affected -- MAY_INLINE_DATA
is still set for them during iget via ext4_find_inline_data_nolock().
Signed-off-by: Yun Zhou <yun.zhou@xxxxxxxxxxxxx>
---
fs/ext4/ialloc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index a40cb27f8116..278f0ab8c996 100644
--- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -1305,8 +1305,8 @@ struct inode *__ext4_new_inode(struct mnt_idmap *idmap,
ei->i_extra_isize = sbi->s_want_extra_isize;
ei->i_inline_off = 0;
- if (ext4_has_feature_inline_data(sb) &&
- (!(ei->i_flags & (EXT4_DAX_FL|EXT4_EA_INODE_FL)) || S_ISDIR(mode)))
+ if (ext4_has_feature_inline_data(sb) && S_ISDIR(mode) &&
+ !(ei->i_flags & EXT4_DAX_FL))
ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
ret = inode;
err = dquot_alloc_inode(inode);
--
2.43.0