OSDN Git Service

NFSv4: Don't reclaim delegations that have been returned or revoked
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 22 Oct 2019 12:52:47 +0000 (08:52 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Mon, 4 Nov 2019 02:28:46 +0000 (21:28 -0500)
If the delegation has already been revoked, we want to avoid reclaiming
it on reboot.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/delegation.c

index ebd83e4..78df1cd 100644 (file)
@@ -199,7 +199,7 @@ void nfs_inode_reclaim_delegation(struct inode *inode, const struct cred *cred,
        delegation = rcu_dereference(NFS_I(inode)->delegation);
        if (delegation != NULL) {
                spin_lock(&delegation->lock);
-               if (delegation->inode != NULL) {
+               if (nfs4_is_valid_delegation(delegation, 0)) {
                        nfs4_stateid_copy(&delegation->stateid, stateid);
                        delegation->type = type;
                        delegation->pagemod_limit = pagemod_limit;