From 078bb0de7c2109b5fa54e567d82b82d6d3d75a59 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 6 Jun 2023 15:29:28 -0700 Subject: fuzzy: disallow post-test online rebuilds when testing online fsck If we're testing the online fsck code or running fuzz tests of the filesystem, don't let the post-test checks rebuild the filesystem metadata, because this is redundant with the test and will disturb the metadata if the tools fail. Signed-off-by: Darrick J. Wong Reviewed-by: Andrey Albershteyn Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- common/xfs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'common/xfs') diff --git a/common/xfs b/common/xfs index 137ac9db..d85acd95 100644 --- a/common/xfs +++ b/common/xfs @@ -721,6 +721,16 @@ _scratch_xfs_mdrestore() _xfs_mdrestore "$metadump" "$SCRATCH_DEV" "$@" } +# Do not use xfs_repair (offline fsck) to rebuild the filesystem +_xfs_skip_offline_rebuild() { + touch "$RESULT_DIR/.skip_rebuild" +} + +# Do not use xfs_scrub (online fsck) to rebuild the filesystem +_xfs_skip_online_rebuild() { + touch "$RESULT_DIR/.skip_orebuild" +} + # run xfs_check and friends on a FS. _check_xfs_filesystem() { @@ -849,7 +859,7 @@ _check_xfs_filesystem() fi # Optionally test the index rebuilding behavior. - if [ -n "$TEST_XFS_REPAIR_REBUILD" ]; then + if [ -n "$TEST_XFS_REPAIR_REBUILD" ] && [ ! -e "$RESULT_DIR/.skip_rebuild" ]; then rebuild_ok=1 $XFS_REPAIR_PROG $extra_options $extra_log_options $extra_rt_options $device >$tmp.repair 2>&1 if [ $? -ne 0 ]; then -- cgit v1.2.3