From: Darrick J. Wong Date: Sat, 24 Oct 2015 04:24:57 +0000 (-0400) Subject: LU-8976 libext2fs: fix maximum bg overhead calculation with meta_bg enabled X-Git-Tag: v1.42.13.wc6~3 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=5730e722ef557ce0e83128cba349317f67e8260d;p=tools%2Fe2fsprogs.git LU-8976 libext2fs: fix maximum bg overhead calculation with meta_bg enabled When meta_bg is enabled at mkfs time, we put at most one group descriptor block in each blockgroup. Unfortunately, the calculation of max overhead per bg doesn't know this, so mkfs fails when it isn't strictly necessary. Fix it, since Dave reported that he couldn't create a 500TB ext4 filesystem. E2fsprogs-commit: 1abdd04eb1d19488493022f81c03f5b80aa7fcc7 Change-Id: I22ef75037807f811b2133f4f4a62fbad02f1444f Reported-by: Dave Chinner Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o Signed-off-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/25263 Tested-by: Jenkins Tested-by: Maloo --- diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index 36c94a9..3c07412 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -379,7 +379,12 @@ ipg_retry: * table, and the reserved gdt blocks. */ overhead = (int) (3 + fs->inode_blocks_per_group + - fs->desc_blocks + super->s_reserved_gdt_blocks); + super->s_reserved_gdt_blocks); + + if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) + overhead++; + else + overhead += fs->desc_blocks; /* This can only happen if the user requested too many inodes */ if (overhead > super->s_blocks_per_group) { diff --git a/version.h b/version.h index dae0110..2168395 100644 --- a/version.h +++ b/version.h @@ -7,5 +7,5 @@ * file may be redistributed under the GNU Public License v2. */ -#define E2FSPROGS_VERSION "1.42.13.wc5" -#define E2FSPROGS_DATE "15-Apr-2016" +#define E2FSPROGS_VERSION "1.42.13.wc6" +#define E2FSPROGS_DATE "05-Feb-2017"