Date: Mon, 25 Jun 2007 16:34:38 GMT From: Ulf Lilleengen <lulf@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 122284 for review Message-ID: <200706251634.l5PGYcYP066492@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=122284 Change 122284 by lulf@lulf_carrot on 2007/06/25 16:33:38 - Add a different flag to be used for rebuild, so we won't confuse different parts of gvinum. Affected files ... .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_init.c#11 edit .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_plex.c#14 edit .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_raid5.c#7 edit .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_var.h#15 edit Differences ... ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_init.c#11 (text+ko) ==== @@ -198,6 +198,7 @@ LIST_FOREACH(p, &v->plexes, in_volume) { if ((p == up) || (p->state == GV_PLEX_UP)) continue; + /* XXX: Should we check if rebuilding too? */ if (p->flags & GV_PLEX_SYNCING) { return (EINPROGRESS); } @@ -222,9 +223,10 @@ /* if (gv_provider_is_open(p->vol_sc->provider)) return (EBUSY);*/ - if (p->flags & GV_PLEX_SYNCING) + if (p->flags & GV_PLEX_SYNCING || + p->flags & GV_PLEX_REBUILDING) return (EINPROGRESS); - p->flags |= GV_PLEX_SYNCING; + p->flags |= GV_PLEX_REBUILDING; p->synced = 0; gv_parity_request(p, GV_BIO_REBUILD, 0); ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_plex.c#14 (text+ko) ==== @@ -65,6 +65,9 @@ addr = bp->bio_data; boff = bp->bio_offset; + if (!(bp->bio_cflags & GV_BIO_REBUILD)) + printf("New BIO!, not rebuild\n"); + /* Walk over the whole length of the request, we might split it up. */ while (bcount > 0) { wp = NULL; @@ -722,7 +725,7 @@ /* We're finished. */ printf("VINUM: rebuild of %s finished\n", p->name); gv_save_config(p->vinumconf); - p->flags &= ~GV_PLEX_SYNCING; + p->flags &= ~GV_PLEX_REBUILDING; p->synced = 0; /* Try to up all subdisks. */ LIST_FOREACH(s, &p->subdisks, in_plex) ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_raid5.c#7 (text+ko) ==== @@ -376,7 +376,7 @@ KASSERT(wp->length >= 0, ("gv_build_raid5_request: wp->length < 0")); - if ((p->flags & GV_PLEX_SYNCING) && (boff + real_len < p->synced)) + if ((p->flags & GV_PLEX_REBUILDING) && (boff + real_len < p->synced)) type = REQ_TYPE_NORMAL; switch (bp->bio_cmd) { ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_var.h#15 (text+ko) ==== @@ -323,6 +323,7 @@ #define GV_PLEX_THREAD_DIE 0x08 /* Signal the RAID5 thread to die. */ #define GV_PLEX_THREAD_DEAD 0x10 /* The RAID5 thread has died. */ #define GV_PLEX_NEWBORN 0x20 /* The plex was just created. */ +#define GV_PLEX_REBUILDING 0x40 /* The plex is rebuilding. */ off_t synced; /* Count of synced bytes. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706251634.l5PGYcYP066492>