check: don't leave the scratch filesystem mounted after _notrun
authorDarrick J. Wong <djwong@kernel.org>
Wed, 28 Jul 2021 00:09:48 +0000 (17:09 -0700)
committerEryu Guan <guaneryu@gmail.com>
Sun, 1 Aug 2021 13:05:27 +0000 (21:05 +0800)
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>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
check

diff --git a/check b/check
index bb7e030..242cb8c 100755 (executable)
--- a/check
+++ b/check
@@ -871,6 +871,10 @@ 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
                        continue;
                fi