2022-08-05 16:29:39

by Chuck Lever III

[permalink] [raw]
Subject: [PATCH 1/2] DELEG6: Return delegations so clean_diff() works

WARNING: could not clean testdir due to:
Making sure b'DELEG6-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY

Signed-off-by: Chuck Lever <[email protected]>
---
nfs4.0/servertests/st_delegation.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/nfs4.0/servertests/st_delegation.py b/nfs4.0/servertests/st_delegation.py
index 875dbc94ded1..ff042cdb69a8 100644
--- a/nfs4.0/servertests/st_delegation.py
+++ b/nfs4.0/servertests/st_delegation.py
@@ -285,7 +285,7 @@ def testRenew(t, env, funct=None, response=NFS4_OK):
c = env.c1
c.init_connection(b'pynfs%i_%s' % (os.getpid(), t.word()), cb_ident=0)
lease = c.getLeaseTime()
- _get_deleg(t, c, c.homedir + [t.word()], funct, response)
+ deleg_info, fh, stateid = _get_deleg(t, c, c.homedir + [t.word()], funct, response)
c2 = env.c2
c2.init_connection()
try:
@@ -302,6 +302,10 @@ def testRenew(t, env, funct=None, response=NFS4_OK):
break
finally:
c.cb_command(1) # Turn on callback server
+ res = c.compound([op.putfh(fh), op.delegreturn(deleg_info.read.stateid)])
+ check(res)
+ res = c.close_file(t.word(), fh, stateid)
+ check(res)
if not noticed:
t.fail("RENEWs should not have all returned OK")




2022-08-05 16:30:32

by Chuck Lever III

[permalink] [raw]
Subject: [PATCH 2/2] DELEG21: Return delegations so clean_diff() works

WARNING: could not clean testdir due to:
Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY

Signed-off-by: Chuck Lever <[email protected]>
---
nfs4.0/servertests/st_delegation.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/nfs4.0/servertests/st_delegation.py b/nfs4.0/servertests/st_delegation.py
index ff042cdb69a8..9c98ec0e0fb3 100644
--- a/nfs4.0/servertests/st_delegation.py
+++ b/nfs4.0/servertests/st_delegation.py
@@ -731,7 +731,7 @@ def testServerSelfConflict(t, env):
c = env.c1
count = c.cb_server.opcounts[OP_CB_RECALL]
c.init_connection(b'pynfs%i_%s' % (os.getpid(), t.word()), cb_ident=0)
- _get_deleg(t, c, c.homedir + [t.word()], None, NFS4_OK)
+ deleg_info, fh, stateid = _get_deleg(t, c, c.homedir + [t.word()], None, NFS4_OK)

sleeptime = 1
while 1:
@@ -746,6 +746,10 @@ def testServerSelfConflict(t, env):
check(res, [NFS4_OK, NFS4ERR_DELAY], "Open which causes recall")
env.sleep(sleeptime, 'Got NFS4ERR_DELAY on open')
c.confirm(b'newowner', res)
+ res = c.compound([op.putfh(fh), op.delegreturn(deleg_info.read.stateid)])
+ check(res)
+ res = c.close_file(t.word(), fh, stateid)
+ check(res)
newcount = c.cb_server.opcounts[OP_CB_RECALL]
if newcount > count:
t.fail("Unnecessary delegation recall")


2022-08-07 20:27:55

by J. Bruce Fields

[permalink] [raw]
Subject: Re: [PATCH 2/2] DELEG21: Return delegations so clean_diff() works

On Fri, Aug 05, 2022 at 12:12:26PM -0400, Chuck Lever wrote:
> WARNING: could not clean testdir due to:
> Making sure b'DELEG21-1' is writable: operation OP_SETATTR should return NFS4_OK, instead got NFS4ERR_DELAY

Thanks, both applied.--b.

>
> Signed-off-by: Chuck Lever <[email protected]>
> ---
> nfs4.0/servertests/st_delegation.py | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/nfs4.0/servertests/st_delegation.py b/nfs4.0/servertests/st_delegation.py
> index ff042cdb69a8..9c98ec0e0fb3 100644
> --- a/nfs4.0/servertests/st_delegation.py
> +++ b/nfs4.0/servertests/st_delegation.py
> @@ -731,7 +731,7 @@ def testServerSelfConflict(t, env):
> c = env.c1
> count = c.cb_server.opcounts[OP_CB_RECALL]
> c.init_connection(b'pynfs%i_%s' % (os.getpid(), t.word()), cb_ident=0)
> - _get_deleg(t, c, c.homedir + [t.word()], None, NFS4_OK)
> + deleg_info, fh, stateid = _get_deleg(t, c, c.homedir + [t.word()], None, NFS4_OK)
>
> sleeptime = 1
> while 1:
> @@ -746,6 +746,10 @@ def testServerSelfConflict(t, env):
> check(res, [NFS4_OK, NFS4ERR_DELAY], "Open which causes recall")
> env.sleep(sleeptime, 'Got NFS4ERR_DELAY on open')
> c.confirm(b'newowner', res)
> + res = c.compound([op.putfh(fh), op.delegreturn(deleg_info.read.stateid)])
> + check(res)
> + res = c.close_file(t.word(), fh, stateid)
> + check(res)
> newcount = c.cb_server.opcounts[OP_CB_RECALL]
> if newcount > count:
> t.fail("Unnecessary delegation recall")
>