When fuzzing a filesystem and using the offline repair strategy, compare
the outputs of xfs_check against xfs_repair to ensure that the newer
xfs_repair catches at least as many things as xfs_check does.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
test $res -eq 0 && \
(>&2 echo "${fuzz_action}: offline scrub didn't fail.")
+ # Make sure xfs_repair catches at least as many things as the old
+ # xfs_check did.
+ if [ -n "${SCRATCH_XFS_FUZZ_CHECK}" ]; then
+ __fuzz_notify "+ Detect fuzzed field (xfs_check)"
+ _scratch_xfs_check 2>&1
+ res1=$?
+ if [ $res1 -ne 0 ] && [ $res -eq 0 ]; then
+ (>&2 echo "${fuzz_action}: xfs_repair passed but xfs_check failed ($res1).")
+ fi
+ fi
+
# Repair the filesystem offline
__fuzz_notify "+ Try to repair the filesystem (offline)"
_repair_scratch_fs -P 2>&1