2020-06-01 15:15:40

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [About] about nfscache problem

On Thu, May 28, 2020 at 07:18:31AM +0000, Su, Yanjun wrote:
> Hi Bruce
>
> >On Mon, Apr 20, 2020 at 08:13:51AM +0000, Su, Yanjun wrote:
> >> At this time, the nfscache problem has not progressed for long time. Do we still need to follow it?
> >>
> >> The problem is as below
> >> The test commandline is as below:
> >> ./nfstest_cache --nfsversion=4 -e /nfsroot --server 192.168.102.143
> >> --client 192.168.102.142 --runtest acregmax_data --verbose all
> >>
> >> More detail info is here:
> >> https://linuxlists.cc/l/17/linux-nfs/t/3063683/(patch)_cache:_fix_test_script_as_delegation_being_introduced
> >>
> >> This patch adds compatible code for nfsv3 and nfsv4.
> >> When we test nfsv4, just use 'chmod' to recall delegation, then
> >> run the test. As 'chmod' will modify atime, so use 'noatime' mount option.
> >>
> >> After a discusion with you, a chmod is a reliable way to recall delegations.
> >>
> >> Can you contact mora and make a decision for it?
>
> >I don't have any better way to contact him than the address cc'd above.
>
> >Remind me what the problem is? How is the test failing?
>
> When we run nfstest_cache with nfsversion=4, it fails.
> As i know nfsv4 introduces delegation, so nfstest_cache runs fail since
> nfsv4.
>
> The test commandline is as below:
> ./nfstest_cache --nfsversion=4 -e /nfsroot --server 192.168.102.143
> --client 192.168.102.142 --runtest acregmax_data --verbose all
>
> This patch adds compatible code for nfsv3 and nfsv4.
> When we test nfsv4, just use 'chmod' to recall delegation, then
> run the test. As 'chmod' will modify atime, so use 'noatime' mount option.

So, you patch nfstest as below, then run the test, and the test fails?

--b.

>
> Signed-off-by: Su Yanjun <[email protected]><mailto:%[email protected]%3E>
> ---
> test/nfstest_cache | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/test/nfstest_cache b/test/nfstest_cache
> index 0838418..a31d48f 100755
> --- a/test/nfstest_cache
> +++ b/test/nfstest_cache
> @@ -165,8 +165,13 @@ class CacheTest(TestUtil):
> fd = None
> attr = 'data' if data_cache else 'attribute'
> header = "Verify consistency of %s caching with %s on a file" % (attr,
> self.nfsstr())
> +
> # Mount options
> - mtopts = "hard,intr,rsize=4096,wsize=4096"
> + if self.nfsversion >= 4:
> + mtopts = "noatime,hard,intr,rsize=4096,wsize=4096"
> + else: + mtopts = "hard,intr,rsize=4096,wsize=4096"
> +
> if actimeo:
> header += " actimeo = %d" % actimeo
> mtopts += ",actimeo=%d" % actimeo
> @@ -216,6 +221,11 @@ class CacheTest(TestUtil):
> if fstat.st_size != dlen:
> raise Exception("Size of newly created file is %d, should have been %d"
> %(fstat.st_size, dlen))
> + if self.nfsversion >= 4:
> + # revoke delegation
> + self.dprint('DBG3', "revoke delegation")
> + self.clientobj.run_cmd('chmod +x %s' % self.absfile)
> +
> if acregmax:
> # Stat the unchanging file until acregmax is hit
> # each stat doubles the valid cache time
>
>


2020-06-02 20:01:26

by J. Bruce Fields

[permalink] [raw]
Subject: Re: Re: [About] about nfscache problem

On Tue, Jun 02, 2020 at 12:50:43AM +0000, Su, Yanjun wrote:
> >On Thu, May 28, 2020 at 07:18:31AM +0000, Su, Yanjun wrote:
> >> This patch adds compatible code for nfsv3 and nfsv4.
>
> >> When we test nfsv4, just use 'chmod' to recall delegation, then
>
> >> run the test. As 'chmod' will modify atime, so use 'noatime' mount option.
>
> >So, you patch nfstest as below, then run the test, and the test fails?
>
> It tests ok when appling the patch.

So you're just asking that this patch be applied to nfstest?

Sorry, I don't think I can help.

--b.

> > Signed-off-by: Su Yanjun <suyj.fnst@xxxxxxxxxxxxxx><mailto:%3Csuyj.fnst@xxxxxxxxxxxxxx%3E>
>
> > ---
>
> > test/nfstest_cache | 12 +++++++++++-
>
> > 1 file changed, 11 insertions(+), 1 deletion(-)
>
> >
>
> > diff --git a/test/nfstest_cache b/test/nfstest_cache
>
> > index 0838418..a31d48f 100755
>
> > --- a/test/nfstest_cache
>
> > +++ b/test/nfstest_cache
>
> > @@ -165,8 +165,13 @@ class CacheTest(TestUtil):
>
> > fd = None
>
> > attr = 'data' if data_cache else 'attribute'
>
> > header = "Verify consistency of %s caching with %s on a file" % (attr,
>
> > self.nfsstr())
>
> > +
>
> > # Mount options
>
> > - mtopts = "hard,intr,rsize=4096,wsize=4096"
>
> > + if self.nfsversion >= 4:
>
> > + mtopts = "noatime,hard,intr,rsize=4096,wsize=4096"
>
> > + else: + mtopts = "hard,intr,rsize=4096,wsize=4096"
>
> > +
>
> > if actimeo:
>
> > header += " actimeo = %d" % actimeo
>
> > mtopts += ",actimeo=%d" % actimeo
>
> > @@ -216,6 +221,11 @@ class CacheTest(TestUtil):
>
> > if fstat.st_size != dlen:
>
> > raise Exception("Size of newly created file is %d, should have been %d"
>
> > %(fstat.st_size, dlen))
>
> > + if self.nfsversion >= 4:
>
> > + # revoke delegation
>
> > + self.dprint('DBG3', "revoke delegation")
>
> > + self.clientobj.run_cmd('chmod +x %s' % self.absfile)
>
> > +
>
> > if acregmax:
>
> > # Stat the unchanging file until acregmax is hit
>
> > # each stat doubles the valid cache time
>
> >
>
> >
>
>
>