OSDN Git Service

NFSv4: Fix delegation handling in update_open_stateid()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Oct 2019 16:12:17 +0000 (12:12 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Nov 2019 02:28:45 +0000 (21:28 -0500)
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

index caacf5e..217885e 100644 (file)
@@ -1737,7 +1737,7 @@ static int update_open_stateid(struct nfs4_state *state,
                ret = 1;
        }
 
-       deleg_cur = rcu_dereference(nfsi->delegation);
+       deleg_cur = nfs4_get_valid_delegation(state->inode);
        if (deleg_cur == NULL)
                goto no_delegation;
 
@@ -1749,7 +1749,7 @@ static int update_open_stateid(struct nfs4_state *state,
 
        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);