diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-06-06 15:29:28 -0700 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2023-06-10 15:35:59 +0800 |
commit | 078bb0de7c2109b5fa54e567d82b82d6d3d75a59 (patch) | |
tree | 930af2b4561aabf4658f7dac4c1860152c614de4 /common/xfs | |
parent | eef60725c85068630c2375868a3426898392c5b8 (diff) |
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 <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common/xfs')
-rw-r--r-- | common/xfs | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 |