[PATCH 2/4] check: don't leave the scratch filesystem mounted after _notrun

Darrick J. Wong
2021-07-28T00:09:50Z

Unmount the scratch filesystem if a test decides to _notrun itself
because _try_wipe_scratch_devs will not be able to wipe the scratch
device prior to the next test run. We don't want to let scratch state
from one test leak into subsequent tests if we can help it.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
check | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/check b/check
index bb7e030c..5d71b74c 100755
--- a/check
+++ b/check
@@ -871,6 +871,11 @@ function run_section()
notrun="$notrun $seqnum"
n_notrun=`expr $n_notrun + 1`
tc_status="notrun"
+
+ # Unmount the scratch fs so that we can wipe the scratch
+ # dev state prior to the next test run.
+ _scratch_unmount 2> /dev/null
+ rm -f ${RESULT_DIR}/require_scratch*
continue;
fi