]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
NFSv4: Fix a typo in nfs_inode_reclaim_delegation
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 11 Oct 2007 19:11:51 +0000 (15:11 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 11 Oct 2007 19:11:51 +0000 (15:11 -0400)
We were intending to put the previous instance of delegation->cred
before setting a new one.

Thanks to David Howells for spotting this.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/delegation.c

index 7a1b6e869f9cbb179ed014eb45fa0b4288e7b442..af8b235d405dba2ea74c260fd13aba31a5ac46f1 100644 (file)
@@ -109,6 +109,7 @@ again:
 void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, struct nfs_openres *res)
 {
        struct nfs_delegation *delegation = NFS_I(inode)->delegation;
+       struct rpc_cred *oldcred;
 
        if (delegation == NULL)
                return;
@@ -116,11 +117,12 @@ void nfs_inode_reclaim_delegation(struct inode *inode, struct rpc_cred *cred, st
                        sizeof(delegation->stateid.data));
        delegation->type = res->delegation_type;
        delegation->maxsize = res->maxsize;
-       put_rpccred(cred);
+       oldcred = delegation->cred;
        delegation->cred = get_rpccred(cred);
        delegation->flags &= ~NFS_DELEGATION_NEED_RECLAIM;
        NFS_I(inode)->delegation_state = delegation->type;
        smp_wmb();
+       put_rpccred(oldcred);
 }
 
 /*