diff options
author | Jeff Layton <jlayton@redhat.com> | 2008-01-29 10:30:55 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2008-02-01 16:42:15 -0500 |
commit | d801b861681116ea23a7fb87a70bf463d29c8b9c (patch) | |
tree | dcc35c5c93461c452942fe5954badd034d8a2939 /fs/lockd/host.c | |
parent | 0113ab34644649aceaac37ef4b7e5c7d5c183be3 (diff) |
NLM: tear down RPC clients in nlm_shutdown_hosts
It's possible for a RPC to outlive the lockd daemon that created it, so
we need to make sure that all RPC's are killed when lockd is coming
down. When nlm_shutdown_hosts is called, kill off all RPC tasks
associated with the host. Since we need to wait until they have all gone
away, we might as well just shut down the RPC client altogether.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/host.c')
-rw-r--r-- | fs/lockd/host.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index ebec0098efbf..ca6b16fc3101 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -379,8 +379,13 @@ nlm_shutdown_hosts(void) | |||
379 | /* First, make all hosts eligible for gc */ | 379 | /* First, make all hosts eligible for gc */ |
380 | dprintk("lockd: nuking all hosts...\n"); | 380 | dprintk("lockd: nuking all hosts...\n"); |
381 | for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) { | 381 | for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) { |
382 | hlist_for_each_entry(host, pos, chain, h_hash) | 382 | hlist_for_each_entry(host, pos, chain, h_hash) { |
383 | host->h_expires = jiffies - 1; | 383 | host->h_expires = jiffies - 1; |
384 | if (host->h_rpcclnt) { | ||
385 | rpc_shutdown_client(host->h_rpcclnt); | ||
386 | host->h_rpcclnt = NULL; | ||
387 | } | ||
388 | } | ||
384 | } | 389 | } |
385 | 390 | ||
386 | /* Then, perform a garbage collection pass */ | 391 | /* Then, perform a garbage collection pass */ |