aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfssvc.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 96fdbcab8d95..80292ff5e924 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -37,15 +37,6 @@
37 37
38#define NFSDDBG_FACILITY NFSDDBG_SVC 38#define NFSDDBG_FACILITY NFSDDBG_SVC
39 39
40/* these signals will be delivered to an nfsd thread
41 * when handling a request
42 */
43#define ALLOWED_SIGS (sigmask(SIGKILL))
44/* these signals will be delivered to an nfsd thread
45 * when not handling a request. i.e. when waiting
46 */
47#define SHUTDOWN_SIGS (sigmask(SIGKILL) | sigmask(SIGHUP) | sigmask(SIGINT) | sigmask(SIGQUIT))
48
49extern struct svc_program nfsd_program; 40extern struct svc_program nfsd_program;
50static int nfsd(void *vrqstp); 41static int nfsd(void *vrqstp);
51struct timeval nfssvc_boot; 42struct timeval nfssvc_boot;
@@ -414,9 +405,7 @@ nfsd(void *vrqstp)
414{ 405{
415 struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp; 406 struct svc_rqst *rqstp = (struct svc_rqst *) vrqstp;
416 struct fs_struct *fsp; 407 struct fs_struct *fsp;
417 sigset_t shutdown_mask, allowed_mask;
418 int err, preverr = 0; 408 int err, preverr = 0;
419 unsigned int signo;
420 409
421 /* Lock module and set up kernel thread */ 410 /* Lock module and set up kernel thread */
422 mutex_lock(&nfsd_mutex); 411 mutex_lock(&nfsd_mutex);
@@ -433,17 +422,14 @@ nfsd(void *vrqstp)
433 current->fs = fsp; 422 current->fs = fsp;
434 current->fs->umask = 0; 423 current->fs->umask = 0;
435 424
436 siginitsetinv(&shutdown_mask, SHUTDOWN_SIGS);
437 siginitsetinv(&allowed_mask, ALLOWED_SIGS);
438
439 /* 425 /*
440 * thread is spawned with all signals set to SIG_IGN, re-enable 426 * thread is spawned with all signals set to SIG_IGN, re-enable
441 * the ones that matter 427 * the ones that will bring down the thread
442 */ 428 */
443 for (signo = 1; signo <= _NSIG; signo++) { 429 allow_signal(SIGKILL);
444 if (!sigismember(&shutdown_mask, signo)) 430 allow_signal(SIGHUP);
445 allow_signal(signo); 431 allow_signal(SIGINT);
446 } 432 allow_signal(SIGQUIT);
447 433
448 nfsdstats.th_cnt++; 434 nfsdstats.th_cnt++;
449 mutex_unlock(&nfsd_mutex); 435 mutex_unlock(&nfsd_mutex);
@@ -460,9 +446,6 @@ nfsd(void *vrqstp)
460 * The main request loop 446 * The main request loop
461 */ 447 */
462 for (;;) { 448 for (;;) {
463 /* Block all but the shutdown signals */
464 sigprocmask(SIG_SETMASK, &shutdown_mask, NULL);
465
466 /* 449 /*
467 * Find a socket with data available and call its 450 * Find a socket with data available and call its
468 * recvfrom routine. 451 * recvfrom routine.
@@ -487,9 +470,6 @@ nfsd(void *vrqstp)
487 /* Lock the export hash tables for reading. */ 470 /* Lock the export hash tables for reading. */
488 exp_readlock(); 471 exp_readlock();
489 472
490 /* Process request with signals blocked. */
491 sigprocmask(SIG_SETMASK, &allowed_mask, NULL);
492
493 svc_process(rqstp); 473 svc_process(rqstp);
494 474
495 /* Unlock export hash tables */ 475 /* Unlock export hash tables */