summaryrefslogtreecommitdiff
path: root/sys/kern/vfs_subr.c
diff options
context:
space:
mode:
authorSebastien Marie <semarie@cvs.openbsd.org>2021-10-20 06:35:41 +0000
committerSebastien Marie <semarie@cvs.openbsd.org>2021-10-20 06:35:41 +0000
commit47b23ec03efc1b932be87067956839394671386c (patch)
tree64e1ac372911b2a73e19c4350ee6c1f982ab6c15 /sys/kern/vfs_subr.c
parent16a20d6ce2c628aa63c5e43d8a3c1019425133c8 (diff)
revert vnode: remove VLOCKSWORK and check locking when vop_islocked != nullop
(both kernel and userland bits) GENERIC + VFSLCKDEBUG is broken with it.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r--sys/kern/vfs_subr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index f807760ea9d..794a4f2cf03 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_subr.c,v 1.307 2021/10/19 06:26:08 semarie Exp $ */
+/* $OpenBSD: vfs_subr.c,v 1.308 2021/10/20 06:35:39 semarie Exp $ */
/* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */
/*
@@ -1075,6 +1075,9 @@ 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) {
@@ -1927,7 +1930,7 @@ vinvalbuf(struct vnode *vp, int flags, struct ucred *cred, struct proc *p,
int s, error;
#ifdef VFSLCKDEBUG
- if ((vp->v_op->vop_islocked != nullop) && !VOP_ISLOCKED(vp))
+ if ((vp->v_flag & VLOCKSWORK) && !VOP_ISLOCKED(vp))
panic("%s: vp isn't locked, vp %p", __func__, vp);
#endif