X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=fs%2Fxfs%2Flibxfs%2Fxfs_ialloc_btree.c;h=bc2dfacd2f4a01c83864361862442ab63c4a73b2;hb=5cd213b0fec640a46adc5e6e4dfc7763aa54b3b2;hp=1080381ff243e68ee3b6c89fef1e2e78341d8994;hpb=249acb5f47df27109d74a0d904a5da56c8bac28f;p=linux.git diff --git a/fs/xfs/libxfs/xfs_ialloc_btree.c b/fs/xfs/libxfs/xfs_ialloc_btree.c index 1080381ff243..bc2dfacd2f4a 100644 --- a/fs/xfs/libxfs/xfs_ialloc_btree.c +++ b/fs/xfs/libxfs/xfs_ialloc_btree.c @@ -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);