From 5dae52591be4cde8a831fafb8ebf60f54803d1e4 Mon Sep 17 00:00:00 2001 From: le Date: Sat, 18 Sep 2004 18:03:20 +0000 Subject: Single concat or striped plexes don't need no special initialization if their subdisks are all available, so let them be brought up. --- sys/geom/vinum/geom_vinum_init.c | 6 ++++++ sys/geom/vinum/geom_vinum_state.c | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'sys/geom/vinum') diff --git a/sys/geom/vinum/geom_vinum_init.c b/sys/geom/vinum/geom_vinum_init.c index 382ea15..60c408c 100644 --- a/sys/geom/vinum/geom_vinum_init.c +++ b/sys/geom/vinum/geom_vinum_init.c @@ -127,6 +127,7 @@ void gv_start_vol(struct gv_volume *v) { struct gv_plex *p; + struct gv_sd *s; KASSERT(v != NULL, ("gv_start_vol: NULL v")); @@ -145,6 +146,11 @@ gv_start_vol(struct gv_volume *v) default: return; } + } else { + LIST_FOREACH(s, &p->subdisks, in_plex) { + gv_set_sd_state(s, GV_SD_UP, + GV_SETSTATE_CONFIG); + } } } else gv_sync(v); diff --git a/sys/geom/vinum/geom_vinum_state.c b/sys/geom/vinum/geom_vinum_state.c index 2f9ad59..4e17108 100644 --- a/sys/geom/vinum/geom_vinum_state.c +++ b/sys/geom/vinum/geom_vinum_state.c @@ -138,10 +138,22 @@ gv_set_sd_state(struct gv_sd *s, int newstate, int flags) case GV_SD_STALE: /* - * A stale subdisk can't be brought up directly, it - * needs to be revived or initialized first. + * A stale subdisk can be brought up only if it's part + * of a concat or striped plex that's the only one in a + * volume, or if the subdisk isn't attached to a plex. + * Otherwise it needs to be revived or initialized + * first. */ - /* FALLTHROUGH */ + p = s->plex_sc; + if (p == NULL) + break; + + if ((p->org != GV_PLEX_RAID5) && + (p->vol_sc->plexcount == 1)) + break; + else + return (-1); + default: return (-1); } -- cgit v1.1