X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=fs%2Fxfs%2Flibxfs%2Fxfs_rmap_btree.c;h=5d1f8884c8886eedc81bb54acd90c8445ad62826;hb=5cd213b0fec640a46adc5e6e4dfc7763aa54b3b2;hp=5738e11055e6bbeaf9602b353555450b24908600;hpb=f67e3fb4891287b8248ebb3320f794b9f5e782d4;p=linux.git diff --git a/fs/xfs/libxfs/xfs_rmap_btree.c b/fs/xfs/libxfs/xfs_rmap_btree.c index 5738e11055e6..5d1f8884c888 100644 --- a/fs/xfs/libxfs/xfs_rmap_btree.c +++ b/fs/xfs/libxfs/xfs_rmap_btree.c @@ -578,6 +578,15 @@ xfs_rmapbt_calc_reserves( tree_len = be32_to_cpu(agf->agf_rmap_blocks); xfs_trans_brelse(tp, agbp); + /* + * 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; + /* Reserve 1% of the AG or enough for 1 block per record. */ *ask += max(agblocks / 100, xfs_rmapbt_max_size(mp, agblocks)); *used += tree_len;