diff mbox series

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

Message ID 162743098874.3427426.3383033227839715899.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series fstests: random fixes | expand

Commit Message

Darrick J. Wong July 28, 2021, 12:09 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

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(+)

Comments

Eryu Guan Aug. 1, 2021, 1:02 p.m. UTC | #1
On Tue, Jul 27, 2021 at 05:09:48PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> 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*

I think _notrun has removed $RESULT_DIR/require_scratch* already, and we
could remove above line. I'll remove it on commit.

Thanks,
Eryu

>  			continue;
>  		fi
>
Darrick J. Wong Aug. 2, 2021, 10:13 p.m. UTC | #2
On Sun, Aug 01, 2021 at 09:02:13PM +0800, Eryu Guan wrote:
> On Tue, Jul 27, 2021 at 05:09:48PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > 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*
> 
> I think _notrun has removed $RESULT_DIR/require_scratch* already, and we
> could remove above line. I'll remove it on commit.

Ok, thanks!

--D

> 
> Thanks,
> Eryu
> 
> >  			continue;
> >  		fi
> >
diff mbox series

Patch

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