summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_aiod.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-11-03 13:50:25 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-11-03 13:50:25 +0000
commit8f62496807c6e264110c22be6f07fe0b8ed84cca (patch)
tree16310ff262ab93212d28092ccd4f99d0d22f8682 /sys/nfs/nfs_aiod.c
parentcbf0c91b0c8b7f9236c6e7c6d8c2dddcfdc0846c (diff)
Fix bogus kthread_create() usage leading to wrong struct proc * pointer
usage in the nfs kthreads. Spotted by fgsch@, similar diff by guenther@, ok guenther@
Diffstat (limited to 'sys/nfs/nfs_aiod.c')
-rw-r--r--sys/nfs/nfs_aiod.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/nfs/nfs_aiod.c b/sys/nfs/nfs_aiod.c
index 3a9451b021d..ada3669560e 100644
--- a/sys/nfs/nfs_aiod.c
+++ b/sys/nfs/nfs_aiod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_aiod.c,v 1.4 2009/08/27 23:39:46 thib Exp $ */
+/* $OpenBSD: nfs_aiod.c,v 1.5 2013/11/03 13:50:24 miod Exp $ */
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -72,11 +72,8 @@ nfs_aiod(void *arg)
{
struct nfs_aiod *aiod;
struct nfsmount *nmp;
- struct proc *p;
struct buf *bp;
- p = (struct proc *)arg;
-
aiod = malloc(sizeof(*aiod), M_TEMP, M_WAITOK|M_ZERO);
mtx_enter(&nfs_aiodl_mtx);
LIST_INSERT_HEAD(&nfs_aiods_all, aiod, nad_all);
@@ -165,7 +162,6 @@ int
nfs_set_naiod(int howmany)
{
struct nfs_aiod *aiod;
- struct proc *p;
int want, error;
KASSERT(howmany >= 0);
@@ -181,7 +177,7 @@ nfs_set_naiod(int howmany)
/* Add more. */
want = min(want, NFS_MAXASYNCDAEMON);
while (want > 0) {
- error = kthread_create(nfs_aiod, p, &p, "nfsaio");
+ error = kthread_create(nfs_aiod, NULL, NULL, "nfsaio");
if (error)
return (error);
want--;