summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAnthony Iliopoulos <ailiop@suse.com>2023-05-22 23:27:12 +0200
committerZorro Lang <zlang@kernel.org>2023-05-28 02:14:03 +0800
commit596db5ee91823292e64c842c64010571a3d6ca74 (patch)
treecd6530187c3bec2d63cc156df93cf8f7cbd03179 /common
parent6dfe7b6b9033daf6b5dab95ad50531966bf41cbf (diff)
fuzzy: skip online scrub and health checks if not supportedv2023.05.28
Commit a27e6e6f4c18 introduced xfs health checking on no-repair fuzz, which in turn requires scrub to be run before that. The health checks are done only if scrub returns with an error (which is expected as an indication that fuzzed metadata errors were picked up), but the code does not discern between xfs_scrub returning an error because of uncorrected metadata vs failing because the kernel does not support scrub at all. This causes all tests that do fuzzing with no-repair strategy to fail on kernels compiled without online scrub support (CONFIG_XFS_ONLINE_SCRUB). Skip scrub and health checks altogether, if the kernel does not support it, since the tests are still valuable. Fixes: a27e6e6f4c18 ("common: check xfs health after doing an online scrub") Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> Reviewed-by: Zorro Lang <zlang@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/fuzzy6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/fuzzy b/common/fuzzy
index 4365e734..a78a3541 100644
--- a/common/fuzzy
+++ b/common/fuzzy
@@ -422,6 +422,12 @@ __scratch_xfs_fuzz_field_norepair() {
return 1
fi
+ # Skip scrub and health check if scrub is not supported
+ if ! _supports_xfs_scrub $SCRATCH_MNT $SCRATCH_DEV; then
+ __scratch_xfs_fuzz_unmount
+ return 0
+ fi
+
# Make sure online scrub will catch whatever we fuzzed
__fuzz_notify "++ Detect fuzzed field (online)"
_scratch_scrub -n -a 1 -e continue 2>&1