summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_subr.c7
-rw-r--r--sys/kern/vfs_vops.c16
2 files changed, 12 insertions, 11 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index c752dd99e9e..f807760ea9d 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.306 2021/08/31 15:31:28 claudio Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.307 2021/10/19 06:26:08 semarie Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1075,9 +1075,6 @@ vclean(struct vnode *vp, int flags, struct proc *p)
vp->v_op = &dead_vops;
VN_KNOTE(vp, NOTE_REVOKE);
vp->v_tag = VT_NON;
-#ifdef VFSLCKDEBUG
- vp->v_flag &= ~VLOCKSWORK;
-#endif
mtx_enter(&vnode_mtx);
vp->v_lflag &= ~VXLOCK;
if (vp->v_lflag & VXWANT) {
@@ -1930,7 +1927,7 @@ vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, struct proc *p,
int s, error;
#ifdef VFSLCKDEBUG
- if ((vp->v_flag & VLOCKSWORK) && !VOP_ISLOCKED(vp))
+ if ((vp->v_op->vop_islocked != nullop) && !VOP_ISLOCKED(vp))
panic("%s: vp isn't locked, vp %p", __func__, vp);
#endif
diff --git a/sys/kern/vfs_vops.c b/sys/kern/vfs_vops.c
index caf2dc327bf..c951368c158 100644
--- a/sys/kern/vfs_vops.c
+++ b/sys/kern/vfs_vops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_vops.c,v 1.31 2021/10/04 08:11:02 claudio Exp $ */
+/* $OpenBSD: vfs_vops.c,v 1.32 2021/10/19 06:26:09 semarie Exp $ */
/*
* Copyright (c) 2010 Thordur I. Bjornsson <thib@openbsd.org>
*
@@ -48,11 +48,15 @@
#include <sys/systm.h>
#ifdef VFSLCKDEBUG
-#define ASSERT_VP_ISLOCKED(vp) do { \
- if (((vp)->v_flag & VLOCKSWORK) && !VOP_ISLOCKED(vp)) { \
- VOP_PRINT(vp); \
- panic("vp not locked"); \
- } \
+#define ASSERT_VP_ISLOCKED(vp) do { \
+ struct vnode *_vp = (vp); \
+ int r; \
+ if (_vp->v_op->vop_islocked == nullop) \
+ break; \
+ if ((r = VOP_ISLOCKED(_vp)) != LK_EXCLUSIVE) { \
+ VOP_PRINT(_vp); \
+ panic("%s: vp not locked, vp %p, %d", __func__, _vp, r);\
+ } \
} while (0)
#else
#define ASSERT_VP_ISLOCKED(vp) /* nothing */