aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-06-10 08:40:37 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-06-23 13:02:49 -0400
commite096bbc6488d3e49d476bf986d33752709361277 (patch)
tree2fa5e0367c84eac07c70c1a68243a688fca2d6e2
parent3dd98a3bccb1bdd30b8a4a755e7bead1b64160ec (diff)
knfsd: remove special handling for SIGHUP
The special handling for SIGHUP in knfsd is a holdover from much earlier versions of Linux where reloading the export table was more expensive. That facility is not really needed anymore and to my knowledge, is seldom-used. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r--fs/nfsd/nfssvc.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 929af233510e..6339cb70a08d 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -44,11 +44,6 @@
44 * when not handling a request. i.e. when waiting 44 * when not handling a request. i.e. when waiting
45 */ 45 */
46#define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGHUP) | sigmask(SIGINT) | sigmask(SIGQUIT)) 46#define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGHUP) | sigmask(SIGINT) | sigmask(SIGQUIT))
47/* if the last thread dies with SIGHUP, then the exports table is
48 * left unchanged ( like 2.4-{0-9} ). Any other signal will clear
49 * the exports table (like 2.2).
50 */
51#define SIG_NOCLEAN SIGHUP
52 47
53extern struct svc_program nfsd_program; 48extern struct svc_program nfsd_program;
54static void nfsd(struct svc_rqst *rqstp); 49static void nfsd(struct svc_rqst *rqstp);
@@ -175,7 +170,6 @@ int nfsd_nrthreads(void)
175 return nfsd_serv->sv_nrthreads; 170 return nfsd_serv->sv_nrthreads;
176} 171}
177 172
178static int killsig; /* signal that was used to kill last nfsd */
179static void nfsd_last_thread(struct svc_serv *serv) 173static void nfsd_last_thread(struct svc_serv *serv)
180{ 174{
181 /* When last nfsd thread exits we need to do some clean-up */ 175 /* When last nfsd thread exits we need to do some clean-up */
@@ -186,11 +180,9 @@ static void nfsd_last_thread(struct svc_serv *serv)
186 nfsd_racache_shutdown(); 180 nfsd_racache_shutdown();
187 nfs4_state_shutdown(); 181 nfs4_state_shutdown();
188 182
189 printk(KERN_WARNING "nfsd: last server has exited\n"); 183 printk(KERN_WARNING "nfsd: last server has exited, flushing export "
190 if (killsig != SIG_NOCLEAN) { 184 "cache\n");
191 printk(KERN_WARNING "nfsd: unexporting all filesystems\n"); 185 nfsd_export_flush();
192 nfsd_export_flush();
193 }
194} 186}
195 187
196void nfsd_reset_versions(void) 188void nfsd_reset_versions(void)
@@ -242,10 +234,9 @@ int nfsd_create_serv(void)
242 } 234 }
243 235
244 atomic_set(&nfsd_busy, 0); 236 atomic_set(&nfsd_busy, 0);
245 nfsd_serv = svc_create_pooled(&nfsd_program, 237 nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize,
246 nfsd_max_blksize, 238 nfsd_last_thread, nfsd, SIGINT,
247 nfsd_last_thread, 239 THIS_MODULE);
248 nfsd, SIG_NOCLEAN, THIS_MODULE);
249 if (nfsd_serv == NULL) 240 if (nfsd_serv == NULL)
250 err = -ENOMEM; 241 err = -ENOMEM;
251 242
@@ -490,17 +481,9 @@ nfsd(struct svc_rqst *rqstp)
490 atomic_dec(&nfsd_busy); 481 atomic_dec(&nfsd_busy);
491 } 482 }
492 483
493 if (err != -EINTR) { 484 if (err != -EINTR)
494 printk(KERN_WARNING "nfsd: terminating on error %d\n", -err); 485 printk(KERN_WARNING "nfsd: terminating on error %d\n", -err);
495 } else { 486
496 unsigned int signo;
497
498 for (signo = 1; signo <= _NSIG; signo++)
499 if (sigismember(&current->pending.signal, signo) &&
500 !sigismember(&current->blocked, signo))
501 break;
502 killsig = signo;
503 }
504 /* Clear signals before calling svc_exit_thread() */ 487 /* Clear signals before calling svc_exit_thread() */
505 flush_signals(current); 488 flush_signals(current);
506 489