aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/ext4/super.c9
-rw-r--r--include/linux/ext4_fs.h4
2 files changed, 10 insertions, 3 deletions
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index dd4ff9c87358..54450fa1af39 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1358,13 +1358,17 @@ static int ext4_check_descriptors (struct super_block * sb)
1358 ext4_fsblk_t inode_table; 1358 ext4_fsblk_t inode_table;
1359 struct ext4_group_desc * gdp = NULL; 1359 struct ext4_group_desc * gdp = NULL;
1360 int desc_block = 0; 1360 int desc_block = 0;
1361 int flexbg_flag = 0;
1361 int i; 1362 int i;
1362 1363
1364 if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))
1365 flexbg_flag = 1;
1366
1363 ext4_debug ("Checking group descriptors"); 1367 ext4_debug ("Checking group descriptors");
1364 1368
1365 for (i = 0; i < sbi->s_groups_count; i++) 1369 for (i = 0; i < sbi->s_groups_count; i++)
1366 { 1370 {
1367 if (i == sbi->s_groups_count - 1) 1371 if (i == sbi->s_groups_count - 1 || flexbg_flag)
1368 last_block = ext4_blocks_count(sbi->s_es) - 1; 1372 last_block = ext4_blocks_count(sbi->s_es) - 1;
1369 else 1373 else
1370 last_block = first_block + 1374 last_block = first_block +
@@ -1409,7 +1413,8 @@ static int ext4_check_descriptors (struct super_block * sb)
1409 le16_to_cpu(gdp->bg_checksum)); 1413 le16_to_cpu(gdp->bg_checksum));
1410 return 0; 1414 return 0;
1411 } 1415 }
1412 first_block += EXT4_BLOCKS_PER_GROUP(sb); 1416 if (!flexbg_flag)
1417 first_block += EXT4_BLOCKS_PER_GROUP(sb);
1413 gdp = (struct ext4_group_desc *) 1418 gdp = (struct ext4_group_desc *)
1414 ((__u8 *)gdp + EXT4_DESC_SIZE(sb)); 1419 ((__u8 *)gdp + EXT4_DESC_SIZE(sb));
1415 } 1420 }
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index 722d4ef12bf3..46b304d18345 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -682,13 +682,15 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
682#define EXT4_FEATURE_INCOMPAT_META_BG 0x0010 682#define EXT4_FEATURE_INCOMPAT_META_BG 0x0010
683#define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 /* extents support */ 683#define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 /* extents support */
684#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 684#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080
685#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200
685 686
686#define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR 687#define EXT4_FEATURE_COMPAT_SUPP EXT2_FEATURE_COMPAT_EXT_ATTR
687#define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \ 688#define EXT4_FEATURE_INCOMPAT_SUPP (EXT4_FEATURE_INCOMPAT_FILETYPE| \
688 EXT4_FEATURE_INCOMPAT_RECOVER| \ 689 EXT4_FEATURE_INCOMPAT_RECOVER| \
689 EXT4_FEATURE_INCOMPAT_META_BG| \ 690 EXT4_FEATURE_INCOMPAT_META_BG| \
690 EXT4_FEATURE_INCOMPAT_EXTENTS| \ 691 EXT4_FEATURE_INCOMPAT_EXTENTS| \
691 EXT4_FEATURE_INCOMPAT_64BIT) 692 EXT4_FEATURE_INCOMPAT_64BIT| \
693 EXT4_FEATURE_INCOMPAT_FLEX_BG)
692#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ 694#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
693 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ 695 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
694 EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \ 696 EXT4_FEATURE_RO_COMPAT_GDT_CSUM| \