OSDN Git Service

NFS: State reclaim clears OPEN and LOCK state
authorChuck Lever <chuck.lever@oracle.com>
Wed, 11 Jul 2012 20:30:05 +0000 (16:30 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 16 Jul 2012 18:48:53 +0000 (14:48 -0400)
commiteb64cf964d453f8b559a8c0c2625952dbbcb5838
treeb6ac6d9cfdee8d8ae1710d6f2fb25520d7d2a576
parent89af2739589365bf0dd2023c6a076b22ccd530f9
NFS: State reclaim clears OPEN and LOCK state

The "state->flags & flags" test in nfs41_check_expired_stateid()
allows the state manager to squelch a TEST_STATEID operation when
it is known for sure that a state ID is no longer valid.  If the
lease was purged, for example, the client already knows that state
ID is now defunct.

But open recovery is still needed for that inode.

To force a call to nfs4_open_expired(), change the default return
value for nfs41_check_expired_stateid() to force open recovery, and
the default return value for nfs41_check_locks() to force lock
recovery, if the requested flags are clear.  Fix suggested by Bryan
Schumaker.

Also, the presence of a delegation state ID must not prevent normal
open recovery.  The delegation state ID must be cleared if it was
revoked, but once cleared I don't think it's presence or absence has
any bearing on whether open recovery is still needed.  So the logic
is adjusted to ignore the TEST_STATEID result for the delegation
state ID.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c