diff mbox series

[10/17] common: filter rtgroups when we're disabling metadir

Message ID 170405030468.1826350.14174130190423885732.stgit@frogsfrogsfrogs (mailing list archive)
State Deferred, archived
Headers show
Series [01/17] common/populate: refactor caching of metadumps to a helper | expand

Commit Message

Darrick J. Wong Dec. 27, 2023, 1:55 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 aa1c23dd54..e66e11f15d 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1936,6 +1936,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