Index: sys/geom/multipath/g_multipath.c =================================================================== --- sys/geom/multipath/g_multipath.c +++ sys/geom/multipath/g_multipath.c @@ -467,13 +467,23 @@ gp = pp->geom; + // Error used if we have no valid consumers + error = ENXIO; + LIST_FOREACH(cp, &gp->consumer, consumer) { + if (cp->index & MP_BAD) + continue; + error = g_access(cp, dr, dw, de); if (error) { badcp = cp; goto fail; } } + + if (error != 0) + return (error); + sc = gp->softc; sc->sc_opened += dr + dw + de; if (sc->sc_stopping && sc->sc_opened == 0) @@ -482,8 +492,8 @@ fail: LIST_FOREACH(cp, &gp->consumer, consumer) { - if (cp == badcp) - break; + if (cp == badcp || cp->index & MP_BAD) + continue; (void) g_access(cp, -dr, -dw, -de); } return (error);