summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2020-02-19 17:02:49 -0800
committerDarrick J. Wong <darrick.wong@oracle.com>2020-03-03 18:47:52 -0800
commitfcd915e37a25e7453b7d073f5e77933b0b4625ae (patch)
treeeb346e3a9911c05bb76df864cfa0cb9b8f6701a4 /fs
parent6adc1ab94d8aa9997a76d3834b2bb5df2eaf4987 (diff)
xfs: realtime rmap btree transaction reservations
Make sure that there's enough log reservation to handle mapping and unmapping realtime extents. We have to reserve enough space to handle a split in the rtrmapbt to add the record and a second split in the regular rmapbt to record the rtrmapbt split. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/libxfs/xfs_trans_resv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_trans_resv.c b/fs/xfs/libxfs/xfs_trans_resv.c
index dad9bf11ad20..47138b216fc5 100644
--- a/fs/xfs/libxfs/xfs_trans_resv.c
+++ b/fs/xfs/libxfs/xfs_trans_resv.c
@@ -72,7 +72,8 @@ xfs_allocfree_log_count(
blocks = num_ops * 2 * (2 * mp->m_ag_maxlevels - 1);
if (xfs_sb_version_hasrmapbt(&mp->m_sb))
- blocks += num_ops * (2 * mp->m_rmap_maxlevels - 1);
+ blocks += max(num_ops * (2 * mp->m_rmap_maxlevels - 1),
+ num_ops * (2 * mp->m_rtrmap_maxlevels - 1));
if (xfs_sb_version_hasreflink(&mp->m_sb))
blocks += num_ops * (2 * mp->m_refc_maxlevels - 1);