Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: Fred Isaman <iisaman@netapp.com>
Cc: linux-nfs@vger.kernel.org, "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 1/2] read+write+readwrite open test
Date: Mon,  8 Aug 2011 18:40:00 -0400	[thread overview]
Message-ID: <1312843201-6653-2-git-send-email-bfields@redhat.com> (raw)
In-Reply-To: <1312843201-6653-1-git-send-email-bfields@redhat.com>

---
 nfs4.0/lib/nfs4/servertests/st_open.py |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/nfs4.0/lib/nfs4/servertests/st_open.py b/nfs4.0/lib/nfs4/servertests/st_open.py
index 1e5ec70..88134f1 100644
--- a/nfs4.0/lib/nfs4/servertests/st_open.py
+++ b/nfs4.0/lib/nfs4/servertests/st_open.py
@@ -566,4 +566,30 @@ def testDenyWrite4(t, env):
         t.fail("READ returned %s, expected 'data'" % repr(res2.data))
 
 
+def testUpgrades(t, env):
+    """OPEN read, write, and read-write, then close
+
+    Inspired by a linux nfsd regression: the final close closes all the
+    opens, and nfsd did that right, but some misaccounting somewhere
+    leaked a file reference with the result that the filesystem would be
+    unmountable after running this test.
+
+    FLAGS: open all
+    DEPEND: MKFILE
+    CODE: OPEN29
+    """
+    c = env.c1
+    c.init_connection()
+    file = c.homedir + [t.code]
+    c.create_confirm('owner1', file, access=OPEN4_SHARE_ACCESS_READ,
+                                     deny=OPEN4_SHARE_DENY_NONE)
+    c.open_file('owner1', file, access=OPEN4_SHARE_ACCESS_WRITE,
+                                     deny=OPEN4_SHARE_DENY_NONE)
+    res = c.open_file('owner1', file, access=OPEN4_SHARE_ACCESS_BOTH,
+                                     deny=OPEN4_SHARE_DENY_NONE)
+    fh = res.resarray[-1].switch.switch.object
+    stateid = res.resarray[-2].switch.switch.stateid
+    c.close_file(t.code, fh, stateid)
+
+
 #FRED - dot test
-- 
1.7.4.1


  reply	other threads:[~2011-08-08 22:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 22:39 more server pynfs tests J. Bruce Fields
2011-08-08 22:40 ` J. Bruce Fields [this message]
2011-08-08 22:40 ` [PATCH 2/2] check another odd linux server case 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=1312843201-6653-2-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.com \
    --cc=iisaman@netapp.com \
    --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