diff mbox series

[05/12] common: filter rtgroups when we're disabling metadir

Message ID 167243884013.739029.9709263667215231940.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series xfsprogs: shard the realtime section | expand

Commit Message

Darrick J. Wong Dec. 30, 2022, 10:20 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

If we're forcing a filesystem to be created without the metadir feature,
we should forcibly disable rtgroups as well.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/xfs |    4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/common/xfs b/common/xfs
index 0d1e0ec4bc..ccdcf45d0d 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1821,6 +1821,10 @@  _scratch_xfs_find_metafile()
 # Force metadata directories off.
 _scratch_xfs_force_no_metadir()
 {
+	if echo "$MKFS_OPTIONS" | grep -q 'rtgroups='; then
+		MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | sed -e 's/rtgroups=\([01]\)/rtgroups=0/g')"
+	fi
+
 	if echo "$MKFS_OPTIONS" | grep -q 'metadir='; then
 		MKFS_OPTIONS="$(echo "$MKFS_OPTIONS" | sed -e 's/metadir=\([01]\)/metadir=0/g')"
 		return