]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: reserve AG space for the refcount btree root
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 25 Oct 2016 01:26:50 +0000 (12:26 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 25 Oct 2016 01:26:50 +0000 (12:26 +1100)
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 <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
libxfs/xfs_alloc.c

index 84f1e14dfb3643d59e52e6162aa484c0f6d879b0..1ca32685766df68fe18d593b96a0d9da6d4080e3 100644 (file)
@@ -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;
 }