Skip to content

Commit e096bbc

Browse files
jtlaytonJ. Bruce Fields
authored andcommitted
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>
1 parent 3dd98a3 commit e096bbc

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

fs/nfsd/nfssvc.c

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
* when not handling a request. i.e. when waiting
4545
*/
4646
#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
5247

5348
extern struct svc_program nfsd_program;
5449
static void nfsd(struct svc_rqst *rqstp);
@@ -175,7 +170,6 @@ int nfsd_nrthreads(void)
175170
return nfsd_serv->sv_nrthreads;
176171
}
177172

178-
static int killsig; /* signal that was used to kill last nfsd */
179173
static void nfsd_last_thread(struct svc_serv *serv)
180174
{
181175
/* 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)
186180
nfsd_racache_shutdown();
187181
nfs4_state_shutdown();
188182

189-
printk(KERN_WARNING "nfsd: last server has exited\n");
190-
if (killsig != SIG_NOCLEAN) {
191-
printk(KERN_WARNING "nfsd: unexporting all filesystems\n");
192-
nfsd_export_flush();
193-
}
183+
printk(KERN_WARNING "nfsd: last server has exited, flushing export "
184+
"cache\n");
185+
nfsd_export_flush();
194186
}
195187

196188
void nfsd_reset_versions(void)
@@ -242,10 +234,9 @@ int nfsd_create_serv(void)
242234
}
243235

244236
atomic_set(&nfsd_busy, 0);
245-
nfsd_serv = svc_create_pooled(&nfsd_program,
246-
nfsd_max_blksize,
247-
nfsd_last_thread,
248-
nfsd, SIG_NOCLEAN, THIS_MODULE);
237+
nfsd_serv = svc_create_pooled(&nfsd_program, nfsd_max_blksize,
238+
nfsd_last_thread, nfsd, SIGINT,
239+
THIS_MODULE);
249240
if (nfsd_serv == NULL)
250241
err = -ENOMEM;
251242

@@ -490,17 +481,9 @@ nfsd(struct svc_rqst *rqstp)
490481
atomic_dec(&nfsd_busy);
491482
}
492483

493-
if (err != -EINTR) {
484+
if (err != -EINTR)
494485
printk(KERN_WARNING "nfsd: terminating on error %d\n", -err);
495-
} else {
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-
}
486+
504487
/* Clear signals before calling svc_exit_thread() */
505488
flush_signals(current);
506489

0 commit comments

Comments
 (0)