aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/client.c2
-rw-r--r--fs/nfs/nfs4state.c6
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c1
-rw-r--r--net/sunrpc/sched.c21
-rw-r--r--net/sunrpc/xprt.c5
6 files changed, 28 insertions, 8 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index c5c0175898f6..06f064d8fbbe 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -170,6 +170,8 @@ static void nfs4_shutdown_client(struct nfs_client *clp)
170 BUG_ON(!RB_EMPTY_ROOT(&clp->cl_state_owners)); 170 BUG_ON(!RB_EMPTY_ROOT(&clp->cl_state_owners));
171 if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state)) 171 if (__test_and_clear_bit(NFS_CS_IDMAP, &clp->cl_res_state))
172 nfs_idmap_delete(clp); 172 nfs_idmap_delete(clp);
173
174 rpc_destroy_wait_queue(&clp->cl_rpcwaitq);
173#endif 175#endif
174} 176}
175 177
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index a2ef02824aa8..7775435ea7a5 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -292,8 +292,10 @@ struct nfs4_state_owner *nfs4_get_state_owner(struct nfs_server *server, struct
292 spin_unlock(&clp->cl_lock); 292 spin_unlock(&clp->cl_lock);
293 if (sp == new) 293 if (sp == new)
294 get_rpccred(cred); 294 get_rpccred(cred);
295 else 295 else {
296 rpc_destroy_wait_queue(&new->so_sequence.wait);
296 kfree(new); 297 kfree(new);
298 }
297 return sp; 299 return sp;
298} 300}
299 301
@@ -310,6 +312,7 @@ void nfs4_put_state_owner(struct nfs4_state_owner *sp)
310 return; 312 return;
311 nfs4_remove_state_owner(clp, sp); 313 nfs4_remove_state_owner(clp, sp);
312 spin_unlock(&clp->cl_lock); 314 spin_unlock(&clp->cl_lock);
315 rpc_destroy_wait_queue(&sp->so_sequence.wait);
313 put_rpccred(cred); 316 put_rpccred(cred);
314 kfree(sp); 317 kfree(sp);
315} 318}
@@ -529,6 +532,7 @@ static void nfs4_free_lock_state(struct nfs4_lock_state *lsp)
529 spin_lock(&clp->cl_lock); 532 spin_lock(&clp->cl_lock);
530 nfs_free_unique_id(&clp->cl_lockowner_id, &lsp->ls_id); 533 nfs_free_unique_id(&clp->cl_lockowner_id, &lsp->ls_id);
531 spin_unlock(&clp->cl_lock); 534 spin_unlock(&clp->cl_lock);
535 rpc_destroy_wait_queue(&lsp->ls_sequence.wait);
532 kfree(lsp); 536 kfree(lsp);
533} 537}
534 538
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 503a937bdca9..d39729e2b893 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -228,6 +228,7 @@ void rpc_killall_tasks(struct rpc_clnt *);
228void rpc_execute(struct rpc_task *); 228void rpc_execute(struct rpc_task *);
229void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); 229void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
230void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); 230void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
231void rpc_destroy_wait_queue(struct rpc_wait_queue *);
231void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, 232void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
232 rpc_action action); 233 rpc_action action);
233void rpc_wake_up_queued_task(struct rpc_wait_queue *, 234void rpc_wake_up_queued_task(struct rpc_wait_queue *,
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index dc6391bcda11..ef6384961808 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -266,6 +266,7 @@ gss_release_msg(struct gss_upcall_msg *gss_msg)
266 BUG_ON(!list_empty(&gss_msg->list)); 266 BUG_ON(!list_empty(&gss_msg->list));
267 if (gss_msg->ctx != NULL) 267 if (gss_msg->ctx != NULL)
268 gss_put_ctx(gss_msg->ctx); 268 gss_put_ctx(gss_msg->ctx);
269 rpc_destroy_wait_queue(&gss_msg->rpc_waitqueue);
269 kfree(gss_msg); 270 kfree(gss_msg);
270} 271}
271 272
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index caf12fd6b6af..86aa897e7b08 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -214,6 +214,11 @@ void rpc_init_wait_queue(struct rpc_wait_queue *queue, const char *qname)
214} 214}
215EXPORT_SYMBOL_GPL(rpc_init_wait_queue); 215EXPORT_SYMBOL_GPL(rpc_init_wait_queue);
216 216
217void rpc_destroy_wait_queue(struct rpc_wait_queue *queue)
218{
219}
220EXPORT_SYMBOL_GPL(rpc_destroy_wait_queue);
221
217static int rpc_wait_bit_killable(void *word) 222static int rpc_wait_bit_killable(void *word)
218{ 223{
219 if (fatal_signal_pending(current)) 224 if (fatal_signal_pending(current))
@@ -1020,11 +1025,20 @@ rpc_destroy_mempool(void)
1020 kmem_cache_destroy(rpc_task_slabp); 1025 kmem_cache_destroy(rpc_task_slabp);
1021 if (rpc_buffer_slabp) 1026 if (rpc_buffer_slabp)
1022 kmem_cache_destroy(rpc_buffer_slabp); 1027 kmem_cache_destroy(rpc_buffer_slabp);
1028 rpc_destroy_wait_queue(&delay_queue);
1023} 1029}
1024 1030
1025int 1031int
1026rpc_init_mempool(void) 1032rpc_init_mempool(void)
1027{ 1033{
1034 /*
1035 * The following is not strictly a mempool initialisation,
1036 * but there is no harm in doing it here
1037 */
1038 rpc_init_wait_queue(&delay_queue, "delayq");
1039 if (!rpciod_start())
1040 goto err_nomem;
1041
1028 rpc_task_slabp = kmem_cache_create("rpc_tasks", 1042 rpc_task_slabp = kmem_cache_create("rpc_tasks",
1029 sizeof(struct rpc_task), 1043 sizeof(struct rpc_task),
1030 0, SLAB_HWCACHE_ALIGN, 1044 0, SLAB_HWCACHE_ALIGN,
@@ -1045,13 +1059,6 @@ rpc_init_mempool(void)
1045 rpc_buffer_slabp); 1059 rpc_buffer_slabp);
1046 if (!rpc_buffer_mempool) 1060 if (!rpc_buffer_mempool)
1047 goto err_nomem; 1061 goto err_nomem;
1048 if (!rpciod_start())
1049 goto err_nomem;
1050 /*
1051 * The following is not strictly a mempool initialisation,
1052 * but there is no harm in doing it here
1053 */
1054 rpc_init_wait_queue(&delay_queue, "delayq");
1055 return 0; 1062 return 0;
1056err_nomem: 1063err_nomem:
1057 rpc_destroy_mempool(); 1064 rpc_destroy_mempool();
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 9bf118c54316..85199c647022 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -1052,6 +1052,11 @@ static void xprt_destroy(struct kref *kref)
1052 xprt->shutdown = 1; 1052 xprt->shutdown = 1;
1053 del_timer_sync(&xprt->timer); 1053 del_timer_sync(&xprt->timer);
1054 1054
1055 rpc_destroy_wait_queue(&xprt->binding);
1056 rpc_destroy_wait_queue(&xprt->pending);
1057 rpc_destroy_wait_queue(&xprt->sending);
1058 rpc_destroy_wait_queue(&xprt->resend);
1059 rpc_destroy_wait_queue(&xprt->backlog);
1055 /* 1060 /*
1056 * Tear down transport state and free the rpc_xprt 1061 * Tear down transport state and free the rpc_xprt
1057 */ 1062 */