diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-08-12 17:06:01 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-08-12 17:06:01 +0000 |
| commit | a09d95c96c0a7fc46ed16c26baf067157845fee4 (patch) | |
| tree | b493099eef07cd5357a537a118d8360213ccad13 /sys/miscfs | |
| parent | 572a664b5ca48af9eb6fc447e68b7b98f4f004d4 (diff) | |
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 (limited to 'sys/miscfs')
| -rw-r--r-- | sys/miscfs/specfs/spec_vnops.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 45643959c6a..3c130d7abe8 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -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 @@ spec_open(void *v) 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) { /* |
