]> err.no Git - linux-2.6/blobdiff - fs/lockd/host.c
[PATCH] nfsd4: recovery lookup dir check
[linux-2.6] / fs / lockd / host.c
index 90a62f27914c737757937e68dedf5f6abe0e7823..82f7a0b1d8ae1d563b770e45e62c2fa495d05684 100644 (file)
@@ -173,12 +173,11 @@ nlm_bind_host(struct nlm_host *host)
 
        /* If we've already created an RPC client, check whether
         * RPC rebind is required
-        * Note: why keep rebinding if we're on a tcp connection?
         */
        if ((clnt = host->h_rpcclnt) != NULL) {
                xprt = clnt->cl_xprt;
-               if (!xprt->stream && time_after_eq(jiffies, host->h_nextrebind)) {
-                       clnt->cl_port = 0;
+               if (time_after_eq(jiffies, host->h_nextrebind)) {
+                       rpc_force_rebind(clnt);
                        host->h_nextrebind = jiffies + NLM_HOST_REBIND;
                        dprintk("lockd: next rebind in %ld jiffies\n",
                                        host->h_nextrebind - jiffies);
@@ -189,6 +188,7 @@ nlm_bind_host(struct nlm_host *host)
                        goto forgetit;
 
                xprt_set_timeout(&xprt->timeout, 5, nlmsvc_timeout);
+               xprt->resvport = 1;     /* NLM requires a reserved port */
 
                /* Existing NLM servers accept AUTH_UNIX only */
                clnt = rpc_create_client(xprt, host->h_name, &nlm_program,
@@ -196,8 +196,6 @@ nlm_bind_host(struct nlm_host *host)
                if (IS_ERR(clnt))
                        goto forgetit;
                clnt->cl_autobind = 1;  /* turn on pmap queries */
-               xprt->nocong = 1;       /* No congestion control for NLM */
-               xprt->resvport = 1;     /* NLM requires a reserved port */
 
                host->h_rpcclnt = clnt;
        }
@@ -219,7 +217,7 @@ nlm_rebind_host(struct nlm_host *host)
 {
        dprintk("lockd: rebind host %s\n", host->h_name);
        if (host->h_rpcclnt && time_after_eq(jiffies, host->h_nextrebind)) {
-               host->h_rpcclnt->cl_port = 0;
+               rpc_force_rebind(host->h_rpcclnt);
                host->h_nextrebind = jiffies + NLM_HOST_REBIND;
        }
 }