Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/specfs specfs: Paranoia: Assert opencnt is zero o...



details:   https://anonhg.NetBSD.org/src/rev/f75bbaa58e25
branches:  trunk
changeset: 364510:f75bbaa58e25
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Mar 28 12:36:26 2022 +0000

description:
specfs: Paranoia: Assert opencnt is zero on reclaim.

diffstat:

 sys/miscfs/specfs/spec_vnops.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r ccc17d26c25e -r f75bbaa58e25 sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Mon Mar 28 12:36:18 2022 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Mon Mar 28 12:36:26 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.199 2022/03/28 12:36:18 riastradh Exp $       */
+/*     $NetBSD: spec_vnops.c,v 1.200 2022/03/28 12:36:26 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.199 2022/03/28 12:36:18 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.200 2022/03/28 12:36:26 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -1204,6 +1204,8 @@
        } */ *ap = v;
        struct vnode *vp = ap->a_vp;
 
+       KASSERT(vp->v_specnode->sn_opencnt == 0);
+
        VOP_UNLOCK(vp);
 
        KASSERT(vp->v_mount == dead_rootmount);



Home | Main Index | Thread Index | Old Index