[PATCH 1/2] read+write+readwrite open test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux