From nobody@FreeBSD.org  Mon Oct 17 18:27:46 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23A05106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 17 Oct 2011 18:27:46 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 139F38FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 17 Oct 2011 18:27:46 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p9HIRjkX026771
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 17 Oct 2011 18:27:45 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p9HIRjhe026770;
	Mon, 17 Oct 2011 18:27:45 GMT
	(envelope-from nobody)
Message-Id: <201110171827.p9HIRjhe026770@red.freebsd.org>
Date: Mon, 17 Oct 2011 18:27:45 GMT
From: Leander <mr-spott@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: GEOM: glabel doesn't get gpt label change
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         161752
>Category:       kern
>Synopsis:       [geom] glabel(8) doesn't get gpt label change
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-geom
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 17 18:30:15 UTC 2011
>Closed-Date:    
>Last-Modified:  Tue Oct 18 03:27:49 UTC 2011
>Originator:     Leander
>Release:        9.0-BETA3
>Organization:
Privat
>Environment:
FreeBSD HOST.DOMAIN 9.0-BETA3 FreeBSD 9.0-BETA3 #0: Sat Sep 24 20:46:57 UTC 2011     root@obrian.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
Full description of the szenario could be found here in the FreeBSD Forum:

Topic Name: "FreeBSD 9 BETA3 - glabel Bug?"
http://forums.freebsd.org/newreply.php?do=newreply&noquote=1&p=150897
>How-To-Repeat:
Phase 1 - create partition:


FreeBSD [~]# gpart destroy ada2
ada2 destroyed

FreeBSD [~]# gpart create -s GPT ada2
ada2 created

FreeBSD [~]# gpart add -l "Storage" -t freebsd-ufs ada2
ada2p1 added

FreeBSD [~]# gpart list
Geom name: ada2
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 390719821
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada2p1
   Mediasize: 200048531456 (186G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0
   rawuuid: 9e34e5b5-f747-11e0-b222-000fa30711f1
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: Storage
   length: 200048531456
   offset: 17408
   type: freebsd-ufs
   index: 1
   end: 390719821
   start: 34
Consumers:
1. Name: ada2
   Mediasize: 200048565760 (186G)
   Sectorsize: 512
   Mode: r0w0e0



Phase 2 - modify partition:

FreeBSD [~]# gpart modify -i 1 -l "New-Name"  ada2
ada2p1 modified

FreeBSD [~]# gpart list
Geom name: ada2
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 390719821
first: 34
entries: 128
scheme: GPT
Providers:
1. Name: ada2p1
   Mediasize: 200048531456 (186G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17408
   Mode: r0w0e0
   rawuuid: 9e34e5b5-f747-11e0-b222-000fa30711f1
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: New-Name
   length: 200048531456
   offset: 17408
   type: freebsd-ufs
   index: 1
   end: 390719821
   start: 34
Consumers:
1. Name: ada2
   Mediasize: 200048565760 (186G)
   Sectorsize: 512
   Mode: r0w0e0


As you can see it updated the changes. BUT glabel didn't get informed about the changes:

FreeBSD [~]# glabel status
                                      Name  Status  Components
gptid/2fed8e3d-f4f9-11e0-beaf-000fa30711f1     N/A  ada0p1
                                gpt/RootFS     N/A  ada0p2
[...]
                               gpt/Storage     N/A  ada2p1
gptid/9e34e5b5-f747-11e0-b222-000fa30711f1     N/A  ada2p1
[...]


As you can see it still has outdated label-information "Storage" instead of "New-Name"

FreeBSD [~]# ls -lach /dev/gpt/
total 1
dr-xr-xr-x   2 root  wheel         512B 15 Okt 13:26 .
dr-xr-xr-x  11 root  wheel         512B 15 Okt 15:26 ..
[...]
crw-r-----   1 root  operator    0, 114 15 Okt 15:26 RootFS
crw-r-----   1 root  operator    0, 173 15 Okt 18:06 Storage
[...]


BUT the funny thing is that glabel gets the changes ONLY AFTER I rebooted the machine.
glabel after reboot:

FreeBSD [~]# glabel status
                                      Name  Status  Components
[...]
                                gpt/RootFS     N/A  ada0p2
                              gpt/New-Name     N/A  ada2p1
[...]


>Fix:
a simple restart would fix the problem

OR restart the device by i.e.:

FreeBSD [~]# true > /dev/ada2

Which in my opinion should be done auomatically after label change - as it was in previous RELEASE. Otherwhise what's the use of a framework if user still has to interact while expecting framework apps to communicate among each other.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Tue Oct 18 03:22:41 UTC 2011 
Responsible-Changed-Why:  
assign to maintainer 

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