Skip to content

Commit 07be778

Browse files
srivathsa729tytso
authored andcommitted
ext4: enable meta_bg only when new desc blocks are needed
This patch addresses an issue observed when resize_inode is disabled and an online extension of a filesysyem is performed. When a filesystem is expanded to a size that does not require a addition of a new descriptor block, the meta_bg feature is being enabled even though no part of the filesystem uses this layout. This patch ensures that the meta_bg feature is only enabled if any of the added block groups utilize meta_bg layout. Signed-off-by: Srivathsa Dara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 0efcd73 commit 07be778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/resize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
20852085
}
20862086
}
20872087

2088-
if ((!resize_inode && !meta_bg) || n_blocks_count == o_blocks_count) {
2088+
if ((!resize_inode && !meta_bg && n_desc_blocks > o_desc_blocks) || n_blocks_count == o_blocks_count) {
20892089
err = ext4_convert_meta_bg(sb, resize_inode);
20902090
if (err)
20912091
goto out;

0 commit comments

Comments
 (0)