diff options
author | bde <bde@FreeBSD.org> | 1997-11-24 14:18:00 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-11-24 14:18:00 +0000 |
commit | a323d6696a3e45aa070d94465a03bdeec081e100 (patch) | |
tree | 72c520282134160e0dfa7c4823b25018cf454aa3 /sys/nfs | |
parent | 62082c7f659e100465060df7218c10762516d9e6 (diff) | |
download | FreeBSD-src-a323d6696a3e45aa070d94465a03bdeec081e100.zip FreeBSD-src-a323d6696a3e45aa070d94465a03bdeec081e100.tar.gz |
Don't call malloc(..., M_WAITOK) at splnet(). Doing so is often
a mistake (since softnet interrupts may occur if malloc() waits),
and doing it harmlessly but unnecessarily here interfered with
detection of the mistaken cases.
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_syscalls.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 074a008..1624b63 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.5 (Berkeley) 3/30/95 - * $Id: nfs_syscalls.c,v 1.31 1997/11/06 19:29:42 phk Exp $ + * $Id: nfs_syscalls.c,v 1.32 1997/11/07 08:53:25 phk Exp $ */ #include <sys/param.h> @@ -464,15 +464,18 @@ nfssvc_nfsd(nsd, argp, p) cacherep = RC_DOIT; writes_todo = 0; #endif - s = splnet(); if (nfsd == (struct nfsd *)0) { - nsd->nsd_nfsd = nfsd = (struct nfsd *) + nfsd = (struct nfsd *) malloc(sizeof (struct nfsd), M_NFSD, M_WAITOK); bzero((caddr_t)nfsd, sizeof (struct nfsd)); + s = splnet(); + nsd->nsd_nfsd = nfsd; nfsd->nfsd_procp = p; TAILQ_INSERT_TAIL(&nfsd_head, nfsd, nfsd_chain); nfs_numnfsd++; - } + } else + s = splnet(); + /* * Loop getting rpc requests until SIGKILL. */ |