All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] Add pynfs4.0 release lockowner test RLOWN2
@ 2022-05-23 21:32 Dai Ngo
  2022-05-28 20:18 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Dai Ngo @ 2022-05-23 21:32 UTC (permalink / raw)
  To: chuck.lever, bfields; +Cc: linux-nfs

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.

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
---
 nfs4.0/servertests/st_releaselockowner.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/nfs4.0/servertests/st_releaselockowner.py b/nfs4.0/servertests/st_releaselockowner.py
index ccd10ff..2c83f99 100644
--- a/nfs4.0/servertests/st_releaselockowner.py
+++ b/nfs4.0/servertests/st_releaselockowner.py
@@ -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_RLOWN2")
+    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_RLOWN2")
+    res = c.compound([op.release_lockowner(owner)])
+    check(res)
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-28 20:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-23 21:32 [PATCH v2 1/1] Add pynfs4.0 release lockowner test RLOWN2 Dai Ngo
2022-05-28 20:18 ` J. Bruce Fields

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.