From: Baokun Li Date: Fri, 21 Nov 2025 09:06:44 +0000 (+0800) Subject: ext4: prepare buddy cache inode for BS > PS with large folios X-Git-Tag: v6.19-rc1~161^2~11 X-Git-Url: https://gentwo.org/gitweb/?a=commitdiff_plain;h=31daa8261c54404513cf7ac81d1f79ff1cdbc36e;p=linux%2F.git ext4: prepare buddy cache inode for BS > PS with large folios We use EXT4_BAD_INO for the buddy cache inode number. This inode is not accessed via __ext4_new_inode() or __ext4_iget(), meaning ext4_set_inode_mapping_order() is not called to set its folio order range. However, future block size greater than page size support requires this inode to support large folios, and the buddy cache code already handles BS > PS. Therefore, ext4_set_inode_mapping_order() is now explicitly called for this specific inode to set its folio order range. Signed-off-by: Baokun Li Reviewed-by: Zhang Yi Reviewed-by: Jan Kara Reviewed-by: Ojaswin Mujoo Message-ID: <20251121090654.631996-15-libaokun@huaweicloud.com> Signed-off-by: Theodore Ts'o --- diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index 4801cea6badd..c4ac3142c0d7 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -3510,6 +3510,8 @@ static int ext4_mb_init_backend(struct super_block *sb) * this will avoid confusion if it ever shows up during debugging. */ sbi->s_buddy_cache->i_ino = EXT4_BAD_INO; EXT4_I(sbi->s_buddy_cache)->i_disksize = 0; + ext4_set_inode_mapping_order(sbi->s_buddy_cache); + for (i = 0; i < ngroups; i++) { cond_resched(); desc = ext4_get_group_desc(sb, i, NULL);