lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 29 Mar 2022 17:02:27 +0530
From:   Ritesh Harjani <ritesh.list@...il.com>
To:     "Darrick J. Wong" <djwong@...nel.org>
Cc:     Ritesh Harjani <riteshh@...ux.ibm.com>,
        fstests <fstests@...r.kernel.org>, linux-ext4@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCHv2 3/4] generic/676: Add a new shutdown recovery test

On 22/03/15 09:55AM, Darrick J. Wong wrote:
> On Tue, Mar 15, 2022 at 07:58:58PM +0530, Ritesh Harjani wrote:
> > In certain cases (it is noted with ext4 fast_commit feature) that, replay phase
> > may not delete the right range of blocks (after sudden FS shutdown)
> > due to some operations which depends on inode->i_size (which during replay of
> > an inode with fast_commit could be 0 for sometime).
> > This fstest is added to test for such scenarios for all generic fs.
> >
> > This test case is based on the test case shared via Xin Yin.
> >
> > Signed-off-by: Ritesh Harjani <riteshh@...ux.ibm.com>
> > ---
> >  tests/generic/676     | 72 +++++++++++++++++++++++++++++++++++++++++++
> >  tests/generic/676.out |  7 +++++
> >  2 files changed, 79 insertions(+)
> >  create mode 100755 tests/generic/676
> >  create mode 100644 tests/generic/676.out
> >
> > diff --git a/tests/generic/676 b/tests/generic/676
> > new file mode 100755
> > index 00000000..315edcdf
> > --- /dev/null
> > +++ b/tests/generic/676
> > @@ -0,0 +1,72 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (c) 2022 IBM Corporation.  All Rights Reserved.
> > +#
> > +# FS QA Test 676
> > +#
> > +# This test with ext4 fast_commit feature w/o below patch missed to delete the right
> > +# range during replay phase, since it depends upon inode->i_size (which might not be
> > +# stable during replay phase, at least for ext4).
> > +# 0b5b5a62b945a141: ext4: use ext4_ext_remove_space() for fast commit replay delete range
> > +# (Based on test case shared by Xin Yin <yinxin.x@...edance.com>)
> > +#
> > +
> > +. ./common/preamble
> > +_begin_fstest auto shutdown quick log recoveryloop
>
> This isn't a looping recovery test.  Maybe we should create a 'recovery'
> group for tests that only run once?  I think we already have a few
> fstests like that.

I gave it a thought, but I feel it might be unncessary.
>From a developer/tester perspective who wanted to test anything related to
recovery would then have to use both recovery and recoveryloop.
Thoughts?

>
> > +
> > +# Override the default cleanup function.
> > +_cleanup()
> > +{
> > +	cd /
> > +	rm -r -f $tmp.*
> > +   _scratch_unmount > /dev/null 2>&1
>
> I think the test harness does this for you already, right?

Although, it looks like after running the test by default the run_section() in
check script, will do _test_unmount and _scratch_unmount.
But I still feel it's better if the individual test cleans up whatever it did
while running the test in it's cleanup routine, before exiting.

>
> > +}
> > +
> > +# Import common functions.
> > +. ./common/filter
> > +. ./common/punch
> > +
> > +# real QA test starts here
> > +
> > +# Modify as appropriate.
> > +_supported_fs generic
> > +_require_scratch
> > +_require_xfs_io_command "fpunch"
> > +_require_xfs_io_command "fzero"
> > +_require_xfs_io_command "fiemap"
>
> _require_scratch_shutdown
>
> > +
> > +t1=$SCRATCH_MNT/foo
> > +t2=$SCRATCH_MNT/bar
> > +
> > +_scratch_mkfs > $seqres.full 2>&1
> > +
> > +_scratch_mount >> $seqres.full 2>&1
> > +
> > +bs=$(_get_block_size $SCRATCH_MNT)
>
> _get_file_block_size, in case the file allocation unit isn't the same as
> the fs blocksize?  (e.g. bigalloc, xfs realtime, etc.)

Sure. Agreed. Will make the change.

Thanks
-ritesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