Skip to contentSkip to conversation

fixes for 2.6.25

PATCH In review Jeff Layton 2 participants 4 messages Jan 29, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover fixes for 2.6.25

Hi Bruce,
Here are the two patches that I think are reasonable for 2.6.25. I
think it's probably best that we continue working on lockd over the 2.6.25 development cycle and target the conversion to kthread API for 2.6.26.

#1 lore raw

PATCH 1/2 SUNRPC: spin svc_rqst initialization to its own function

Move the initialzation in __svc_create_thread that happens prior to thread creation to a new function. Export the function to allow services to have better control over the svc_rqst structs.

Also rearrange the rqstp initialization to prevent NULL pointer dereferences in svc_exit_thread in case allocations fail.

---
 include/linux/sunrpc/svc.h |    2 +
 net/sunrpc/svc.c           |   59 +++++++++++++++++++++++++++++++------------
 2 files changed, 44 insertions(+), 17 deletions(-)
include/linux/sunrpc/svc.h +2 -0
index 742ab46..64c7710 100644
@@ -384,6 +384,8 @@ struct svc_procedure {
  */
 struct svc_serv *  svc_create(struct svc_program *, unsigned int,
 			      void (*shutdown)(struct svc_serv*));
+struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
+					struct svc_pool *pool);
 int		   svc_create_thread(svc_thread_fn, struct svc_serv *);
 void		   svc_exit_thread(struct svc_rqst *);
 struct svc_serv *  svc_create_pooled(struct svc_program *, unsigned int,
net/sunrpc/svc.c +42 -17

79 lines not on this page · raw message

Signature · 1 line
1.5.3.8
#2 lore raw

PATCH 2/2 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.

---
 fs/lockd/host.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
fs/lockd/host.c +6 -1
index ebec009..ca6b16f 100644
@@ -379,8 +379,13 @@ 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;
+			if (host->h_rpcclnt) {
+				rpc_shutdown_client(host->h_rpcclnt);
+				host->h_rpcclnt = NULL;
+			}
+		}
 	}
 
 	/* Then, perform a garbage collection pass */
Signature · 1 line
1.5.3.8
#3 lore raw
In reply to Jeff Layton
Quoted 7 lines · Jeff Layton

Hi Bruce,
Here are the two patches that I think are reasonable for 2.6.25. I
think it's probably best that we continue working on lockd over the 2.6.25 development cycle and target the conversion to kthread API for 2.6.26.

OK, applied--thanks!

--b.