From: Amir Goldstein <amir73il@gmail.com>
To: Eryu Guan <guaneryu@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>,
overlayfs <linux-unionfs@vger.kernel.org>,
fstests <fstests@vger.kernel.org>
Subject: Re: [PATCH 2/2] overlay: Test invalidate of readdir cache
Date: Thu, 22 Apr 2021 09:23:12 +0300 [thread overview]
Message-ID: <CAOQ4uxh2AQnyxqwLW9gcE818OdiP8yMsmeVmO2KjSESZ-fwBLA@mail.gmail.com> (raw)
In-Reply-To: <CAOQ4uxgX+mV+_AbF8Mc1fSPed37ezL_xONbx+BdqoQDKPsG7pw@mail.gmail.com>
On Wed, Apr 21, 2021 at 12:33 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Wed, Apr 21, 2021 at 12:23 PM Amir Goldstein <amir73il@gmail.com> 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@gmail.com>
> > ---
> > 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.
next prev parent reply other threads:[~2021-04-22 6:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 9:23 [PATCH 0/2] Test overlayfs readdir cache Amir Goldstein
2021-04-21 9:23 ` [PATCH 1/2] generic: Test readdir of modified directrory Amir Goldstein
2021-04-21 9:23 ` [PATCH 2/2] overlay: Test invalidate of readdir cache Amir Goldstein
2021-04-21 9:33 ` Amir Goldstein
2021-04-22 6:23 ` Amir Goldstein [this message]
2021-04-22 6:18 ` [PATCH 0/2] Test overlayfs " Amir Goldstein
2021-04-22 7:53 ` Miklos Szeredi
2021-04-22 8:47 ` Amir Goldstein
2021-04-22 9:03 ` Miklos Szeredi
2021-04-23 10:20 ` Amir Goldstein
2021-04-23 19:03 ` Amir Goldstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOQ4uxh2AQnyxqwLW9gcE818OdiP8yMsmeVmO2KjSESZ-fwBLA@mail.gmail.com \
--to=amir73il@gmail.com \
--cc=fstests@vger.kernel.org \
--cc=guaneryu@gmail.com \
--cc=linux-unionfs@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).