From: Darrick J. Wong Date: Mon, 3 Oct 2016 16:11:24 +0000 (-0700) Subject: xfs: reserve AG space for the refcount btree root X-Git-Tag: v4.9-rc1~31^2~54 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=d0e853f3600cd2a3f7c4a067dc38155c77c51df9;p=linux.git 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 Reviewed-by: Christoph Hellwig --- 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; }