Commit ade04647 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4: Ensure we honour NFS_DELEGATION_RETURNING in nfs_inode_set_delegation()



Ensure that nfs_inode_set_delegation() doesn't inadvertently detach a
delegation that is already in the process of being returned.

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent b04b22f4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -370,6 +370,9 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct
			delegation = NULL;
			goto out;
		}
		if (test_and_set_bit(NFS_DELEGATION_RETURNING,
					&old_delegation->flags))
			goto out;
		freeme = nfs_detach_delegation_locked(nfsi,
				old_delegation, clp);
		if (freeme == NULL)