PERFORCE change 112633 for review

Matt Jacob mjacob at FreeBSD.org
Sat Jan 6 21:34:53 PST 2007


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

Change 112633 by mjacob at mjexp on 2007/01/07 05:34:22

	Make sure we don't add the same disk twice. Note when
	we destroy a multipath geom.

Affected files ...

.. //depot/projects/mjexp/sys/geom/multipath/g_multipath.c#12 edit

Differences ...

==== //depot/projects/mjexp/sys/geom/multipath/g_multipath.c#12 (text+ko) ====

@@ -291,6 +291,19 @@
 	sc = gp->softc;
 	KASSERT(sc, ("no softc"));
 
+	/*
+	 * Make sure that the passed provider isn't already attached
+	 */
+	LIST_FOREACH(cp, &gp->consumer, consumer) {
+		if (cp->provider == pp) {
+			break;
+		}
+	}
+	if (cp) {
+		printf("GEOM_MULTIPATH: provider %s already attached to %s\n",
+		    pp->name, gp->name);
+		return (EEXIST);
+	}
 	nxtcp = LIST_FIRST(&gp->consumer);
 	cp = g_new_consumer(gp);
 	if (cp == NULL) {
@@ -342,6 +355,7 @@
 	if (pp != NULL && (pp->acr != 0 || pp->acw != 0 || pp->ace != 0)) {
 		return (EBUSY);
 	}
+	printf("GEOM_MULTIPATH: destroying %s\n", gp->name);
 	g_free(gp->softc);
 	gp->softc = NULL;
 	g_wither_geom(gp, ENXIO);


More information about the p4-projects mailing list