PERFORCE change 82014 for review

soc-cjones soc-cjones at FreeBSD.org
Mon Aug 15 07:38:46 GMT 2005


http://perforce.freebsd.org/chv.cgi?CH=82014

Change 82014 by soc-cjones at soc-cjones_ishtar on 2005/08/15 07:37:47

	Woohoo, 'move' now works!  At least, for mirrored plexes.  It still dies for RAID-5, and will lose data for stripes.

Affected files ...

.. //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_move.c#8 edit
.. //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_plex.c#3 edit

Differences ...

==== //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_move.c#8 (text+ko) ====

@@ -172,6 +172,7 @@
         int err;
 	struct gv_drive *d;
 	struct gv_sd *s2;
+	struct gv_plex *p;
 	char errstr[ERRBUFSIZ];
 
         g_topology_assert();
@@ -232,12 +233,23 @@
 	strncpy(s2->plex, s->plex, GV_MAXPLEXNAME);
 	printf("gv_move_sd: L\n");
 	s2->plex_offset = s->plex_offset;
-	printf("gv_move_sd: M\n"); /* DIES HERE */
+	printf("gv_move_sd: M\n");
 	LIST_INSERT_BEFORE(s, s2, in_plex);
+	printf("gv_move_sd: M2\n");
+	p = gv_find_plex(sc, s2->plex); /* We know it's not null, since the plex exists. */
+	p->sdcount--;
+	p->state = GV_PLEX_DEGRADED;
+	LIST_REMOVE(s, in_plex); /* Get rid of the current sd. */
+	s->plex_sc = NULL;
 	printf("gv_move_sd: N\n");
-	gv_rm_sd(sc, req, s, flags);
-	printf("gv_move_sd: O\n");
-	
+	err = gv_rm_sd(sc, req, s, flags);
+	printf("gv_move_sd: O, err = %d\n", err);
+	if (err)
+	    return (err);
+
+	gv_sd_to_plex(p, s2, 0);
+	printf("gv_move_sd: P\n");
+
 	gv_save_config_all(sc);	
 	printf("gv_move_sd: done gv_move_sd\n");
 	return (0);

==== //depot/projects/soc2005/gvinum/src/sys/geom/vinum/geom_vinum_plex.c#3 (text+ko) ====

@@ -567,7 +567,7 @@
  			if (err) {
 				printf("GEOM_VINUM: plex request failed for ");
 				g_print_bio(bp);
-				printf("\n");
+				printf(", err = %d\n", err);
 				TAILQ_FOREACH_SAFE(bq, &wp->bits, queue, bq2) {
 					TAILQ_REMOVE(&wp->bits, bq, queue);
 					g_free(bq);
@@ -629,7 +629,7 @@
 			if (err) {
 				printf("GEOM_VINUM: plex request failed for ");
 				g_print_bio(bp);
-				printf("\n");
+				printf(", err = %d\n", err);
 				cbp = bp->bio_driver1;
 				while (cbp != NULL) {
 					pbp = cbp->bio_caller1;


More information about the p4-projects mailing list