login
Header Space

 
 

[PATCH 4/4] NLM: have nlm_shutdown_hosts kill off all NLM RPC tasks

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <neilb@...>
Cc: <linux-nfs@...>, <linux-kernel@...>
Date: Monday, January 14, 2008 - 10:05 am

If we're shutting down all the nlm_hosts anyway, then it doesn't make
sense to allow RPC calls to linger. Allowing them to do so can mean
that the RPC calls can outlive the currently running lockd and can lead
to a use after free situation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 fs/lockd/host.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 572601e..8771484 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -377,8 +377,10 @@ nlm_shutdown_hosts(void)
 	/* First, make all hosts eligible for gc */
 	dprintk("lockd: nuking all hosts...\n");
 	for (chain = nlm_hosts; chain < nlm_hosts + NLM_HOST_NRHASH; ++chain) {
-		hlist_for_each_entry(host, pos, chain, h_hash)
+		hlist_for_each_entry(host, pos, chain, h_hash) {
 			host->h_expires = jiffies - 1;
+			rpc_killall_tasks(host->h_rpcclnt);
+		}
 	}
 
 	/* Then, perform a garbage collection pass */
-- 
1.5.3.7

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 2/4] SUNRPC: export svc_sock_update_bufs, Jeff Layton, (Mon Jan 14, 10:05 am)
[PATCH 3/4] NLM: Convert lockd to use kthreads, Jeff Layton, (Mon Jan 14, 10:05 am)
[PATCH 4/4] NLM: have nlm_shutdown_hosts kill off all NLM RP..., Jeff Layton, (Mon Jan 14, 10:05 am)
speck-geostationary