diff options
-rw-r--r-- | fs/ext4/super.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 1f8cb1812723..e38dd7d37a69 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -2405,6 +2405,16 @@ static ext4_fsblk_t descriptor_loc(struct super_block *sb, | |||
2405 | if (ext4_bg_has_super(sb, bg)) | 2405 | if (ext4_bg_has_super(sb, bg)) |
2406 | has_super = 1; | 2406 | has_super = 1; |
2407 | 2407 | ||
2408 | /* | ||
2409 | * If we have a meta_bg fs with 1k blocks, group 0's GDT is at | ||
2410 | * block 2, not 1. If s_first_data_block == 0 (bigalloc is enabled | ||
2411 | * on modern mke2fs or blksize > 1k on older mke2fs) then we must | ||
2412 | * compensate. | ||
2413 | */ | ||
2414 | if (sb->s_blocksize == 1024 && nr == 0 && | ||
2415 | le32_to_cpu(EXT4_SB(sb)->s_es->s_first_data_block) == 0) | ||
2416 | has_super++; | ||
2417 | |||
2408 | return (has_super + ext4_group_first_block_no(sb, bg)); | 2418 | return (has_super + ext4_group_first_block_no(sb, bg)); |
2409 | } | 2419 | } |
2410 | 2420 | ||