From bb88dce9eeb6966edc987f2b51aae3a2ad70c0b4 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 28 May 2024 21:13:20 -0700 Subject: [PATCH] xfs: add realtime refcount btree when adding rt volume If we're adding enough space to the realtime section to require the creation of new realtime groups, create the rt refcount btree inode before we start adding the space. Signed-off-by: Darrick J. Wong --- fs/xfs/xfs_rtalloc.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c index 4256f1730103..e8a1d52b1005 100644 --- a/fs/xfs/xfs_rtalloc.c +++ b/fs/xfs/xfs_rtalloc.c @@ -803,6 +803,12 @@ xfs_growfsrt_alloc_rtgroups( xfs_rtgroup_rele(rtg); return error; } + + error = xfs_rtginode_ensure(rtg, XFS_RTG_REFCOUNT); + if (error) { + xfs_rtgroup_rele(rtg); + return error; + } } return 0; @@ -1158,9 +1164,11 @@ xfs_growfs_rt( return -EINVAL; /* Unsupported realtime features. */ - if (!xfs_has_rtgroups(mp) && xfs_has_rmapbt(mp)) + if (!xfs_has_rtgroups(mp) && (xfs_has_rmapbt(mp) || xfs_has_reflink(mp))) + return -EOPNOTSUPP; + if (xfs_has_quota(mp)) return -EOPNOTSUPP; - if (xfs_has_reflink(mp) || xfs_has_quota(mp)) + if (xfs_has_reflink(mp) && in->extsize != 1) return -EOPNOTSUPP; error = xfs_sb_validate_fsb_count(&mp->m_sb, in->newblocks); -- 2.50.1