Module Name: src Committed By: riastradh Date: Mon Mar 28 12:36:27 UTC 2022
Modified Files: src/sys/miscfs/specfs: spec_vnops.c Log Message: specfs: Paranoia: Assert opencnt is zero on reclaim. To generate a diff of this commit: cvs rdiff -u -r1.199 -r1.200 src/sys/miscfs/specfs/spec_vnops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/miscfs/specfs/spec_vnops.c diff -u src/sys/miscfs/specfs/spec_vnops.c:1.199 src/sys/miscfs/specfs/spec_vnops.c:1.200 --- src/sys/miscfs/specfs/spec_vnops.c:1.199 Mon Mar 28 12:36:18 2022 +++ src/sys/miscfs/specfs/spec_vnops.c Mon Mar 28 12:36:26 2022 @@ -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 @@ spec_reclaim(void *v) } */ *ap = v; struct vnode *vp = ap->a_vp; + KASSERT(vp->v_specnode->sn_opencnt == 0); + VOP_UNLOCK(vp); KASSERT(vp->v_mount == dead_rootmount);