aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r--fs/lockd/host.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 82f7a0b1d8ae..112ebf8b8dfe 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -123,6 +123,8 @@ nlm_lookup_host(int server, struct sockaddr_in *sin,
123 nlm_hosts[hash] = host; 123 nlm_hosts[hash] = host;
124 INIT_LIST_HEAD(&host->h_lockowners); 124 INIT_LIST_HEAD(&host->h_lockowners);
125 spin_lock_init(&host->h_lock); 125 spin_lock_init(&host->h_lock);
126 INIT_LIST_HEAD(&host->h_granted);
127 INIT_LIST_HEAD(&host->h_reclaim);
126 128
127 if (++nrhosts > NLM_HOST_MAX) 129 if (++nrhosts > NLM_HOST_MAX)
128 next_gc = 0; 130 next_gc = 0;
@@ -191,11 +193,12 @@ nlm_bind_host(struct nlm_host *host)
191 xprt->resvport = 1; /* NLM requires a reserved port */ 193 xprt->resvport = 1; /* NLM requires a reserved port */
192 194
193 /* Existing NLM servers accept AUTH_UNIX only */ 195 /* Existing NLM servers accept AUTH_UNIX only */
194 clnt = rpc_create_client(xprt, host->h_name, &nlm_program, 196 clnt = rpc_new_client(xprt, host->h_name, &nlm_program,
195 host->h_version, RPC_AUTH_UNIX); 197 host->h_version, RPC_AUTH_UNIX);
196 if (IS_ERR(clnt)) 198 if (IS_ERR(clnt))
197 goto forgetit; 199 goto forgetit;
198 clnt->cl_autobind = 1; /* turn on pmap queries */ 200 clnt->cl_autobind = 1; /* turn on pmap queries */
201 clnt->cl_softrtry = 1; /* All queries are soft */
199 202
200 host->h_rpcclnt = clnt; 203 host->h_rpcclnt = clnt;
201 } 204 }
@@ -242,8 +245,12 @@ void nlm_release_host(struct nlm_host *host)
242{ 245{
243 if (host != NULL) { 246 if (host != NULL) {
244 dprintk("lockd: release host %s\n", host->h_name); 247 dprintk("lockd: release host %s\n", host->h_name);
245 atomic_dec(&host->h_count);
246 BUG_ON(atomic_read(&host->h_count) < 0); 248 BUG_ON(atomic_read(&host->h_count) < 0);
249 if (atomic_dec_and_test(&host->h_count)) {
250 BUG_ON(!list_empty(&host->h_lockowners));
251 BUG_ON(!list_empty(&host->h_granted));
252 BUG_ON(!list_empty(&host->h_reclaim));
253 }
247 } 254 }
248} 255}
249 256
@@ -331,7 +338,6 @@ nlm_gc_hosts(void)
331 rpc_destroy_client(host->h_rpcclnt); 338 rpc_destroy_client(host->h_rpcclnt);
332 } 339 }
333 } 340 }
334 BUG_ON(!list_empty(&host->h_lockowners));
335 kfree(host); 341 kfree(host);
336 nrhosts--; 342 nrhosts--;
337 } 343 }