From: Darrick J. Wong Date: Wed, 21 May 2025 22:42:54 +0000 (-0700) Subject: check: check and fix the test filesystem after failed tests X-Git-Tag: v2025.05.25~11 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=68fa350e1e776b6179cda4847c9f68070d2251c9;p=xfstests-dev.git check: check and fix the test filesystem after failed tests 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 Reviewed-by: Christoph Hellwig Signed-off-by: Zorro Lang --- diff --git a/check b/check index 82664126..818ce44d 100755 --- a/check +++ b/check @@ -986,8 +986,13 @@ function run_section() _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