Re: [PATCH 2/2] overlay: Test invalidate of readdir cache

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

 



On Wed, Apr 21, 2021 at 12:33 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> On Wed, Apr 21, 2021 at 12:23 PM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
> >
> > This is a regression test for kernel commit 65cd913ec9d9
> > ("ovl: invalidate readdir cache on changes to dir with origin")
> >
> > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
> > ---
> >  tests/overlay/077     | 105 ++++++++++++++++++++++++++++++++++++++++++
> >  tests/overlay/077.out |   2 +
> >  tests/overlay/group   |   1 +
> >  3 files changed, 108 insertions(+)
> >  create mode 100755 tests/overlay/077
> >  create mode 100644 tests/overlay/077.out
> >
> > diff --git a/tests/overlay/077 b/tests/overlay/077
> > new file mode 100755
> > index 00000000..e254aec1
> > --- /dev/null
> > +++ b/tests/overlay/077
> > @@ -0,0 +1,105 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (C) 2021 CTERA Networks. All Rights Reserved.
> > +#
> > +# FS QA Test 077
> > +#
> > +# Test invalidate of readdir cache
> > +#
> > +# This is a regression test for kernel commit 65cd913ec9d9
> > +# ("ovl: invalidate readdir cache on changes to dir with origin")
> > +#
> > +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.*
> > +}
> > +
> > +# create test directory and test file, mount overlayfs and remove
> > +# testfile to create a whiteout in upper dir.
> > +create_whiteout()
> > +{
> > +       local lower=$1
> > +       local upper=$2
> > +       local work=$3
> > +       local file=$4
> > +
> > +       mkdir -p $lower/testdir
> > +       touch $lower/testdir/$file
> > +
> > +       _overlay_scratch_mount_dirs $lower $upper $work
> > +
> > +       rm -f $SCRATCH_MNT/testdir/$file
> > +
> > +       $UMOUNT_PROG $SCRATCH_MNT
> > +}
> > +
>
> Oops. Unused leftover.
> A former merge dir does not need to actually have whiteouts for this test...
>

But it would be better for test coverage if the merge dir had copied up
files on first readdir (making it "impure").

And I will also add the "upper impure" test case in V2 posting.

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