diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index cf8671d34f4d..aea06f68ade8 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -601,11 +601,9 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int dce) * are probably just ahead of the event telling us that. Fail * now rather than having to unravel this later. */ - if (cp->geom->spoiled != NULL && cp->spoiled) { - KASSERT(dcr <= 0, ("spoiled but dcr = %d", dcr)); - KASSERT(dcw <= 0, ("spoiled but dcw = %d", dcw)); - KASSERT(dce <= 0, ("spoiled but dce = %d", dce)); - } + if (cp->geom->spoiled != NULL && cp->spoiled && + (dcr > 0 || dcw > 0 || dce > 0)) + return (ENXIO); /* * Figure out what counts the provider would have had, if this