aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfssvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r--fs/nfsd/nfssvc.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index c52c99964a4c..0339b4ddfa3b 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -134,6 +134,9 @@ static int killsig; /* signal that was used to kill last nfsd */
134static void nfsd_last_thread(struct svc_serv *serv) 134static void nfsd_last_thread(struct svc_serv *serv)
135{ 135{
136 /* When last nfsd thread exits we need to do some clean-up */ 136 /* When last nfsd thread exits we need to do some clean-up */
137 struct svc_sock *svsk;
138 list_for_each_entry(svsk, &serv->sv_permsocks, sk_list)
139 lockd_down();
137 nfsd_serv = NULL; 140 nfsd_serv = NULL;
138 nfsd_racache_shutdown(); 141 nfsd_racache_shutdown();
139 nfs4_state_shutdown(); 142 nfs4_state_shutdown();
@@ -218,11 +221,16 @@ nfsd_svc(unsigned short port, int nrservs)
218 error = svc_makesock(nfsd_serv, IPPROTO_UDP, port); 221 error = svc_makesock(nfsd_serv, IPPROTO_UDP, port);
219 if (error < 0) 222 if (error < 0)
220 goto failure; 223 goto failure;
221 224 error = lockd_up(IPPROTO_UDP);
225 if (error < 0)
226 goto failure;
222#ifdef CONFIG_NFSD_TCP 227#ifdef CONFIG_NFSD_TCP
223 error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); 228 error = svc_makesock(nfsd_serv, IPPROTO_TCP, port);
224 if (error < 0) 229 if (error < 0)
225 goto failure; 230 goto failure;
231 error = lockd_up(IPPROTO_TCP);
232 if (error < 0)
233 goto failure;
226#endif 234#endif
227 do_gettimeofday(&nfssvc_boot); /* record boot time */ 235 do_gettimeofday(&nfssvc_boot); /* record boot time */
228 } else 236 } else
@@ -306,8 +314,6 @@ nfsd(struct svc_rqst *rqstp)
306 314
307 nfsdstats.th_cnt++; 315 nfsdstats.th_cnt++;
308 316
309 lockd_up(); /* start lockd */
310
311 me.task = current; 317 me.task = current;
312 list_add(&me.list, &nfsd_list); 318 list_add(&me.list, &nfsd_list);
313 319
@@ -364,13 +370,11 @@ nfsd(struct svc_rqst *rqstp)
364 break; 370 break;
365 killsig = signo; 371 killsig = signo;
366 } 372 }
367 /* Clear signals before calling lockd_down() and svc_exit_thread() */ 373 /* Clear signals before calling svc_exit_thread() */
368 flush_signals(current); 374 flush_signals(current);
369 375
370 lock_kernel(); 376 lock_kernel();
371 377
372 /* Release lockd */
373 lockd_down();
374 list_del(&me.list); 378 list_del(&me.list);
375 nfsdstats.th_cnt --; 379 nfsdstats.th_cnt --;
376 380