summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2023-04-21 10:51:31 -0700
committerZorro Lang <zlang@kernel.org>2023-04-24 02:48:02 +0800
commitc7d81cdecbefd5768163a195e8d5257279216a34 (patch)
treeaad92e203c7c6f8d9be5db7f350c22ebee5c6851 /check
parentc63ce4a5eac8a4e1f0785e7eae45b16a3ad16b87 (diff)
check: try to fix the test device if it gets corrupted
If the test device gets corrupted all subsequent tests will fail. To prevent this from causing all subsequent tests to be useless, try repair the file system on TEST_DEV if possible. We don't need to do this with the scratch device since that file system gets recreated each time anyway. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'check')
-rwxr-xr-xcheck7
1 files changed, 6 insertions, 1 deletions
diff --git a/check b/check
index 1a58a2b2..befbf465 100755
--- a/check
+++ b/check
@@ -536,7 +536,12 @@ _check_filesystems()
local ret=0
if [ -f ${RESULT_DIR}/require_test ]; then
- _check_test_fs || ret=1
+ if ! _check_test_fs ; then
+ ret=1
+ echo "Trying to repair broken TEST_DEV file system"
+ _repair_test_fs
+ _test_mount
+ fi
rm -f ${RESULT_DIR}/require_test*
else
_test_unmount 2> /dev/null