Assert that the KERNEL_LOCK() is held in vref(9).
authormpi <mpi@openbsd.org>
Sat, 23 Oct 2021 14:08:46 +0000 (14:08 +0000)
committermpi <mpi@openbsd.org>
Sat, 23 Oct 2021 14:08:46 +0000 (14:08 +0000)
This is a guard against pushing the lock too far in UVM's vnode land.

ok beck@

sys/kern/vfs_subr.c

index 011e759..af78c42 100644 (file)
@@ -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");