Date: Sun, 7 Jan 2007 05:34:52 GMT From: Matt Jacob <mjacob@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 112633 for review Message-ID: <200701070534.l075YqDb084465@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112633 Change 112633 by mjacob@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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701070534.l075YqDb084465>