]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
NFSv4: fail nfs4_refresh_delegation_stateid() when the delegation was revoked
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Oct 2019 17:34:06 +0000 (13:34 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 7 Mar 2022 15:37:05 +0000 (16:37 +0100)
BugLink: https://bugs.launchpad.net/bugs/1957986
If the delegation was revoked, we don't want to retry the delegreturn.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
(cherry picked from commit b57562087b0473374de61a7cc8ea200c4e34d295)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/nfs/delegation.c

index c34bb81d37e2690109c5389015735db6b09dd991..630167e243bec14aa4b9d4a07527ae64582e8bb0 100644 (file)
@@ -1190,7 +1190,8 @@ bool nfs4_refresh_delegation_stateid(nfs4_stateid *dst, struct inode *inode)
        rcu_read_lock();
        delegation = rcu_dereference(NFS_I(inode)->delegation);
        if (delegation != NULL &&
-           nfs4_stateid_match_other(dst, &delegation->stateid)) {
+           nfs4_stateid_match_other(dst, &delegation->stateid) &&
+           !test_bit(NFS_DELEGATION_REVOKED, &delegation->flags)) {
                dst->seqid = delegation->stateid.seqid;
                ret = true;
        }