From: Darrick J. Wong Date: Tue, 25 Oct 2016 01:26:50 +0000 (+1100) Subject: xfs: reserve AG space for the refcount btree root X-Git-Tag: v4.9.0-rc1~101 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=868c70e32419482478fa99d4f8e0bb5960656e61;p=thirdparty%2Fxfsprogs-dev.git xfs: reserve AG space for the refcount btree root Source kernel commit: d0e853f3600cd2a3f7c4a067dc38155c77c51df9 Reduce the max AG usable space size so that we always have space for the refcount btree root. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 84f1e14df..1ca326857 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -124,6 +124,8 @@ xfs_alloc_ag_max_usable( blocks++; /* finobt root block */ if (xfs_sb_version_hasrmapbt(&mp->m_sb)) blocks++; /* rmap root block */ + if (xfs_sb_version_hasreflink(&mp->m_sb)) + blocks++; /* refcount root block */ return mp->m_sb.sb_agblocks - blocks; }