linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [pynfs PATCH 0/3] a few fixes
@ 2019-03-11 15:49 Scott Mayhew
  2019-03-11 15:49 ` [pynfs PATCH 1/3] nfs4.1: don't cache sessionids and clientids after destroying Scott Mayhew
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Scott Mayhew @ 2019-03-11 15:49 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

The first patch fixes bogus DESTROY_SESSION and DESTROY_CLIENTID ops
being sent to the server.  The other two prevent session and client
records from hanging around on the server.

Scott Mayhew (3):
  nfs4.1: don't cache sessionids and clientids after destroying
  nfs4.1: clean up the session and client created in
    Environment.finish()
  nfs4.1: close the file created in SEQ10b

 nfs4.1/server41tests/environment.py | 4 ++++
 nfs4.1/server41tests/st_sequence.py | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

-- 
2.17.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [pynfs PATCH 1/3] nfs4.1: don't cache sessionids and clientids after destroying
  2019-03-11 15:49 [pynfs PATCH 0/3] a few fixes Scott Mayhew
@ 2019-03-11 15:49 ` Scott Mayhew
  2019-03-11 15:49 ` [pynfs PATCH 2/3] nfs4.1: clean up the session and client created in Environment.finish() Scott Mayhew
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Scott Mayhew @ 2019-03-11 15:49 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

Test.run() cleans up session and client records after every test, but
that cleanup doesn't get rid of the locally cached sessionids and
clientids, resulting in subsequent tests sending a multiple bogus
DESTROY_SESSIONs and DESTROY_CLIENTIDs which all return
NFS4ERR_BADSESSION and NFS4ERR_STALE_CLIENTID.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 nfs4.1/server41tests/environment.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index 9e1201f..1a898f8 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -256,11 +256,13 @@ class Environment(testmod.Environment):
         """Destroy client name env.c1"""
         for sessionid in self.c1.sessions.keys():
             self.c1.compound([op.destroy_session(sessionid)])
+            del(self.c1.sessions[sessionid])
 
     def clean_clients(self):
         """Destroy client name env.c1"""
         for clientid in self.c1.clients.keys():
             self.c1.compound([op.destroy_clientid(clientid)])
+            del(self.c1.clients[clientid])
 
 #########################################
 debug_fail = False
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [pynfs PATCH 2/3] nfs4.1: clean up the session and client created in Environment.finish()
  2019-03-11 15:49 [pynfs PATCH 0/3] a few fixes Scott Mayhew
  2019-03-11 15:49 ` [pynfs PATCH 1/3] nfs4.1: don't cache sessionids and clientids after destroying Scott Mayhew
