summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_acct.c11
-rw-r--r--sys/kern/vfs_vnops.c5
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 78df7864f15..9ebd7b95949 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_acct.c,v 1.15 2004/06/24 19:35:24 tholo Exp $ */
+/* $OpenBSD: kern_acct.c,v 1.16 2005/05/28 07:30:25 marius Exp $ */
/* $NetBSD: kern_acct.c,v 1.42 1996/02/04 02:15:12 christos Exp $ */
/*-
@@ -301,11 +301,12 @@ void
acct_thread(void *arg)
{
struct statfs sb;
+ struct proc *p = curproc;
for (;;) {
if (savacctp != NULL) {
if (savacctp->v_type == VBAD) {
- (void) vn_close(savacctp, FWRITE, NOCRED, NULL);
+ (void) vn_close(savacctp, FWRITE, NOCRED, p);
savacctp = NULL;
return;
}
@@ -317,7 +318,7 @@ acct_thread(void *arg)
}
} else if (acctp != NULL) {
if (acctp->v_type == VBAD) {
- (void) vn_close(acctp, FWRITE, NOCRED, NULL);
+ (void) vn_close(acctp, FWRITE, NOCRED, p);
acctp = NULL;
return;
}
@@ -339,9 +340,11 @@ void
acct_shutdown(void)
{
+ struct proc *p = curproc;
+
if (acctp != NULL || savacctp != NULL) {
vn_close((acctp != NULL ? acctp : savacctp), FWRITE,
- NOCRED, NULL);
+ NOCRED, p);
acctp = savacctp = NULL;
}
}
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 4c78380c633..7738b35a5ff 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vnops.c,v 1.45 2004/07/13 21:04:29 millert Exp $ */
+/* $OpenBSD: vfs_vnops.c,v 1.46 2005/05/28 07:30:25 marius Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.20 1996/02/04 02:18:41 christos Exp $ */
/*
@@ -228,8 +228,9 @@ vn_close(vp, flags, cred, p)
if (flags & FWRITE)
vp->v_writecount--;
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
error = VOP_CLOSE(vp, flags, cred, p);
- vrele(vp);
+ vput(vp);
return (error);
}