|
@@ -2405,6 +2405,16 @@ static ext4_fsblk_t descriptor_loc(struct super_block *sb,
|
|
if (ext4_bg_has_super(sb, bg))
|
|
if (ext4_bg_has_super(sb, bg))
|
|
has_super = 1;
|
|
has_super = 1;
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If we have a meta_bg fs with 1k blocks, group 0's GDT is at
|
|
|
|
+ * block 2, not 1. If s_first_data_block == 0 (bigalloc is enabled
|
|
|
|
+ * on modern mke2fs or blksize > 1k on older mke2fs) then we must
|
|
|
|
+ * compensate.
|
|
|
|
+ */
|
|
|
|
+ if (sb->s_blocksize == 1024 && nr == 0 &&
|
|
|
|
+ le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block) == 0)
|
|
|
|
+ has_super++;
|
|
|
|
+
|
|
return (has_super + ext4_group_first_block_no(sb, bg));
|
|
return (has_super + ext4_group_first_block_no(sb, bg));
|
|
}
|
|
}
|
|
|
|
|