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: Assert !closing on successful open.



details:   https://anonhg.NetBSD.org/src/rev/a6e2fdbb25ba
branches:  trunk
changeset: 368918:a6e2fdbb25ba
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Aug 12 17:06:01 2022 +0000

description:
specfs: Assert !closing on successful open.

- If there's a prior concurrent close, it must have interrupted this
  open.

- If there's a new concurrent close, it must wait until this open has
  released device_lock before it can revoke.

diffstat:

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

diffs (26 lines):

diff -r 3e49b686b809 -r a6e2fdbb25ba sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Fri Aug 12 17:05:49 2022 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Fri Aug 12 17:06:01 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.212 2022/08/12 17:05:49 riastradh Exp $       */
+/*     $NetBSD: spec_vnops.c,v 1.213 2022/08/12 17:06:01 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.212 2022/08/12 17:05:49 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.213 2022/08/12 17:06:01 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -967,6 +967,7 @@
                KASSERTMSG(sn->sn_opencnt <= sd->sd_opencnt,
                    "sn_opencnt=%u > sd_opencnt=%u",
                    sn->sn_opencnt, sd->sd_opencnt);
+               KASSERT(!sd->sd_closing);
                sd->sd_opened = true;
        } else if (sd->sd_opencnt == 1 && sd->sd_opened) {
                /*



Home | Main Index | Thread Index | Old Index