xfs: don't reserve per-AG space for an internal log
It turns out that the log can consume nearly all the space in an AG, and when this happens this it's possible that there will be less free space in the AG than the reservation would try to hide. On a debug kernel this can trigger an ASSERT in xfs/250: XFS: Assertion failed: xfs_perag_resv(pag, XFS_AG_RESV_METADATA)->ar_reserved + xfs_perag_resv(pag, XFS_AG_RESV_RMAPBT)->ar_reserved <= pag->pagf_freeblks + pag->pagf_flcount, file: fs/xfs/libxfs/xfs_ag_resv.c, line: 319 The log is permanently allocated, so we know we're never going to have to expand the btrees to hold any records associated with the log space. We therefore can treat the space as if it doesn't exist. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com>
This commit is contained in:
@@ -549,6 +549,15 @@ xfs_inobt_max_size(
|
||||
if (mp->m_inobt_mxr[0] == 0)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* The log is permanently allocated, so the space it occupies will
|
||||
* never be available for the kinds of things that would require btree
|
||||
* expansion. We therefore can pretend the space isn't there.
|
||||
*/
|
||||
if (mp->m_sb.sb_logstart &&
|
||||
XFS_FSB_TO_AGNO(mp, mp->m_sb.sb_logstart) == agno)
|
||||
agblocks -= mp->m_sb.sb_logblocks;
|
||||
|
||||
return xfs_btree_calc_size(mp->m_inobt_mnr,
|
||||
(uint64_t)agblocks * mp->m_sb.sb_inopblock /
|
||||
XFS_INODES_PER_CHUNK);
|
||||
|
Reference in New Issue
Block a user