Index: geom_subr.c =================================================================== RCS file: /private/FreeBSD/src/sys/geom/geom_subr.c,v retrieving revision 1.75 diff -u -p -r1.75 geom_subr.c --- geom_subr.c 18 Mar 2004 07:17:10 -0000 1.75 +++ geom_subr.c 4 Jun 2004 10:29:46 -0000 @@ -57,11 +57,26 @@ struct class_list_head g_classes = LIST_ static struct g_tailq_head geoms = TAILQ_HEAD_INITIALIZER(geoms); char *g_wait_event, *g_wait_up, *g_wait_down, *g_wait_sim; +static void g_spoil_event(void *arg, int flag); + struct g_hh00 { struct g_class *mp; int error; }; +static void +g_force_spoil(struct g_provider *pp) +{ + struct g_consumer *cp, *tmpcp; + + LIST_FOREACH_SAFE(cp, &pp->geom->consumer, consumer, tmpcp) { + if (cp->provider != NULL && cp->spoiled) { + g_cancel_event(cp->provider); + g_spoil_event(cp->provider, 0); + } + } +} + /* * This event offers a new class a chance to taste all preexisting providers. */ @@ -103,6 +118,12 @@ g_load_class(void *arg, int flag) continue; LIST_FOREACH(gp, &mp2->geom, geom) { LIST_FOREACH(pp, &gp->provider, provider) { + /* + * If any of consumers, that belong to this geom + * are marked as beeing spoiled, call spoil + * event before we give this provider for taste. + */ + g_force_spoil(pp); mp->taste(mp, pp, 0); g_topology_assert(); } @@ -364,6 +385,12 @@ g_new_provider_event(void *arg, int flag i = 0; if (!i) continue; + /* + * If any of consumers, that belong to this provider's geom + * are marked as beeing spoiled, call spoil event before we + * give this provider for taste. + */ + g_force_spoil(pp); mp->taste(mp, pp, 0); g_topology_assert(); }