Merge tag 'efi_updates_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / fs / lockd / host.c
index 0afb6d5..f802223 100644 (file)
@@ -163,7 +163,7 @@ static struct nlm_host *nlm_alloc_host(struct nlm_lookup_host_info *ni,
        host->h_nsmhandle  = nsm;
        host->h_addrbuf    = nsm->sm_addrbuf;
        host->net          = ni->net;
-       host->h_cred       = get_cred(ni->cred),
+       host->h_cred       = get_cred(ni->cred);
        strlcpy(host->nodename, utsname()->nodename, sizeof(host->nodename));
 
 out:
@@ -439,12 +439,7 @@ nlm_bind_host(struct nlm_host *host)
         * RPC rebind is required
         */
        if ((clnt = host->h_rpcclnt) != NULL) {
-               if (time_after_eq(jiffies, host->h_nextrebind)) {
-                       rpc_force_rebind(clnt);
-                       host->h_nextrebind = jiffies + NLM_HOST_REBIND;
-                       dprintk("lockd: next rebind in %lu jiffies\n",
-                                       host->h_nextrebind - jiffies);
-               }
+               nlm_rebind_host(host);
        } else {
                unsigned long increment = nlmsvc_timeout;
                struct rpc_timeout timeparms = {
@@ -494,13 +489,20 @@ nlm_bind_host(struct nlm_host *host)
        return clnt;
 }
 
-/*
- * Force a portmap lookup of the remote lockd port
+/**
+ * nlm_rebind_host - If needed, force a portmap lookup of the peer's lockd port
+ * @host: NLM host handle for peer
+ *
+ * This is not needed when using a connection-oriented protocol, such as TCP.
+ * The existing autobind mechanism is sufficient to force a rebind when
+ * required, e.g. on connection state transitions.
  */
 void
 nlm_rebind_host(struct nlm_host *host)
 {
-       dprintk("lockd: rebind host %s\n", host->h_name);
+       if (host->h_proto != IPPROTO_UDP)
+               return;
+
        if (host->h_rpcclnt && time_after_eq(jiffies, host->h_nextrebind)) {
                rpc_force_rebind(host->h_rpcclnt);
                host->h_nextrebind = jiffies + NLM_HOST_REBIND;