From: "J. Bruce Fields" <bfields@redhat.com>
To: Fred Isaman <iisaman@netapp.com>
Cc: linux-nfs@vger.kernel.org, Mi Jinlong <mijinlong@cn.fujitsu.com>,
"J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 2/6] CLNT: send RECLAIM_COMPLETE when required
Date: Thu, 28 Jul 2011 16:03:00 -0400 [thread overview]
Message-ID: <1311883384-20260-3-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1311883384-20260-1-git-send-email-bfields@redhat.com>
All tests fail against any server which (correctly) enforces the
requirement that a RECLAIM_COMPLETE precede any client's first
non-reclaim OPEN.
Mi Jinlong suggested putting the RECLAIM_COMPLETE in create_file, which
works well since create_file almost always generates the first such
open.
But that seems like an odd place to put what is really a sort of
initialization. Whether many exist now, there will eventually be tests
that don't start with create_file, or that create multiple files.
So, instead, use the just-added new_client_session method.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
---
nfs4.1/nfs4client.py | 1 +
nfs4.1/server41tests/st_open.py | 2 ++
nfs4.1/server41tests/st_sequence.py | 1 +
3 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py
index e162e70..5b9c14f 100644
--- a/nfs4.1/nfs4client.py
+++ b/nfs4.1/nfs4client.py
@@ -292,6 +292,7 @@ class NFS4Client(rpc.Client, rpc.Server):
def new_client_session(self, name, flags=0):
c = self.new_client(name, flags=flags)
s = c.create_session()
+ s.compound([op.reclaim_complete(FALSE)])
return s
class ClientStateProtection(object):
diff --git a/nfs4.1/server41tests/st_open.py b/nfs4.1/server41tests/st_open.py
index b599b04..2aa3ec4 100644
--- a/nfs4.1/server41tests/st_open.py
+++ b/nfs4.1/server41tests/st_open.py
@@ -110,6 +110,7 @@ def xtestOpenClientid(t, env):
# If by coincidence clientid==0, make a new client
c1 = env.c1.new_client("%s_2" % name)
sess1 = c1.create_session()
+ sess1.compound([op.reclaim_complete(FALSE)])
res = create_file(sess1, env.testname(t), clientid=c1.clientid)
check(res, NFS4ERR_INVAL, msg="Using non-zero clientid in open_owner")
@@ -130,6 +131,7 @@ def testReadDeleg(t, env):
c1.cb_pre_hook(OP_CB_RECALL, pre_hook)
c1.cb_post_hook(OP_CB_RECALL, post_hook)
sess1 = c1.create_session()
+ sess1.compound([op.reclaim_complete(FALSE)])
res = create_file(sess1, env.testname(t),
access=OPEN4_SHARE_ACCESS_READ |
OPEN4_SHARE_ACCESS_WANT_READ_DELEG)
diff --git a/nfs4.1/server41tests/st_sequence.py b/nfs4.1/server41tests/st_sequence.py
index f4f6772..2362fb6 100644
--- a/nfs4.1/server41tests/st_sequence.py
+++ b/nfs4.1/server41tests/st_sequence.py
@@ -373,6 +373,7 @@ def testReuseSlotID(t, env):
c = env.c1.new_client(env.testname(t))
sess1 = c.create_session()
sess1 = env.c1.new_client_session(env.testname(t))
+ sess1.compound([op.reclaim_complete(FALSE)])
name = "%s_1" % env.testname(t)
res = create_file(sess1, name)
--
1.7.4.1
next prev parent reply other threads:[~2011-07-28 20:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-28 20:02 [PATCH 0/6] pynfs patches J. Bruce Fields
2011-07-28 20:02 ` [PATCH 1/6] CLNT: provide new_client_session shortcut J. Bruce Fields
2011-07-28 20:03 ` J. Bruce Fields [this message]
2011-07-28 20:03 ` [PATCH 3/6] Share showresults.py between 4.0 and 4.1 J. Bruce Fields
2011-07-28 20:03 ` [PATCH 4/6] Make top-level setup.py set up nfs4.0 as well J. Bruce Fields
2011-07-28 20:03 ` [PATCH 5/6] Merge top-level READMEs J. Bruce Fields
2011-07-28 20:45 ` J. Bruce Fields
2011-07-28 20:03 ` [PATCH 6/6] Share testmod.py between nfs4.0 and nfs4.1 J. Bruce Fields
2011-08-01 22:35 ` [PATCH 0/6] pynfs patches J. Bruce Fields
2011-08-09 20:30 ` two more minor " J. Bruce Fields
2011-08-17 20:54 ` J. Bruce Fields
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=1311883384-20260-3-git-send-email-bfields@redhat.com \
--to=bfields@redhat.com \
--cc=iisaman@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=mijinlong@cn.fujitsu.com \
/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).