summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2009-12-17 16:44:13 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2009-12-17 16:44:13 +0000
commitf14c918ed15207178a34b27ded03dc260f1cef2a (patch)
tree50cf3acd628cbd86d1c0dde9c1c159af43f0e21e /sys/kern
parent8820ecd58e1bb5a04d8f7198f52debf2aae1b05a (diff)
if anyone vref()s a VNON vnode, panic. This should not happen.
Written while trying to debug the nfs_inactive panics. Turns out it never got hit, but it's a useful check to have. ok beck@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_subr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 698a523b42f..9e804880ad0 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.183 2009/08/17 13:11:58 jasper Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.184 2009/12/17 16:44:12 oga Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -630,6 +630,8 @@ vref(struct vnode *vp)
#ifdef DIAGNOSTIC
if (vp->v_usecount == 0)
panic("vref used where vget required");
+ if (vp->v_type == VNON)
+ panic("vref on a VNON vnode");
#endif
vp->v_usecount++;
}