[Problem]testOpenUpgradeLock test failed in nfsv4.0 in 5.2.0-rc7

From: Su Yanjun
Date: Tue Jul 02 2019 - 21:35:18 EST


Hi Frank

We tested the pynfs of NFSv4.0 on the latest version of the kernel (5.2.0-rc7).
I encountered a problem while testing st_lock.testOpenUpgradeLock. The problem is now as follows:
**************************************************
LOCK24 st_lock.testOpenUpgradeLock : FAILURE
ÂÂÂÂÂÂÂÂÂÂÂOP_LOCK should return NFS4_OK, instead got
ÂÂÂÂÂÂÂÂÂÂÂNFS4ERR_BAD_SEQID
**************************************************
Is this normal?

The case is as follows:
Def testOpenUpgradeLock(t, env):
ÂÂÂÂ"""Try open, lock, open, downgrade, close

ÂÂÂÂFLAGS: all lock
ÂÂÂÂCODE: LOCK24
ÂÂÂÂ"""
ÂÂÂÂc= env.c1
ÂÂÂÂC.init_connection()
ÂÂÂÂOs = open_sequence(c, t.code, lockowner="lockowner_LOCK24")
ÂÂÂÂOs.open(OPEN4_SHARE_ACCESS_READ)
ÂÂÂÂOs.lock(READ_LT)
ÂÂÂÂOs.open(OPEN4_SHARE_ACCESS_WRITE)
ÂÂÂÂOs.unlock()
ÂÂÂÂOs.downgrade(OPEN4_SHARE_ACCESS_WRITE)
ÂÂÂÂOs.lock(WRITE_LT)
ÂÂÂÂOs.close()

After investigation, there was an error in unlock->lock. When unlocking, the lockowner of the file was not released, causing an error when locking again.
Will nfs4.0 support 1) open-> 2) lock-> 3) unlock-> 4) lock this function?