diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c index 8b4ed335880a..e6295f9786de 100644 --- a/sys/miscfs/specfs/spec_vnops.c +++ b/sys/miscfs/specfs/spec_vnops.c @@ -789,8 +789,13 @@ spec_open(void *v) * * Treat zero opencnt with non-NULL mountpoint as open. * This may happen after forced detach of a mounted device. + * + * Also treat sd_closing, meaning there is a concurrent + * close in progress, as still open. */ - if (sd->sd_opencnt != 0 || sd->sd_mountpoint != NULL) { + if (sd->sd_opencnt != 0 || + sd->sd_mountpoint != NULL || + sd->sd_closing) { error = EBUSY; break; }