From Michiel.Boland@internl.net  Wed Aug 18 08:19:08 2004
Return-Path: <Michiel.Boland@internl.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8638016A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 18 Aug 2004 08:19:08 +0000 (GMT)
Received: from neerbosch.nijmegen.internl.net (neerbosch.nijmegen.internl.net [217.149.193.38])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C6EE543D3F
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 18 Aug 2004 08:19:07 +0000 (GMT)
	(envelope-from Michiel.Boland@internl.net)
Received: from brakkenstein.nijmegen.internl.net by neerbosch.nijmegen.internl.net
	via brakkenstein.nijmegen.internl.net [217.149.193.41] with ESMTP for <FreeBSD-gnats-submit@freebsd.org>
	id i7I8J6YA016335 (8.12.10/1.4); Wed, 18 Aug 2004 10:19:06 +0200 (MET DST)
Received: by brakkenstein.nijmegen.internl.net
	via mboland@localhost for FreeBSD-gnats-submit@freebsd.org
	id i7I8J6CP002734 (8.12.10/2.02); Wed, 18 Aug 2004 10:19:06 +0200 (MEST)
Message-Id: <200408180819.i7I8J6CP002734@brakkenstein.nijmegen.internl.net>
Date: Wed, 18 Aug 2004 10:19:06 +0200 (MEST)
From: Michiel Boland <Michiel.Boland@internl.net>
To: FreeBSD-gnats-submit@freebsd.org
Subject: MBR type no longer visible in GEOM dumps
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         70611
>Category:       kern
>Synopsis:       MBR type no longer visible in GEOM dumps
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 18 08:20:20 GMT 2004
>Closed-Date:    Thu Aug 19 09:00:22 GMT 2004
>Last-Modified:  Thu Aug 19 09:00:22 GMT 2004
>Originator:     Michiel Boland
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD leefnet.office.internl.net 5.2-CURRENT FreeBSD 5.2-CURRENT #3: Tue Aug 17 16:49:26 CEST 2004 root@leefnet.office.internl.net:/usr/obj/usr/src/sys/LEEFNET i386


	
>Description:
The 'type' field is missing from the MBR in GEOM dumps.
This breaks (via libdisk) the FDISK partition editor in sysinstall.
See also
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=500285+0+current/freebsd-current
	
>How-To-Repeat:
Type sysctl -b kern.geom.dumptxt
The ouput contains lines like the following:

1 MBR ad0s1 39999504384 512 i 0 o 32256

The line above should have a ' ty ' entry appended.
	
>Fix:
The breakage occurred after phk's 'Use default method initialization on geoms'
commit, dated 2004-08-08 06:49:07 UTC. I guess some parts of this commit should
be reverted.
>Release-Note:
>Audit-Trail:

From: "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To: Michiel Boland <Michiel.Boland@internl.net>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/70611: MBR type no longer visible in GEOM dumps 
Date: Wed, 18 Aug 2004 10:25:23 +0200

 In message <200408180819.i7I8J6CP002734@brakkenstein.nijmegen.internl.net>, Mic
 hiel Boland writes:
 
 >>Number:         70611
 >>Category:       kern
 >>Synopsis:       MBR type no longer visible in GEOM dumps
 
 >>How-To-Repeat:
 >Type sysctl -b kern.geom.dumptxt
 >The ouput contains lines like the following:
 >
 >1 MBR ad0s1 39999504384 512 i 0 o 32256
 >
 >The line above should have a ' ty ' entry appended.
 
 Can you try this patch:
 
 Index: geom_slice.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/geom/geom_slice.c,v
 retrieving revision 1.55
 diff -u -r1.55 geom_slice.c
 --- geom_slice.c	25 Jul 2004 09:41:31 -0000	1.55
 +++ geom_slice.c	18 Aug 2004 08:24:47 -0000
 @@ -465,7 +465,8 @@
  	gp->softc = gsp;
  	gp->start = g_slice_start;
  	gp->spoiled = g_slice_spoiled;
 -	gp->dumpconf = g_slice_dumpconf;
 +	if (gp->dumpconf == NULL)
 +		gp->dumpconf = g_slice_dumpconf;
  	if (gp->class->destroy_geom == NULL)
  		gp->class->destroy_geom = g_slice_destroy_geom;
  	cp = g_new_consumer(gp);
 
 -- 
 Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
 phk@FreeBSD.ORG         | TCP/IP since RFC 956
 FreeBSD committer       | BSD since 4.3-tahoe    
 Never attribute to malice what can adequately be explained by incompetence.

From: Michiel Boland <Michiel.Boland@internl.net>
To: Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/70611: MBR type no longer visible in GEOM dumps 
Date: Wed, 18 Aug 2004 10:31:23 +0200 (MEST)

 > Can you try this patch:
 >
 > Index: geom_slice.c
 > ===================================================================
 > RCS file: /home/ncvs/src/sys/geom/geom_slice.c,v
 > retrieving revision 1.55
 > diff -u -r1.55 geom_slice.c
 > --- geom_slice.c	25 Jul 2004 09:41:31 -0000	1.55
 > +++ geom_slice.c	18 Aug 2004 08:24:47 -0000
 > @@ -465,7 +465,8 @@
 > 	gp->softc = gsp;
 > 	gp->start = g_slice_start;
 > 	gp->spoiled = g_slice_spoiled;
 > -	gp->dumpconf = g_slice_dumpconf;
 > +	if (gp->dumpconf == NULL)
 > +		gp->dumpconf = g_slice_dumpconf;
 > 	if (gp->class->destroy_geom == NULL)
 > 		gp->class->destroy_geom = g_slice_destroy_geom;
 > 	cp = g_new_consumer(gp);
 
 That appears to have fixed things:
 
 mboland@leefnet:~$ sysctl -b kern.geom.conftxt
 0 DISK ad0 40000000000 512 hd 16 sc 63
 1 MBR ad0s1 39999504384 512 i 0 o 32256 ty 165
 2 BSD ad0s1f 38141648896 512 i 5 o 1857855488 ty 7
 2 BSD ad0s1e 268435456 512 i 4 o 1589420032 ty 7
 2 BSD ad0s1d 268435456 512 i 3 o 1320984576 ty 7
 2 BSD ad0s1c 39999504384 512 i 2 o 0 ty 0
 2 BSD ad0s1b 1052549120 512 i 1 o 268435456 ty 1
 2 BSD ad0s1a 268435456 512 i 0 o 0 ty 7
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Thu Aug 19 08:59:32 GMT 2004 
State-Changed-Why:  
Thanks for providing a very well researched PR, it allowed 
me to pinpoint the trouble in a few minutes. 

Fixed. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=70611 
>Unformatted:
