diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-27 20:25:50 +0100 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-03 00:09:14 +0100 |
commit | ade04647dd56881e285983af3db702d56ee97e86 (patch) | |
tree | 9a88d7c034768ad576e0434e73ed435656b0a213 /fs/nfs/delegation.c | |
parent | NFSv4: Ensure that we don't reap a delegation that is being returned (diff) | |
download | linux-ade04647dd56881e285983af3db702d56ee97e86.tar.xz linux-ade04647dd56881e285983af3db702d56ee97e86.zip |
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: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to '')
-rw-r--r-- | fs/nfs/delegation.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index d9caf73eef48..5ca502b5f877 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c @@ -370,7 +370,10 @@ int nfs_inode_set_delegation(struct inode *inode, struct rpc_cred *cred, struct delegation = NULL; goto out; } - freeme = nfs_detach_delegation_locked(nfsi, + 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) goto out; |