@ 2019-03-11 15:49 ` Scott Mayhew
  2019-03-11 15:49 ` [pynfs PATCH 3/3] nfs4.1: close the file created in SEQ10b Scott Mayhew
  2019-03-13 14:56 ` [pynfs PATCH 0/3] a few fixes J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: Scott Mayhew @ 2019-03-11 15:49 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

Otherwise, they stick around on the server for a lease period.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 nfs4.1/server41tests/environment.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nfs4.1/server41tests/environment.py b/nfs4.1/server41tests/environment.py
index 1a898f8..0ce6943 100644
--- a/nfs4.1/server41tests/environment.py
+++ b/nfs4.1/server41tests/environment.py
@@ -208,6 +208,8 @@ class Environment(testmod.Environment):
         sess = self.c1.new_client_session("Environment.init_%i" % self.timestamp)
         clean_dir(sess, self.opts.home)
         sess.c.null()
+        self.clean_sessions()
+        self.clean_clients()
 
     def startUp(self):
         """Run before each test"""
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [pynfs PATCH 3/3] nfs4.1: close the file created in SEQ10b
  2019-03-11 15:49 [pynfs PATCH 0/3] a few fixes Scott Mayhew
  2019-03-11 15:49 ` [pynfs PATCH 1/3] nfs4.1: don't cache sessionids and clientids after destroying Scott Mayhew
  2019-03-11 15:49 ` [pynfs PATCH 2/3] nfs4.1: clean up the session and client created in Environment.finish() Scott Mayhew
@ 2019-03-11 15:49 ` Scott Mayhew
  2019-03-13 14:56 ` [pynfs PATCH 0/3] a few fixes J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: Scott Mayhew @ 2019-03-11 15:49 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs

Otherwise, the DESTROY_CLIENTID sent during cleanup returns
NFS4ERR_CLIENTID_BUSY.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 nfs4.1/server41tests/st_sequence.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index 391b226..c21d8f7 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -1,6 +1,6 @@
 from st_create_session import create_session
 from xdrdef.nfs4_const import *
-from .environment import check, fail, bad_sessionid, create_file
+from .environment import check, fail, bad_sessionid, create_file, close_file
 from xdrdef.nfs4_type import channel_attrs4
 import nfs_ops
 op = nfs_ops.NFS4ops()
@@ -223,12 +223,15 @@ def testReplayCache007(t, env):
     sess1 = env.c1.new_client_session(env.testname(t))
     res = create_file(sess1, "%s_1" % env.testname(t))
     check(res)
+    fh = res.resarray[-1].object
+    stateid = res.resarray[-2].stateid
     ops = env.home + [op.savefh(),\
           op.rename("%s_1" % env.testname(t), "%s_2" % env.testname(t))]
     res1 = sess1.compound(ops, cache_this=False)
     check(res1, NFS4_OK)
     res2 = sess1.compound(ops, seq_delta=0, cache_this=False)
     check(res2, [NFS4_OK, NFS4ERR_RETRY_UNCACHED_REP])
+    close_file(sess1, fh, stateid=stateid)
 
 def testOpNotInSession(t, env):
     """Operations other than SEQUENCE, BIND_CONN_TO_SESSION, EXCHANGE_ID,
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [pynfs PATCH 0/3] a few fixes
  2019-03-11 15:49 [pynfs PATCH 0/3] a few fixes Scott Mayhew
                   ` (2 preceding siblings ...)
  2019-03-11 15:49 ` [pynfs PATCH 3/3] nfs4.1: close the file created in SEQ10b Scott Mayhew
@ 2019-03-13 14:56 ` J. Bruce Fields
  3 siblings, 0 replies; 5+ messages in thread
From: J. Bruce Fields @ 2019-03-13 14:56 UTC (permalink / raw)
  To: Scott Mayhew; +Cc: linux-nfs

On Mon, Mar 11, 2019 at 11:49:48AM -0400, Scott Mayhew wrote:
> The first patch fixes bogus DESTROY_SESSION and DESTROY_CLIENTID ops
> being sent to the server.  The other two prevent session and client
> records from hanging around on the server.

Thanks!  All three applied.--b.

> 
> Scott Mayhew (3):
>   nfs4.1: don't cache sessionids and clientids after destroying
>   nfs4.1: clean up the session and client created in
>     Environment.finish()
>   nfs4.1: close the file created in SEQ10b
> 
>  nfs4.1/server41tests/environment.py | 4 ++++
>  nfs4.1/server41tests/st_sequence.py | 5 ++++-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> -- 
> 2.17.2

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-13 14:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11 15:49 [pynfs PATCH 0/3] a few fixes Scott Mayhew
2019-03-11 15:49 ` [pynfs PATCH 1/3] nfs4.1: don't cache sessionids and clientids after destroying Scott Mayhew
2019-03-11 15:49 ` [pynfs PATCH 2/3] nfs4.1: clean up the session and client created in Environment.finish() Scott Mayhew
2019-03-11 15:49 ` [pynfs PATCH 3/3] nfs4.1: close the file created in SEQ10b Scott Mayhew
2019-03-13 14:56 ` [pynfs PATCH 0/3] a few fixes J. Bruce Fields

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).