[pnfs] [PATCH 2/5] delete nfs4_client ref counting from nfsd4_probe_callback

Benny Halevy bhalevy at panasas.com
Thu May 17 09:45:07 EDT 2007


nfsd4_probe_callback is called under the state lock
so it can't cross expire_client.  The async cb_null callback
rpc takes a reference on the rpc_clnt.cl_users so expire_client
will wait on it correctly with no need to take a refcount on
the nfs4_client itself.

Signed-off-by: Benny Halevy <bhalevy at panasas.com>
---
 fs/nfsd/nfs4callback.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index 63aafd2..d92db60 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -442,9 +442,6 @@ nfsd4_probe_callback(struct nfs4_client *clp)
 
 	cb->cb_client = clnt;
 
-	/* the task holds a reference to the nfs4_client struct */
-	atomic_inc(&clp->cl_count);
-
 	msg.rpc_cred = nfsd4_lookupcred(clp,0);
 	if (IS_ERR(msg.rpc_cred))
 		goto out_rpciod;
@@ -458,7 +455,6 @@ nfsd4_probe_callback(struct nfs4_client *clp)
 	return;
 
 out_rpciod:
-	atomic_dec(&clp->cl_count);
 	rpciod_down();
 	cb->cb_client = NULL;
 out_clnt:
@@ -480,12 +476,10 @@ nfs4_cb_null(struct rpc_task *task, void *dummy)
 	if (task->tk_status < 0) {
 		dprintk("NFSD: callback establishment to client %.*s failed\n",
 			(int)clp->cl_name.len, clp->cl_name.data);
-		goto out;
+		return;
 	}
 	atomic_set(&cb->cb_set, 1);
 	dprintk("NFSD: callback set to client %u.%u.%u.%u\n", NIPQUAD(addr));
-out:
-	put_nfs4_client(clp);
 }
 
 static const struct rpc_call_ops nfs4_cb_null_ops = {



More information about the pNFS mailing list