]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NFS: Fix an NFS client lockdep issue
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 27 Jan 2011 19:55:39 +0000 (14:55 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 22:47:04 +0000 (14:47 -0800)
commit e00b8a24041f37e56b4b8415ce4eba1cbc238065 upstream.

There is no reason to be freeing the delegation cred in the rcu callback,
and doing so is resulting in a lockdep complaint that rpc_credcache_lock
is being called from both softirq and non-softirq contexts.

Reported-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/delegation.c

index b9c3c43cea1def16da3d9df934fd846dd478488f..98e8e35c44080f46462edba34f8fcc183406ae44 100644 (file)
@@ -24,8 +24,6 @@
 
 static void nfs_do_free_delegation(struct nfs_delegation *delegation)
 {
-       if (delegation->cred)
-               put_rpccred(delegation->cred);
        kfree(delegation);
 }
 
@@ -38,6 +36,10 @@ static void nfs_free_delegation_callback(struct rcu_head *head)
 
 static void nfs_free_delegation(struct nfs_delegation *delegation)
 {
+       if (delegation->cred) {
+               put_rpccred(delegation->cred);
+               delegation->cred = NULL;
+       }
        call_rcu(&delegation->rcu, nfs_free_delegation_callback);
 }