Re: [PATCH v2] overlay/072: test for whiteout inode sharing

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

 



On Tue, Apr 14, 2020 at 7:25 AM Chengguang Xu <cgxu519@xxxxxxxxxxxx> wrote:
>
>  ---- 在 星期二, 2020-04-14 11:22:26 Amir Goldstein <amir73il@xxxxxxxxx> 撰写 ----
>  > On Tue, Apr 14, 2020 at 5:31 AM Chengguang Xu <cgxu519@xxxxxxxxxxxx> wrote:
>  > >
>  > > This is a test for whiteout inode sharing feature.
>  > >
>  > > Signed-off-by: Chengguang Xu <cgxu519@xxxxxxxxxxxx>
>  > > ---
>  > > v1->v2:
>  > > - Address Amir's comments in v1.
>  >
>  > Looks good. Some nits.
>  > With those fixed you may add:
>  > Reviewed-by: Amir Goldstein <amir73il@xxxxxxxxx>
>  >
>  >
>  > >
>  > >  common/module         |   9 +++
>  > >  tests/overlay/072     | 148 ++++++++++++++++++++++++++++++++++++++++++
>  > >  tests/overlay/072.out |   2 +
>  > >  tests/overlay/group   |   1 +
>  > >  4 files changed, 160 insertions(+)
>  > >  create mode 100755 tests/overlay/072
>  > >  create mode 100644 tests/overlay/072.out
>  > >
>  > > diff --git a/common/module b/common/module
>  > > index 39e4e793..148e8c8f 100644
>  > > --- a/common/module
>  > > +++ b/common/module
>  > > @@ -81,3 +81,12 @@ _get_fs_module_param()
>  > >  {
>  > >         cat /sys/module/${FSTYP}/parameters/${1} 2>/dev/null
>  > >  }
>  > > + # Set the value of a filesystem module parameter
>  > > + # at /sys/module/$FSTYP/parameters/$PARAM
>  > > + #
>  > > + # Usage example:
>  > > + #   _set_fs_module_param param value
>  > > + _set_fs_module_param()
>  > > +{
>  > > +       echo ${2} > /sys/module/${FSTYP}/parameters/${1} 2>/dev/null
>  > > +}
>  > > diff --git a/tests/overlay/072 b/tests/overlay/072
>  > > new file mode 100755
>  > > index 00000000..e1244394
>  > > --- /dev/null
>  > > +++ b/tests/overlay/072
>  > > @@ -0,0 +1,148 @@
>  > > +#! /bin/bash
>  > > +# SPDX-License-Identifier: GPL-2.0
>  > > +# Copyright (c) 2020 Chengguang Xu <cgxu519@xxxxxxxxxxxx>.
>  > > +# All Rights Reserved.
>  > > +#
>  > > +# FS QA Test 072
>  > > +#
>  > > +# This is a test for whiteout inode sharing feature.
>  > > +#
>  > > +seq=`basename $0`
>  > > +seqres=$RESULT_DIR/$seq
>  > > +echo "QA output created by $seq"
>  > > +
>  > > +here=`pwd`
>  > > +tmp=/tmp/$
>  > > +status=1       # failure is the default!
>  > > +trap "_cleanup; exit \$status" 0 1 2 3 15
>  > > +
>  > > +_cleanup()
>  > > +{
>  > > +       cd /
>  > > +       rm -f $tmp.*
>  > > +       _set_fs_module_param $param_name $orig_param_value
>  >
>  > verify orig_param_value is not empty
>  >
>
> I think if orig_param_value is empty, then test will be "not run" therefore _cleanup() will not be called.
>

_cleanup() is called also on exit 0 so also in case of _notrun

Thanks,
Amir.




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

  Powered by Linux