]> Gentwo Git Trees - linux/.git/commitdiff
ext4: prepare buddy cache inode for BS > PS with large folios
authorBaokun Li <libaokun1@huawei.com>
Fri, 21 Nov 2025 09:06:44 +0000 (17:06 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 29 Nov 2025 03:35:27 +0000 (22:35 -0500)
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 <libaokun1@huawei.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Message-ID: <20251121090654.631996-15-libaokun@huaweicloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c

index 4801cea6badd7d9e97bb70d8d0a74bd594df3769..c4ac3142c0d79a084483f8c826e964af37c1a706 100644 (file)
@@ -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);