diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-23 11:18:18 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-23 11:18:18 -0700 |
commit | 4dde821e4296e156d133b98ddc4c45861935a4fb (patch) | |
tree | 6c1601afc9ff484f92c8822afb7f2a607e118b11 /fs/xfs/libxfs/xfs_refcount_btree.c | |
parent | 61686afe1ff378021da4e5509d081fb5196212d5 (diff) | |
parent | 5cd213b0fec640a46adc5e6e4dfc7763aa54b3b2 (diff) |
Merge tag 'xfs-5.2-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Pull xfs fix from Darrick Wong:
"Fix an accounting mistake where we included the log space when
calculating the reserve space for metadata expansion"
* tag 'xfs-5.2-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: don't reserve per-AG space for an internal log
Diffstat (limited to 'fs/xfs/libxfs/xfs_refcount_btree.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_refcount_btree.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_refcount_btree.c b/fs/xfs/libxfs/xfs_refcount_btree.c index 6f47ab876d90..5d9de9b21726 100644 --- a/fs/xfs/libxfs/xfs_refcount_btree.c +++ b/fs/xfs/libxfs/xfs_refcount_btree.c @@ -427,6 +427,15 @@ xfs_refcountbt_calc_reserves( tree_len = be32_to_cpu(agf->agf_refcount_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; + *ask += xfs_refcountbt_max_size(mp, agblocks); *used += tree_len; |