summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2005-11-18 13:25:41 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2005-11-18 13:25:41 +0000
commit41019b97cc8715203da28631864f7ea665b0527a (patch)
tree39242f1f86934c35ebfc046224108e55bc0bdb10 /sys
parentcaca0b33d0946dd88a5409fa92c8ff4f9c3db60c (diff)
Work around yet another race on non-locking file systems: when calling
VOP_INACTIVE() in vrele() and vput(), we may sleep. Since there's no locking of any kind, someone can vget() the vnode and vrele() it while we sleep, beating us in getting the vnode on the free list.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_subr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 79fc2b77b34..1525d8cda1b 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.117 2005/11/08 15:50:01 pedro Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.118 2005/11/18 13:25:40 pedro Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -769,7 +769,7 @@ vput(struct vnode *vp)
simple_lock(&vp->v_interlock);
- if (vp->v_usecount == 0)
+ if (vp->v_usecount == 0 && !(vp->v_bioflag & VBIOONFREELIST))
vputonfreelist(vp);
simple_unlock(&vp->v_interlock);
@@ -816,7 +816,7 @@ vrele(struct vnode *vp)
simple_lock(&vp->v_interlock);
- if (vp->v_usecount == 0)
+ if (vp->v_usecount == 0 && !(vp->v_bioflag & VBIOONFREELIST))
vputonfreelist(vp);
simple_unlock(&vp->v_interlock);