Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dkwedge dk(4): Assert parent is open in dklastclose.



details:   https://anonhg.NetBSD.org/src/rev/80b8a3ae53c6
branches:  trunk
changeset: 369573:80b8a3ae53c6
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 22 00:20:18 2022 +0000

description:
dk(4): Assert parent is open in dklastclose.

It is not possible for us to be closing a wedge whose parent is not
open by at least this wedge.

diffstat:

 sys/dev/dkwedge/dk.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 6dd5eb695a9a -r 80b8a3ae53c6 sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Mon Aug 22 00:20:03 2022 +0000
+++ b/sys/dev/dkwedge/dk.c      Mon Aug 22 00:20:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dk.c,v 1.118 2022/08/22 00:20:03 riastradh Exp $       */
+/*     $NetBSD: dk.c,v 1.119 2022/08/22 00:20:18 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.118 2022/08/22 00:20:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.119 2022/08/22 00:20:18 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -1223,6 +1223,7 @@
 
        KASSERT(mutex_owned(&sc->sc_dk.dk_openlock));
        KASSERT(mutex_owned(&sc->sc_parent->dk_rawlock));
+       KASSERT(sc->sc_parent->dk_rawopens > 0);
 
        mode = sc->sc_mode;
 



Home | Main Index | Thread Index | Old Index