diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-02-26 13:59:38 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-02 18:09:13 -0500 |
commit | b04b22f4ca691280f0ab3f77954f5a21500881e7 (patch) | |
tree | b91de57ef1870cb38fe86b28cd975dca209c8697 /fs/nfs/delegation.c | |
parent | 369d6b7f00977eb9090212d4a47ac71f3ec5c217 (diff) |
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.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c index 2e37d8315d92..d9caf73eef48 100644 --- a/fs/nfs/delegation.c +++ b/fs/nfs/delegation.c | |||
@@ -815,12 +815,14 @@ restart: | |||
815 | inode = nfs_delegation_grab_inode(delegation); | 815 | inode = nfs_delegation_grab_inode(delegation); |
816 | if (inode == NULL) | 816 | if (inode == NULL) |
817 | continue; | 817 | continue; |
818 | delegation = nfs_detach_delegation(NFS_I(inode), | 818 | delegation = nfs_start_delegation_return_locked(NFS_I(inode)); |
819 | delegation, server); | ||
820 | rcu_read_unlock(); | 819 | rcu_read_unlock(); |
821 | 820 | if (delegation != NULL) { | |
822 | if (delegation != NULL) | 821 | delegation = nfs_detach_delegation(NFS_I(inode), |
823 | nfs_free_delegation(delegation); | 822 | delegation, server); |
823 | if (delegation != NULL) | ||
824 | nfs_free_delegation(delegation); | ||
825 | } | ||
824 | iput(inode); | 826 | iput(inode); |
825 | goto restart; | 827 | goto restart; |
826 | } | 828 | } |