From owner-p4-projects@FreeBSD.ORG Mon Aug 13 20:12:06 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4A64316A468; Mon, 13 Aug 2007 20:12:06 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0317616A421 for ; Mon, 13 Aug 2007 20:12:06 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E51E413C4D3 for ; Mon, 13 Aug 2007 20:12:05 +0000 (UTC) (envelope-from lulf@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id l7DKC5ju098533 for ; Mon, 13 Aug 2007 20:12:05 GMT (envelope-from lulf@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id l7DKC5it098530 for perforce@freebsd.org; Mon, 13 Aug 2007 20:12:05 GMT (envelope-from lulf@FreeBSD.org) Date: Mon, 13 Aug 2007 20:12:05 GMT Message-Id: <200708132012.l7DKC5it098530@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to lulf@FreeBSD.org using -f From: Ulf Lilleengen To: Perforce Change Reviews Cc: Subject: PERFORCE change 125119 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2007 20:12:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=125119 Change 125119 by lulf@lulf_carrot on 2007/08/13 20:11:11 - Okay, it wasn't that hard. Rebuild with added subdisk for growing works now. - Also cleanup some warnings. Affected files ... .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_create.c#11 edit .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_init.c#25 edit .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_plex.c#27 edit .. //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_raid5.c#15 edit Differences ... ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_create.c#11 (text+ko) ==== @@ -253,12 +253,12 @@ return (GV_ERR_CREATE); } - if (p->org == GV_PLEX_RAID5 && p->state == GV_PLEX_DEGRADED) { +/* if (p->org == GV_PLEX_RAID5 && p->state == GV_PLEX_DEGRADED) { printf("VINUM: can't add subdisk to %s, rebuild plex before " " adding subdisks\n", p->name); g_free(s); return (0); - } + }*/ /* * First we give the subdisk to the drive, to handle autosized ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_init.c#25 (text+ko) ==== @@ -100,7 +100,7 @@ { struct gv_volume *v; struct gv_sd *s; - int error, grow, rebuild; + int error, grow; KASSERT(p != NULL, ("gv_start_plex: NULL p")); @@ -142,7 +142,6 @@ gv_start_vol(struct gv_volume *v) { struct gv_plex *p; - struct gv_sd *s; int error; KASSERT(v != NULL, ("gv_start_vol: NULL v")); ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_plex.c#27 (text+ko) ==== @@ -965,7 +965,7 @@ { struct gv_sd *s; int error, flags; - off_t offset, plexsize; + off_t offset; error = bp->bio_error; flags = bp->bio_cflags; ==== //depot/projects/soc2007/lulf/gvinum_fixup/sys/geom/vinum/geom_vinum_raid5.c#15 (text+ko) ==== @@ -194,6 +194,9 @@ /* Skip the parity subdisk. */ if (s == parity) continue; + /* Skip growing subdisks. */ + if (s->flags & GV_SD_GROW) + continue; cbp = gv_raid5_clone_bio(bp, s, wp, NULL, 1); if (cbp == NULL) @@ -286,6 +289,10 @@ if (s == broken) continue; + /* Skip growing subdisks. */ + if (s->flags & GV_SD_GROW) + continue; + cbp = gv_raid5_clone_bio(bp, s, wp, NULL, 1); if (cbp == NULL) return (ENOMEM); @@ -320,7 +327,7 @@ struct gv_sd *broken, *original, *parity, *s; struct gv_bioq *bq; struct bio *cbp; - int i, psdno, sdno, type; + int i, psdno, sdno, type, grow; off_t real_len, real_off; gp = bp->bio_to->geom; @@ -342,17 +349,17 @@ */ /* If we're over, we must use the old. */ if (boff >= p->synced) { - gv_raid5_offset(p, boff, bcount, &real_off, &real_len, - &sdno, &psdno, 1); + grow = 1; /* Or if over the resized offset, we use all drives. */ } else if (boff + bcount <= p->synced) { - gv_raid5_offset(p, boff, bcount, &real_off, &real_len, - &sdno, &psdno, 0); + grow = 0; /* Else, we're in the middle, and must wait a bit. */ } else { bioq_disksort(p->rqueue, bp); return (0); } + gv_raid5_offset(p, boff, bcount, &real_off, &real_len, + &sdno, &psdno, grow); /* Find the right subdisks. */ i = 0; @@ -408,6 +415,9 @@ /* Skip the broken subdisk. */ if (s == broken) continue; + /* Skip growing if within offset. */ + if (grow && s->flags & GV_SD_GROW) + continue; cbp = gv_raid5_clone_bio(bp, s, wp, NULL, 1); if (cbp == NULL) return (ENOMEM); @@ -444,6 +454,9 @@ /* Skip the broken and the parity subdisk. */ if ((s == broken) || (s == parity)) continue; + /* Skip growing if within offset. */ + if (grow && s->flags & GV_SD_GROW) + continue; cbp = gv_raid5_clone_bio(bp, s, wp, NULL, 1); if (cbp == NULL)