Commit 4e2fd495 authored by NeilBrown's avatar NeilBrown Committed by Linus Torvalds
Browse files

[PATCH] knfsd: nfsd4: add missing rpciod_down()



We should be shutting down rpciod for the callback channel when we shut down
the server.

Also note that we do rpciod_up() and create the callback client *before*
setting cb_set--the cb_set only determines whether the initial null was
succesful.  So cb_set is not a reliable determiner of whether we need to clean
up, only cb_client is.

Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 541e0e09
Loading
Loading
Loading
Loading
+14 −7
Original line number Original line Diff line number Diff line
@@ -329,23 +329,30 @@ put_nfs4_client(struct nfs4_client *clp)
		free_client(clp);
		free_client(clp);
}
}


static void
shutdown_callback_client(struct nfs4_client *clp)
{
	struct rpc_clnt *clnt = clp->cl_callback.cb_client;

	/* shutdown rpc client, ending any outstanding recall rpcs */
	if (clnt) {
		clp->cl_callback.cb_client = NULL;
		rpc_shutdown_client(clnt);
		rpciod_down();
	}
}

static void
static void
expire_client(struct nfs4_client *clp)
expire_client(struct nfs4_client *clp)
{
{
	struct nfs4_stateowner *sop;
	struct nfs4_stateowner *sop;
	struct nfs4_delegation *dp;
	struct nfs4_delegation *dp;
	struct nfs4_callback *cb = &clp->cl_callback;
	struct rpc_clnt *clnt = clp->cl_callback.cb_client;
	struct list_head reaplist;
	struct list_head reaplist;


	dprintk("NFSD: expire_client cl_count %d\n",
	dprintk("NFSD: expire_client cl_count %d\n",
	                    atomic_read(&clp->cl_count));
	                    atomic_read(&clp->cl_count));


	/* shutdown rpc client, ending any outstanding recall rpcs */
	shutdown_callback_client(clp);
	if (atomic_read(&cb->cb_set) == 1 && clnt) {
		rpc_shutdown_client(clnt);
		clnt = clp->cl_callback.cb_client = NULL;
	}


	INIT_LIST_HEAD(&reaplist);
	INIT_LIST_HEAD(&reaplist);
	spin_lock(&recall_lock);
	spin_lock(&recall_lock);