summaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2015-02-26 13:59:38 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2015-03-02 18:09:13 -0500
commitb04b22f4ca691280f0ab3f77954f5a21500881e7 (patch)
treeb91de57ef1870cb38fe86b28cd975dca209c8697 /fs/nfs/delegation.c
parent369d6b7f00977eb9090212d4a47ac71f3ec5c217 (diff)
downloadop-kernel-dev-b04b22f4ca691280f0ab3f77954f5a21500881e7.zip
op-kernel-dev-b04b22f4ca691280f0ab3f77954f5a21500881e7.tar.gz
NFSv4: Ensure that we don't reap a delegation that is being returned
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 2e37d83..d9caf73 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -815,12 +815,14 @@ restart:
inode = nfs_delegation_grab_inode(delegation);
if (inode == NULL)
continue;
- delegation = nfs_detach_delegation(NFS_I(inode),
- delegation, server);
+ delegation = nfs_start_delegation_return_locked(NFS_I(inode));
rcu_read_unlock();
-
- if (delegation != NULL)
- nfs_free_delegation(delegation);
+ if (delegation != NULL) {
+ delegation = nfs_detach_delegation(NFS_I(inode),
+ delegation, server);
+ if (delegation != NULL)
+ nfs_free_delegation(delegation);
+ }
iput(inode);
goto restart;
}
OpenPOWER on IntegriCloud