Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Check VOP_INACTIVE contract with a judicious assert.



details:   https://anonhg.NetBSD.org/src/rev/1f2133b30281
branches:  trunk
changeset: 824178:1f2133b30281
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri May 26 14:40:09 2017 +0000

description:
Check VOP_INACTIVE contract with a judicious assert.

diffstat:

 sys/kern/vfs_vnode.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 2835a68267ef -r 1f2133b30281 sys/kern/vfs_vnode.c
--- a/sys/kern/vfs_vnode.c      Fri May 26 14:39:20 2017 +0000
+++ b/sys/kern/vfs_vnode.c      Fri May 26 14:40:09 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_vnode.c,v 1.90 2017/05/26 14:39:20 riastradh Exp $ */
+/*     $NetBSD: vfs_vnode.c,v 1.91 2017/05/26 14:40:09 riastradh Exp $ */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -156,7 +156,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.90 2017/05/26 14:39:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_vnode.c,v 1.91 2017/05/26 14:40:09 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -1575,6 +1575,8 @@
         * would no longer function.
         */
        VOP_INACTIVE(vp, &recycle);
+       KASSERT((vp->v_vflag & VV_LOCKSWORK) == 0 ||
+           VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
        if (VOP_RECLAIM(vp)) {
                vnpanic(vp, "%s: cannot reclaim", __func__);
        }



Home | Main Index | Thread Index | Old Index