Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2007 20:12:05 GMT
From:      Ulf Lilleengen <lulf@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 125119 for review
Message-ID:  <200708132012.l7DKC5it098530@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708132012.l7DKC5it098530>