diff options
author | 1998-10-13 16:42:01 +0000 | |
---|---|---|
committer | 1998-10-13 16:42:01 +0000 | |
commit | c2476e78b6869a326d27107b66f37051c9b64acd (patch) | |
tree | d1208af77810c73943d474cc088633a2fb80a8ef /sys/kern/vfs_subr.c | |
parent | sync (diff) | |
download | wireguard-openbsd-c2476e78b6869a326d27107b66f37051c9b64acd.tar.xz wireguard-openbsd-c2476e78b6869a326d27107b66f37051c9b64acd.zip |
In vrele, vget, reinstate to following order
- VNODE gets placed on free list
- VOP_INACTIVE is called
This was the original order. It was changed in an earlier patch due to
a race condition in non-locking FSes (like NFS) between getnewvnode
and inactive. However, the modified order had its own race conditions, so
it turned out not to be a good choice.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 7968dcbb181..dc87e22f497 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.22 1998/08/30 23:34:36 csapuntz Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.23 1998/10/13 16:42:01 csapuntz Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -768,11 +768,9 @@ vput(vp) panic("vput: ref cnt"); } #endif - VOP_INACTIVE(vp, p); - - if (vp->v_usecount == 0) - vputonfreelist(vp); + vputonfreelist(vp); + VOP_INACTIVE(vp, p); simple_unlock(&vp->v_interlock); } @@ -802,12 +800,11 @@ vrele(vp) panic("vrele: ref cnt"); } #endif + vputonfreelist(vp); + if (vn_lock(vp, LK_EXCLUSIVE |LK_INTERLOCK, p) == 0) VOP_INACTIVE(vp, p); - if (vp->v_usecount == 0) - vputonfreelist(vp); - simple_unlock(&vp->v_interlock); } |