From: Brian Foster Date: Mon, 26 May 2014 23:06:41 +0000 (+1000) Subject: repair: account for finobt in ag 0 geometry pre-calculation X-Git-Tag: v3.2.1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b3709059f29b44f9003ed17a44d9d9c3288ec80;p=thirdparty%2Fxfsprogs-dev.git repair: account for finobt in ag 0 geometry pre-calculation Account for the finobt in calc_mkfs(). Signed-off-by: Brian Foster Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index 08b25f0f9..9eb2fa4a4 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -399,14 +399,18 @@ calc_mkfs(xfs_mount_t *mp) do_inoalign = mp->m_sinoalign; /* - * pre-calculate geometry of ag 0. We know what it looks - * like because we know what mkfs does -- 3 btree roots, - * and some number of blocks to prefill the agfl. + * Pre-calculate the geometry of ag 0. We know what it looks like + * because we know what mkfs does: 2 allocation btree roots (by block + * and by size), the inode allocation btree root, the free inode + * allocation btree root (if enabled) and some number of blocks to + * prefill the agfl. */ bnobt_root = howmany(4 * mp->m_sb.sb_sectsize, mp->m_sb.sb_blocksize); bcntbt_root = bnobt_root + 1; inobt_root = bnobt_root + 2; fino_bno = inobt_root + XFS_MIN_FREELIST_RAW(1, 1, mp) + 1; + if (xfs_sb_version_hasfinobt(&mp->m_sb)) + fino_bno++; /* * If the log is allocated in the first allocation group we need to