aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/delegation.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 7a1b6e869f9c..af8b235d405d 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -109,6 +109,7 @@ again:
109void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, struct nfs_openres *res) 109void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, struct nfs_openres *res)
110{ 110{
111 struct nfs_delegation *delegation = NFS_I(inode)->delegation; 111 struct nfs_delegation *delegation = NFS_I(inode)->delegation;
112 struct rpc_cred *oldcred;
112 113
113 if (delegation == NULL) 114 if (delegation == NULL)
114 return; 115 return;
@@ -116,11 +117,12 @@ void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, st
116 sizeof(delegation->stateid.data)); 117 sizeof(delegation->stateid.data));
117 delegation->type = res->delegation_type; 118 delegation->type = res->delegation_type;
118 delegation->maxsize = res->maxsize; 119 delegation->maxsize = res->maxsize;
119 put_rpccred(cred); 120 oldcred = delegation->cred;
120 delegation->cred = get_rpccred(cred); 121 delegation->cred = get_rpccred(cred);
121 delegation->flags &= ~NFS_DELEGATION_NEED_RECLAIM; 122 delegation->flags &= ~NFS_DELEGATION_NEED_RECLAIM;
122 NFS_I(inode)->delegation_state = delegation->type; 123 NFS_I(inode)->delegation_state = delegation->type;
123 smp_wmb(); 124 smp_wmb();
125 put_rpccred(oldcred);
124} 126}
125 127
126/* 128/*