summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2013-11-27 15:50:52 +0000
committerjsing <jsing@openbsd.org>2013-11-27 15:50:52 +0000
commit257f6615d668ba03ae1f65b604c7c37d74506ded (patch)
tree6b4ff315d0a805806db36ee44680422d10f95e34
parentAssert that we never have destinations cached for a non-VDIR vnode. (diff)
downloadwireguard-openbsd-257f6615d668ba03ae1f65b604c7c37d74506ded.tar.xz
wireguard-openbsd-257f6615d668ba03ae1f65b604c7c37d74506ded.zip
Defer the v_type initialisation until after the vnode has been purged from
the namecache. Changing the v_type between cache_enter() and cache_purge() results in bad things happening. ok beck@
-rw-r--r--sys/kern/vfs_subr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 737c750128d..e6a0f13a91c 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.208 2013/10/02 21:29:21 sf Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.209 2013/11/27 15:50:52 jsing Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -395,8 +395,8 @@ getnewvnode(enum vtagtype tag, struct mount *mp, struct vops *vops,
vp->v_flag = 0;
vp->v_socket = 0;
}
- vp->v_type = VNON;
cache_purge(vp);
+ vp->v_type = VNON;
vp->v_tag = tag;
vp->v_op = vops;
insmntque(vp, mp);