patch-2.1.34 linux/fs/nfsd/nfssvc.c

Next file: linux/fs/nfsd/vfs.c
Previous file: linux/fs/nfs/write.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.33/linux/fs/nfsd/nfssvc.c linux/fs/nfsd/nfssvc.c
@@ -35,7 +35,8 @@
 
 #define NFSDDBG_FACILITY	NFSDDBG_SVC
 #define NFSD_BUFSIZE		(1024 + NFSSVC_MAXBLKSIZE)
-#define BLOCKABLE_SIGS		(~(_S(SIGKILL - 1) | _S(SIGSTOP - 1)))
+#define BLOCKABLE_SIGS		(~(_S(SIGKILL) | _S(SIGSTOP)))
+#define SHUTDOWN_SIGS		(_S(SIGKILL)|_S(SIGINT)|_S(SIGTERM))
 #define _S(sig)			(1 << ((sig) - 1))
 
 extern struct svc_program	nfsd_program;
@@ -107,6 +108,7 @@
 	sprintf(current->comm, "nfsd");
 
 	oldumask = current->fs->umask;		/* Set umask to 0.  */
+	current->blocked |= ~SHUTDOWN_SIGS;
 	current->fs->umask = 0;
 	nfssvc_boot = xtime;			/* record boot time */
 	lockd_up();				/* start lockd */
@@ -150,8 +152,16 @@
 		exp_unlock();
 	} while (err >= 0);
 
-	if (err != -EINTR)
+	if (err != -EINTR) {
 		printk(KERN_WARNING "nfsd: terminating on error %d\n", -err);
+	} else {
+		unsigned int	signo;
+
+		for (signo = 0; signo < 32; signo++)
+			if (current->signal & current->blocked & (1<<signo))
+				break;
+		printk(KERN_WARNING "nfsd: terminating on signal %d\n", signo);
+	}
 
 	/* Release lockd */
 	lockd_down();

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov