aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/svc.c')
-rw-r--r--net/sunrpc/svc.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 8353829bc5c6..f960b138236f 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -367,6 +367,7 @@ void
367svc_destroy(struct svc_serv *serv) 367svc_destroy(struct svc_serv *serv)
368{ 368{
369 struct svc_sock *svsk; 369 struct svc_sock *svsk;
370 struct svc_sock *tmp;
370 371
371 dprintk("svc: svc_destroy(%s, %d)\n", 372 dprintk("svc: svc_destroy(%s, %d)\n",
372 serv->sv_program->pg_name, 373 serv->sv_program->pg_name,
@@ -382,21 +383,17 @@ svc_destroy(struct svc_serv *serv)
382 383
383 del_timer_sync(&serv->sv_temptimer); 384 del_timer_sync(&serv->sv_temptimer);
384 385
385 while (!list_empty(&serv->sv_tempsocks)) { 386 list_for_each_entry_safe(svsk, tmp, &serv->sv_tempsocks, sk_list)
386 svsk = list_entry(serv->sv_tempsocks.next, 387 svc_force_close_socket(svsk);
387 struct svc_sock, 388
388 sk_list);
389 svc_close_socket(svsk);
390 }
391 if (serv->sv_shutdown) 389 if (serv->sv_shutdown)
392 serv->sv_shutdown(serv); 390 serv->sv_shutdown(serv);
393 391
394 while (!list_empty(&serv->sv_permsocks)) { 392 list_for_each_entry_safe(svsk, tmp, &serv->sv_permsocks, sk_list)
395 svsk = list_entry(serv->sv_permsocks.next, 393 svc_force_close_socket(svsk);
396 struct svc_sock, 394
397 sk_list); 395 BUG_ON(!list_empty(&serv->sv_permsocks));
398 svc_close_socket(svsk); 396 BUG_ON(!list_empty(&serv->sv_tempsocks));
399 }
400 397
401 cache_clean_deferred(serv); 398 cache_clean_deferred(serv);
402 399