diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 8f7cf00cf80e..e6a7891b0705 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -1672,6 +1672,7 @@ spec_close(void *v) sd->sd_bdevvp = NULL; } if (count == 0) { + KASSERT(!sd->sd_closing); sd->sd_opened = false; sd->sd_closing = true; } @@ -1722,6 +1723,7 @@ spec_close(void *v) * reacquiring the lock would deadlock. */ mutex_enter(&device_lock); + KASSERT(!sd->sd_opened); KASSERT(sd->sd_closing); sd->sd_closing = false; cv_broadcast(&specfs_iocv);