Re: [PATCH 4/4] check: check and fix the test filesystem after failed tests

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Fri, May 23, 2025 at 09:39:00PM +0800, Zorro Lang wrote:
> On Thu, May 22, 2025 at 10:14:08PM -0700, Christoph Hellwig wrote:
> > On Wed, May 21, 2025 at 03:42:54PM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@xxxxxxxxxx>
> > > 
> > > 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@xxxxxxxxxxxxxxx> # v2023.05.01
> > > Fixes: 4a444bc19a836f ("check: _check_filesystems for errors even if test failed")
> > > Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
> > > ---
> > >  check |    7 ++++++-
> > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > 
> > > diff --git a/check b/check
> > > index 826641268f8b52..818ce44da28f65 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"
> > 
> > Maybe break the line after the || to improve readability?
> 
> If you mean this:
> 	(_adjust_oom_score 250; _check_filesystems) || \
> 		tc_status="fail"
> 
> I'll help that when I merge it.

Hmm... I just found there's another line write as:

  (_adjust_oom_score 250; _check_filesystems) || tc_status="fail"

nearby above patch. So I think we change both or keep consistency temporarily:)

Thanks,
Zorro


> 
> Thanks,
> Zorro
> 
> > 
> > Otherwise looks good:
> > 
> > Reviewed-by: Christoph Hellwig <hch@xxxxxx>
> > 
> > 





[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux