summaryrefslogtreecommitdiffstats
path: root/fs/xfs/libxfs/xfs_alloc.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2016-10-03 09:11:24 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2016-10-03 09:11:24 -0700
commitd0e853f3600cd2a3f7c4a067dc38155c77c51df9 (patch)
tree78dbdb0332cb24d52e9931befa292b90a8719983 /fs/xfs/libxfs/xfs_alloc.c
parenta90c00f05554e3a305cc2f4836e065368709926f (diff)
downloadlinux-d0e853f3600cd2a3f7c4a067dc38155c77c51df9.tar.bz2
xfs: reserve AG space for the refcount btree root
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>
Diffstat (limited to 'fs/xfs/libxfs/xfs_alloc.c')
-rw-r--r--fs/xfs/libxfs/xfs_alloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
index be7e3fcefd73..effb64cf714f 100644
--- a/fs/xfs/libxfs/xfs_alloc.c
+++ b/fs/xfs/libxfs/xfs_alloc.c
@@ -128,6 +128,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;
}