diff mbox series

[04/17] xfs: use metadump v2 format by default

Message ID 170405030390.1826350.13961921287983856419.stgit@frogsfrogsfrogs (mailing list archive)
State New, 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:53 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Create metadump v2 files by default.

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

Patch

diff --git a/common/xfs b/common/xfs
index 77ba786ece..4e8630b3ab 100644
--- a/common/xfs
+++ b/common/xfs
@@ -669,6 +669,14 @@  _xfs_metadump() {
 	local options="$@"
 	test -z "$options" && options="-a -o"
 
+	# Use metadump v2 format unless the user gave us a specific version
+	$XFS_METADUMP_PROG --help 2>&1 | grep -q -- '-v version' && \
+			metadump_has_v2=1
+
+	if ! echo "$options" | grep -q -- '-v' && [ -n "$metadump_has_v2" ]; then
+		options="$options -v 2"
+	fi
+
 	if [ "$logdev" != "none" ]; then
 		options="$options -l $logdev"
 	fi