diff options
Diffstat (limited to 'fs/nfsd/nfssvc.c')
-rw-r--r-- | fs/nfsd/nfssvc.c | 16 |
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 */ static void nfsd_last_thread(struct svc_serv *serv) { /* When last nfsd thread exits we need to do some clean-up */ + struct svc_sock *svsk; + list_for_each_entry(svsk, &serv->sv_permsocks, sk_list) + lockd_down(); nfsd_serv = NULL; nfsd_racache_shutdown(); nfs4_state_shutdown(); @@ -218,11 +221,16 @@ nfsd_svc(unsigned short port, int nrservs) error = svc_makesock(nfsd_serv, IPPROTO_UDP, port); if (error < 0) goto failure; - + error = lockd_up(IPPROTO_UDP); + if (error < 0) + goto failure; #ifdef CONFIG_NFSD_TCP error = svc_makesock(nfsd_serv, IPPROTO_TCP, port); if (error < 0) goto failure; + error = lockd_up(IPPROTO_TCP); + if (error < 0) + goto failure; #endif do_gettimeofday(&nfssvc_boot); /* record boot time */ } else @@ -306,8 +314,6 @@ nfsd(struct svc_rqst *rqstp) nfsdstats.th_cnt++; - lockd_up(); /* start lockd */ - me.task = current; list_add(&me.list, &nfsd_list); @@ -364,13 +370,11 @@ nfsd(struct svc_rqst *rqstp) break; killsig = signo; } - /* Clear signals before calling lockd_down() and svc_exit_thread() */ + /* Clear signals before calling svc_exit_thread() */ flush_signals(current); lock_kernel(); - /* Release lockd */ - lockd_down(); list_del(&me.list); nfsdstats.th_cnt --; |