public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: iisaman@umich.edu
Cc: linux-nfs@vger.kernel.org
Subject: DELEG9
Date: Wed, 7 Apr 2010 19:01:19 -0400	[thread overview]
Message-ID: <20100407230119.GK26072@fieldses.org> (raw)

DELEG9 has a few problems:

A callback is never detected, even when one is sent, because
_verify_cb_occurred looks at the old callback server, not the new one.

DELEGRETURN is never sent--probably the existing client doesn't know how
to handle recalls on the new callback server?  The code attempts to make
up for this with an explicit DELEGRETURN after _cause_recall(), but by
then it's too late.

After the following patch, the test works, in the sense that it succeeds
if and only if the server makes a recall over the new callback
connection.

I don't claim this is right, though.  I'm just sending a single open to
trigger the recall, and ignoring the results.  Maybe what's needed is a
method that modifies the callback server instead of attempting to
replace it outright?  I don't know.

--b.

diff --git a/lib/nfs4/servertests/st_delegation.py b/lib/nfs4/servertests/st_delegation.py
index f5056f0..26b19d6 100644
--- a/lib/nfs4/servertests/st_delegation.py
+++ b/lib/nfs4/servertests/st_delegation.py
@@ -399,6 +399,7 @@ def testChangeDeleg(t, env, funct=_recall):
     deleg_info, fh, stateid = _get_deleg(t, c, c.homedir + [t.code], funct, NFS4_OK)
     # Create new callback server
     new_server = CBServer(c)
+    c.cb_server = new_server
     cb_thread = threading.Thread(target=new_server.run)
     cb_thread.setDaemon(1)
     cb_thread.start()
@@ -416,11 +417,16 @@ def testChangeDeleg(t, env, funct=_recall):
         res = c.compound([confirmop])
         check(res)
     count = new_server.opcounts[OP_CB_RECALL]
-    fh2, stateid2 = _cause_recall(t, env)
+    # need lock around this to prevent _recall from
+    # calling c.unpacker.reset while open is still unpacking
+    _lock.acquire()
+    res = c.open_file('newowner', c.homedir + [t.code],
+                      access=OPEN4_SHARE_ACCESS_WRITE,
+                      deny=OPEN4_SHARE_DENY_NONE)
+    _lock.release()
+    env.sleep(1, 'wait for recall')
     _verify_cb_occurred(t, c, count)
-    ops = c.use_obj(fh) + [c.delegreturn_op(deleg_info.read.stateid)]
-    res = c.compound(ops)
-    check(res)
+
 
 
    

                 reply	other threads:[~2010-04-07 22:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100407230119.GK26072@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=iisaman@umich.edu \
    --cc=linux-nfs@vger.kernel.org \
    /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