From ca2a19bff3b8779ec14959c3bc8deb38d8726255 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Thu, 20 Feb 2025 13:47:06 -0800 Subject: [PATCH] common/populate: use metadump v2 format by default for fs metadata snapshots When we're snapshotting filesystem metadata after creating a populated filesystem, force the creation of metadump v2 files by default to exercise the new format, since xfs_metadump continues to use the v1 format unless told otherwise. Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig Signed-off-by: Zorro Lang --- common/populate | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/common/populate b/common/populate index 32dc5275e..9fc1ee32b 100644 --- a/common/populate +++ b/common/populate @@ -55,7 +55,12 @@ __populate_fail() { case "$FSTYP" in xfs) _scratch_unmount - _scratch_xfs_metadump "$metadump" -a -o + + mdargs=('-a' '-o') + test "$(_xfs_metadump_max_version)" -gt 1 && \ + mdargs+=('-v' '2') + + _scratch_xfs_metadump "$metadump" "${mdargs[@]}" ;; ext4) _scratch_unmount @@ -1056,8 +1061,12 @@ _scratch_populate_save_metadump() [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \ logdev=$SCRATCH_LOGDEV + mdargs=('-a' '-o') + test "$(_xfs_metadump_max_version)" -gt 1 && \ + mdargs+=('-v' '2') + _xfs_metadump "$metadump_file" "$SCRATCH_DEV" "$logdev" \ - compress -a -o + compress "${mdargs[@]}" res=$? ;; "ext2"|"ext3"|"ext4") -- 2.50.1