From owner-p4-projects@FreeBSD.ORG Tue Dec 12 17:59:06 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C949216A655; Tue, 12 Dec 2006 17:59:05 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A026E16A64A for ; Tue, 12 Dec 2006 17:59:05 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFCC443CCB for ; Tue, 12 Dec 2006 17:57:31 +0000 (GMT) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kBCHwtMJ008780 for ; Tue, 12 Dec 2006 17:58:55 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kBCHwtbU008774 for perforce@freebsd.org; Tue, 12 Dec 2006 17:58:55 GMT (envelope-from mjacob@freebsd.org) Date: Tue, 12 Dec 2006 17:58:55 GMT Message-Id: <200612121758.kBCHwtbU008774@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 111564 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: Tue, 12 Dec 2006 17:59:06 -0000 http://perforce.freebsd.org/chv.cgi?CH=111564 Change 111564 by mjacob@mjexp on 2006/12/12 17:58:31 More baby steps. Now have something that doesn't crash right away. Affected files ... .. //depot/projects/mjexp/sys/geom/multipath/g_multipath.c#2 edit Differences ... ==== //depot/projects/mjexp/sys/geom/multipath/g_multipath.c#2 (text+ko) ==== @@ -126,10 +126,27 @@ g_topology_assert(); + /* + * Check to make sure parameters from the two providers are the same + */ + if (pp0->mediasize != pp1->mediasize) { + gctl_error(req, "Provider %s has mediasize %zx; Provider %s " + "has mediasize %zx", pp0->name, (intmax_t) pp0->mediasize, + pp1->name, (intmax_t) pp1->mediasize); + return (EINVAL); + } + if (pp0->sectorsize != pp1->sectorsize) { + gctl_error(req, "Provider %s has sectorsize %u; Provider %s " + "has sectorsize %u", pp0->name, pp0->sectorsize, + pp1->name, pp1->sectorsize); + return (EINVAL); + } + gp = NULL; newpp = NULL; cp0 = cp1 = NULL; + LIST_FOREACH(gp, &mp->geom, geom) { if (strcmp(gp->name, mpname) == 0) { gctl_error(req, "Provider %s already exists", mpname); @@ -155,6 +172,8 @@ error = ENOMEM; goto fail; } + newpp->mediasize = pp0->mediasize; + newpp->sectorsize = pp0->sectorsize; cp0 = g_new_consumer(gp); if (cp0 == NULL) {