From 88b34b1f87c2d7c3dfc9be7ff6e5d916f06d960a Mon Sep 17 00:00:00 2001 From: "Jose R. Santos" Date: Mon, 13 Aug 2007 23:33:03 -0500 Subject: Relax group descriptor checking for FLEX_BG The FLEX_BG feature allows the inode table, block bitmap, and inode bitmaps to be located anywhere in the filesystem. Update e2fsck and libext2fs's checking code to recognize this. Signed-off-by: Jose R. Santos Signed-off-by: "Theodore Ts'o" -- e2fsck/super.c | 14 ++++++++++++-- lib/ext2fs/check_desc.c | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) --- e2fsck/super.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'e2fsck/super.c') diff --git a/e2fsck/super.c b/e2fsck/super.c index e3943cbe..dbd7b1ac 100644 --- a/e2fsck/super.c +++ b/e2fsck/super.c @@ -575,13 +575,17 @@ void check_super_block(e2fsck_t ctx) /* * Verify the group descriptors.... */ - first_block = sb->s_first_data_block; + first_block = sb->s_first_data_block; + last_block = sb->s_blocks_count-1; for (i = 0, gd=fs->group_desc; i < fs->group_desc_count; i++, gd++) { pctx.group = i; - first_block = ext2fs_group_first_block(fs, i); - last_block = ext2fs_group_last_block(fs, i); + if (!EXT2_HAS_INCOMPAT_FEATURE(fs->super, + EXT4_FEATURE_INCOMPAT_FLEX_BG)) { + first_block = ext2fs_group_first_block(fs, i); + last_block = ext2fs_group_last_block(fs, i); + } if ((gd->bg_block_bitmap < first_block) || (gd->bg_block_bitmap > last_block)) { -- cgit v1.2.3