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.
This commit is contained in:
Bruce Evans 1997-11-24 14:18:00 +00:00
parent a0f1e323d0
commit 638493a3c4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=31391
3 changed files with 21 additions and 12 deletions

View File

@ -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.
*/

View File

@ -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.
*/

View File

@ -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.
*/