@@ -1740,14 +1740,12 @@ static int update_open_stateid(struct nfs4_state *state,
goto no_delegation;
spin_lock(&deleg_cur->lock);
- if (rcu_dereference(nfsi->delegation) != deleg_cur ||
- test_bit(NFS_DELEGATION_RETURNING, &deleg_cur->flags) ||
- (deleg_cur->type & fmode) != fmode)
+ if (!nfs4_is_valid_delegation(deleg_cur, fmode))
goto no_delegation_unlock;
if (delegation == NULL)
delegation = &deleg_cur->stateid;
- else if (!nfs4_stateid_match(&deleg_cur->stateid, delegation))
+ else if (!nfs4_stateid_match_other(&deleg_cur->stateid, delegation))
goto no_delegation_unlock;
nfs_mark_delegation_referenced(deleg_cur);
If the delegation is marked as being revoked, then don't use it in the open state structure. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> --- fs/nfs/nfs4proc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)