From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 2589C29DFA for ; Sat, 19 Dec 2015 03:06:17 -0600 (CST) Received: from cuda.sgi.com (cuda3.sgi.com [192.48.176.15]) by relay2.corp.sgi.com (Postfix) with ESMTP id 16DEC304053 for ; Sat, 19 Dec 2015 01:06:17 -0800 (PST) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by cuda.sgi.com with ESMTP id cH78SvicF4a4TA3X (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 19 Dec 2015 01:06:16 -0800 (PST) Subject: [PATCH 13/53] libxfs: fix min freelist length calculation From: "Darrick J. Wong" Date: Sat, 19 Dec 2015 01:06:13 -0800 Message-ID: <20151219090613.14255.34478.stgit@birch.djwong.org> In-Reply-To: <20151219090450.14255.48364.stgit@birch.djwong.org> References: <20151219090450.14255.48364.stgit@birch.djwong.org> MIME-Version: 1.0 List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: david@fromorbit.com, darrick.wong@oracle.com Cc: xfs@oss.sgi.com If rmapbt is disabled, it is incorrect to require 1 extra AGFL block for the rmapbt (due to the + 1); the entire clause needs to be gated on the feature flag. This causes serious problems if formatting a v4 filesystem because the extra AGFL block causes the root inode not to be where xfs_repair expects it. In turn, xfs_repair reports major FS damage when everything is fine. Signed-off-by: Darrick J. Wong --- libxfs/xfs_alloc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index bc2b3d4..b66ca99 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -1967,8 +1967,10 @@ xfs_alloc_min_freelist( min_free += min_t(unsigned int, pag->pagf_levels[XFS_BTNUM_CNTi] + 1, mp->m_ag_maxlevels); /* space needed reverse mapping used space btree */ - min_free += min_t(unsigned int, pag->pagf_levels[XFS_BTNUM_RMAPi] + 1, - mp->m_ag_maxlevels); + if (xfs_sb_version_hasrmapbt(&mp->m_sb)) + min_free += min_t(unsigned int, + pag->pagf_levels[XFS_BTNUM_RMAPi] + 1, + mp->m_ag_maxlevels); return min_free; } _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs