]> Pileus Git - ~andy/linux/blobdiff - fs/lockd/host.c
Merge branch 'devel'
[~andy/linux] / fs / lockd / host.c
index ca6b16fc3101a3df88d60350060eae56d6528535..f23750db16508f96a31d45d1821e8e56b452868a 100644 (file)
@@ -42,11 +42,12 @@ static struct nsm_handle *  nsm_find(const struct sockaddr_in *sin,
 /*
  * Common host lookup routine for server & client
  */
-static struct nlm_host *
-nlm_lookup_host(int server, const struct sockaddr_in *sin,
-               int proto, int version, const char *hostname,
-               unsigned int hostname_len,
-               const struct sockaddr_in *ssin)
+static struct nlm_host *nlm_lookup_host(int server,
+                                       const struct sockaddr_in *sin,
+                                       int proto, u32 version,
+                                       const char *hostname,
+                                       unsigned int hostname_len,
+                                       const struct sockaddr_in *ssin)
 {
        struct hlist_head *chain;
        struct hlist_node *pos;
@@ -55,7 +56,7 @@ nlm_lookup_host(int server, const struct sockaddr_in *sin,
        int             hash;
 
        dprintk("lockd: nlm_lookup_host("NIPQUAD_FMT"->"NIPQUAD_FMT
-                       ", p=%d, v=%d, my role=%s, name=%.*s)\n",
+                       ", p=%d, v=%u, my role=%s, name=%.*s)\n",
                        NIPQUAD(ssin->sin_addr.s_addr),
                        NIPQUAD(sin->sin_addr.s_addr), proto, version,
                        server? "server" : "client",
@@ -175,9 +176,10 @@ nlm_destroy_host(struct nlm_host *host)
 /*
  * Find an NLM server handle in the cache. If there is none, create it.
  */
-struct nlm_host *
-nlmclnt_lookup_host(const struct sockaddr_in *sin, int proto, int version,
-                       const char *hostname, unsigned int hostname_len)
+struct nlm_host *nlmclnt_lookup_host(const struct sockaddr_in *sin,
+                                    int proto, u32 version,
+                                    const char *hostname,
+                                    unsigned int hostname_len)
 {
        struct sockaddr_in ssin = {0};
 
@@ -243,10 +245,18 @@ nlm_bind_host(struct nlm_host *host)
                        .program        = &nlm_program,
                        .version        = host->h_version,
                        .authflavor     = RPC_AUTH_UNIX,
-                       .flags          = (RPC_CLNT_CREATE_HARDRTRY |
+                       .flags          = (RPC_CLNT_CREATE_NOPING |
                                           RPC_CLNT_CREATE_AUTOBIND),
                };
 
+               /*
+                * lockd retries server side blocks automatically so we want
+                * those to be soft RPC calls. Client side calls need to be
+                * hard RPC tasks.
+                */
+               if (!host->h_server)
+                       args.flags |= RPC_CLNT_CREATE_HARDRTRY;
+
                clnt = rpc_create(&args);
                if (!IS_ERR(clnt))
                        host->h_rpcclnt = clnt;