Skip to contentSkip to conversation

Add pynfs4.0 release lockowner test RLOWN2

PATCH Superseded Dai Ngo 2 participants 2 messages May 23, 2022

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Dai Ngo

author reviewer
#0 lore raw

PATCH 1/1 Add pynfs4.0 release lockowner test RLOWN2

From: root <[email protected]>

Add RLOWN2, similar to RLOWN1 but remove the file before release lockowner. This test is to exercise to code path causing problem of being blocked in nfsd_file_put while holding the cl_client lock.

---
 nfs4.0/servertests/st_releaselockowner.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
nfs4.0/servertests/st_releaselockowner.py +25 -0
index ccd10ff..50cef88 100644
@@ -24,3 +24,28 @@ def testFile(t, env):
     owner = lock_owner4(c.clientid, b"lockowner_RLOWN1")
     res = c.compound([op.release_lockowner(owner)])
     check(res)
+
+def testFile2(t, env):
+    """RELEASE_LOCKOWNER 2 - same as basic test but remove
+    file before release lockowner.
+
+    FLAGS: releaselockowner all
+    DEPEND:
+    CODE: RLOWN2
+    """
+    c = env.c1
+    c.init_connection()
+    fh, stateid = c.create_confirm(t.word())
+    res = c.lock_file(t.word(), fh, stateid, lockowner=b"lockowner_RLOWN1")
+    check(res)
+    res = c.unlock_file(1, fh, res.lockid)
+    check(res)
+
+    ops = c.use_obj(c.homedir) + [op.remove(t.word())]
+    res = c.compound(ops)
+    check(res)
+
+    # Release lockowner
+    owner = lock_owner4(c.clientid, b"lockowner_RLOWN1")
+    res = c.compound([op.release_lockowner(owner)])
+    check(res)
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 26 lines · Dai Ngo

From: root <[email protected]>

Add RLOWN2, similar to RLOWN1 but remove the file before release lockowner. This test is to exercise to code path causing problem of being blocked in nfsd_file_put while holding the cl_client lock.

---
nfs4.0/servertests/st_releaselockowner.py | 25 +++++++++++++++++++++++++

1 file changed, 25 insertions(+)
nfs4.0/servertests/st_releaselockowner.py +3 -0
index ccd10ff..50cef88 100644
@@ -24,3 +24,28 @@ def testFile(t, env):
    owner = lock_owner4(c.clientid, b"lockowner_RLOWN1")
    res = c.compound([op.release_lockowner(owner)])
    check(res)
+
+def testFile2(t, env):
+    """RELEASE_LOCKOWNER 2 - same as basic test but remove

nfs4.0/servertests/st_releaselockowner.py def testFile(t, env): · line 39

Quoted 10 lines
nfs4.0/servertests/st_releaselockowner.py +10 -0
+    file before release lockowner.
+
+    FLAGS: releaselockowner all
+    DEPEND:
+    CODE: RLOWN2
+    """
+    c = env.c1
+    c.init_connection()
+    fh, stateid = c.create_confirm(t.word())
+    res = c.lock_file(t.word(), fh, stateid, lockowner=b"lockowner_RLOWN1")

Should probably be b"lockowner_RLOWN2"

nfs4.0/servertests/st_releaselockowner.py def testFile(t, env): · line 49

Quoted 10 lines
nfs4.0/servertests/st_releaselockowner.py +10 -0
+    check(res)
+    res = c.unlock_file(1, fh, res.lockid)
+    check(res)
+
+    ops = c.use_obj(c.homedir) + [op.remove(t.word())]
+    res = c.compound(ops)
+    check(res)
+
+    # Release lockowner
+    owner = lock_owner4(c.clientid, b"lockowner_RLOWN1")

Ditto.

Quoted 5 lines
nfs4.0/servertests/st_releaselockowner.py +2 -0
+    res = c.compound([op.release_lockowner(owner)])
+    check(res)
Signature · 1 line
1.8.3.1

--
Chuck Lever