summaryrefslogtreecommitdiff
path: root/sys/nfs
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-12-05 12:18:01 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-12-05 12:18:01 +0000
commit44e707728c3054de0a9f38f5a360830f082a4720 (patch)
tree51844ceca538c45e187fd8daf33b114f7d49c98b /sys/nfs
parentf9169d9683f9836cfa6cfb5de1b232145aeb7b9e (diff)
Make sure we only initialize the nfsrv_descript_pl pool once.
Re-initializing the pool everytime nfsd(8) terminates is very bad since it screws up the list of pools resulting in infinite loops when traversing that list. Issue found by Daniel Melameth. ok deraadt@
Diffstat (limited to 'sys/nfs')
-rw-r--r--sys/nfs/nfs_syscalls.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index 0e583b7ba19..03edee3e145 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.91 2010/08/07 03:50:02 krw Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.92 2010/12/05 12:18:00 kettenis Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -549,8 +549,9 @@ nfsrv_init(int terminating)
M_WAITOK|M_ZERO);
TAILQ_INSERT_HEAD(&nfssvc_sockhead, nfs_udpsock, ns_chain);
- pool_init(&nfsrv_descript_pl, sizeof(struct nfsrv_descript), 0, 0, 0,
- "ndscpl", &pool_allocator_nointr);
+ if (!terminating)
+ pool_init(&nfsrv_descript_pl, sizeof(struct nfsrv_descript),
+ 0, 0, 0, "ndscpl", &pool_allocator_nointr);
}
#endif /* NFSSERVER */