Currently, ./check calls _check_filesystems after a test passes to make
sure that the test and scratch filesystems are ok, and repairs the test
filesystem if it's not ok.
However, we don't do this for failed tests. If a test fails /and/
corrupts the test filesystem, every subsequent passing test will be
marked as a failure because of latent corruptions on the test
filesystem.
This is a little silly, so let's call _check_filesystems on the test
filesystem after a test fail so that the badness doesn't spread.
Cc: fstests@vger.kernel.org # v2023.05.01
Fixes: 4a444bc19a836f ("check: _check_filesystems for errors even if test failed")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
_dump_err_cont "[failed, exit status $sts]"
_test_unmount 2> /dev/null
_scratch_unmount 2> /dev/null
- rm -f ${RESULT_DIR}/require_test*
rm -f ${RESULT_DIR}/require_scratch*
+
+ # Make sure the test filesystem is ready to go since
+ # we don't call _check_filesystems for failed tests
+ (_adjust_oom_score 250; _check_filesystems) || tc_status="fail"
+
+ rm -f ${RESULT_DIR}/require_test*
# Even though we failed, there may be something interesting in
# dmesg which can help debugging.
_check_dmesg