From owner-freebsd-current@FreeBSD.ORG Wed Dec 31 07:35:55 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 32A0316A4CE for ; Wed, 31 Dec 2003 07:35:55 -0800 (PST) Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF89243D93 for ; Wed, 31 Dec 2003 07:34:35 -0800 (PST) (envelope-from netch@iv.nn.kiev.ua) Received: (from uucp@localhost) by segfault.kiev.ua (8) with UUCP id hCVFYUse026893; Wed, 31 Dec 2003 17:34:30 +0200 (EET) (envelope-from netch@iv.nn.kiev.ua) Received: (from netch@localhost) by iv.nn.kiev.ua (8.12.9p2/8.12.9) id hBVFWnLo002303; Wed, 31 Dec 2003 17:32:49 +0200 (EET) (envelope-from netch) Date: Wed, 31 Dec 2003 17:32:49 +0200 From: Valentin Nechayev To: Poul-Henning Kamp Message-ID: <20031231153249.GA434@iv.nn.kiev.ua> References: <20031229230048.GA310@iv.nn.kiev.ua> <18000.1072741953@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18000.1072741953@critter.freebsd.dk> X-42: On Organization: Dark side of coredump X-Mailman-Approved-At: Wed, 31 Dec 2003 08:08:10 -0800 cc: current@freebsd.org cc: Valentin Nechayev Subject: Re: geom bsd strangeness in extended partition X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Dec 2003 15:35:55 -0000 Tue, Dec 30, 2003 at 00:52:33, phk (Poul-Henning Kamp) wrote about "Re: geom bsd strangeness in extended partition": >>GEOM issues warnings during scanning bsdlabels in extended partition: PHK> This is a bug and I know what it is. I'll get back to you with PHK> a patch sometimes in january. Well, the attached patch is seems to be dirty, but fixed it for me. I don't understand why multiple customers are allowed for g_geom, so get one of them which leads to parent MBR. Some variables may be unused because I omit debug print from final patch. -netch- --- geom/geom_mbr.c Mon Sep 1 23:45:32 2003 +++ geom.1/geom_mbr.c Wed Dec 31 17:22:10 2003 @@ -299,6 +299,29 @@ mp = gsp->softc; if (bp->bio_cmd == BIO_GETATTR) { if (g_handleattr_int(bp, "MBR::type", mp->type[idx])) + return (1); + off_t ro, off2; + struct g_consumer *pcons; + struct g_provider *pp2; + struct g_geom *gp2; + struct g_slicer *gsp2; + //struct g_mbr_softc *mp2; + /* Add MBR::offset of MBR in parent geom */ + ro = gsp->slices[idx].offset; + LIST_FOREACH(pcons, &gp->consumer, consumer) { + if (!(pp2 = pcons->provider) || + !(gp2 = pp2->geom) || + !gp2->class || + strcmp(gp2->class->name, MBR_CLASS_NAME)) + continue; + gsp2 = gp2->softc; + off2 = gsp2->slices[pp2->index].offset; + ro += off2; + break; + } + if (g_handleattr_off_t(bp, "MBR::offset", ro)) + return (1); + if (g_handleattr_off_t(bp, "MBR::offset", ro)) return (1); } return (0);