summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2021-10-23 14:08:47 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2021-10-23 14:08:47 +0000
commitf2b4163eb38a2025d8a4612e8c712f304a6481f9 (patch)
tree09291e587c515d2f9399c18b19359bd8b1a3825d /sys
parent0f1b886806ff21a034bd97c7bac19cda4a8e5e86 (diff)
Assert that the KERNEL_LOCK() is held in vref(9).
This is a guard against pushing the lock too far in UVM's vnode land. ok beck@
Diffstat (limited to 'sys')
-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 011e7597269..af78c42526e 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.309 2021/10/21 09:59:14 claudio Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.310 2021/10/23 14:08:46 mpi Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -689,6 +689,8 @@ vget(struct vnode *vp, int flags)
void
vref(struct vnode *vp)
{
+ KERNEL_ASSERT_LOCKED();
+
#ifdef DIAGNOSTIC
if (vp->v_usecount == 0)
panic("vref used where vget required");