From zanchey@ucc.gu.uwa.edu.au  Tue Jul 15 11:08:22 2008
Return-Path: <zanchey@ucc.gu.uwa.edu.au>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ADA6C1065672
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 11:08:22 +0000 (UTC)
	(envelope-from zanchey@ucc.gu.uwa.edu.au)
Received: from asclepius2.uwa.edu.au (asclepius2.uwa.edu.au [130.95.128.59])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B84F8FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 11:08:22 +0000 (UTC)
	(envelope-from zanchey@ucc.gu.uwa.edu.au)
Received: from kas30pipe.localhost (localhost.localdomain [127.0.0.1])
	by panacea.uwa.edu.au (Postfix) with ESMTP id 2CF5388149
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 18:34:49 +0800 (WST)
Received: from panacea (localhost.localdomain [127.0.0.1])
	by panacea.prekas (Postfix) with SMTP id B56FC88429
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 18:34:48 +0800 (WST)
Received: from mooneye.ucc.gu.uwa.edu.au (mooneye.ucc.gu.uwa.edu.au [130.95.13.9])
	by panacea.extinput (Postfix) with ESMTP id A469688149
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 18:34:48 +0800 (WST)
Received: by mooneye.ucc.gu.uwa.edu.au (Postfix, from userid 801)
	id BFC7D367E9; Tue, 15 Jul 2008 18:34:46 +0800 (WST)
Received: from mussel.ucc.gu.uwa.edu.au (mussel.ucc.gu.uwa.edu.au [130.95.13.18])
	by mooneye.ucc.gu.uwa.edu.au (Postfix) with ESMTP id 9392A36838
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 18:34:46 +0800 (WST)
Received: from zanchey by mussel.ucc.gu.uwa.edu.au with local (Exim 3.36 #1 (Debian))
	id 1KIhrq-0002ej-00
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 15 Jul 2008 18:34:46 +0800
Message-Id: <E1KIhrq-0002ej-00@mussel.ucc.gu.uwa.edu.au>
Date: Tue, 15 Jul 2008 18:34:46 +0800
From: "<zanchey"@ucc.gu.uwa.edu.au
Sender: David Adam <zanchey@ucc.gu.uwa.edu.au>
Reply-To: <zanchey@ucc.gu.uwa.edu.au>>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: gvinum rename does not work for drive objects
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         125632
>Category:       kern
>Synopsis:       [gvinum] rename does not work for drive objects
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lulf
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 15 11:10:00 UTC 2008
>Closed-Date:    Tue Jul 22 19:58:00 UTC 2008
>Last-Modified:  Tue Jul 22 20:00:14 UTC 2008
>Originator:     David Adam <zanchey@ucc.gu.uwa.edu.au>
>Release:        FreeBSD 7.0-RELEASE-p2 i386
>Organization:
University Computer Club, UWA
>Environment:
System: FreeBSD blade.ucc.gu.uwa.edu.au 7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 #0: Wed Jun 18 07:33:28 UTC 2008 root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386


>Description:
The 'rename' command in gvinum doesn't appear to persist across reboots on drive objects in 7.0-RELEASE.

I initially created three drive objects to support my RAID-5 gvinum setup,
named 'r0', 'r1' and 'r2'. Straightaway, I realised that this was not the naming scheme I had intended to use, but rather than deleting and
recreating them, I tried renaming to 'rA', 'rB' and 'rC'. This appeared to complete successfully, I created the appropriate volume and plex,
newfs(8)ed the filesystem, and mounted it.

However, on rebooting the machine (some days later) I discovered that the
rename operation did not persist across a reboot. Thus, I have three
drives named 'r0', 'r1' and 'r2', and a RAID-5 plex that looks for drives
to attach to subdisks named 'rA', 'rB' and 'rC'. It fails to load
successfully, and I am left without a running volume.

No amount of booting to single user and issuing 'rename r0 rA', with or without 'saveconfig', results in a drive name change that persists across
reboots.

>How-To-Repeat:
 - Create disk 'r0'
 - Rename to 'rA'
 - If you would like things to go spang, create a plex containing rA at this point
 - 'saveconfig' (optional, does not affect outcome)
 - Reboot
 - `gvinum list` shows disk r0

>Fix:

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-geom 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Tue Jul 15 17:08:04 UTC 2008 
Responsible-Changed-Why:  
Over to maintainers 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125632 
Responsible-Changed-From-To: freebsd-geom->lulf 
Responsible-Changed-By: lulf 
Responsible-Changed-When: Wed Jul 16 06:01:41 UTC 2008 
Responsible-Changed-Why:  
- I'll look at this later today. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125632 

From: Ulf Lilleengen <lulf@stud.ntnu.no>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125632: [gvinum] rename does not work for drive objects
Date: Wed, 16 Jul 2008 18:36:31 +0200

 --wac7ysb48OaltWcw
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 Hello,
 
 The attached patch fixes the problem. The problem was that during a rename,
 the new drive name was not saved in the drive's header (which is used to set
 the drive name during initial taste). I'll commit it soon.
 
 -- 
 Ulf Lilleengen
 
 --wac7ysb48OaltWcw
 Content-Type: text/x-diff; charset=us-ascii
 Content-Disposition: attachment; filename="gvinum_fixrename.diff"
 
 Index: sys/geom/vinum/geom_vinum_rename.c
 ===================================================================
 --- sys/geom/vinum/geom_vinum_rename.c	(revision 180367)
 +++ sys/geom/vinum/geom_vinum_rename.c	(working copy)
 @@ -142,6 +142,7 @@
  	}
  
  	strncpy(d->name, newname, GV_MAXDRIVENAME);
 +	strncpy(d->hdr->label.name, newname, GV_MAXDRIVENAME);
  
  	/* XXX can we rename providers here? */
  
 
 --wac7ysb48OaltWcw--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125632: commit references a PR
Date: Sat, 19 Jul 2008 13:53:34 +0000 (UTC)

 lulf        2008-07-19 13:53:11 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/geom/vinum       geom_vinum_rename.c 
   Log:
   SVN rev 180612 on 2008-07-19 13:53:11Z by lulf
   
   - When renaming a drive, also set the drive name in the gvinum header.
   
   PR:             kern/125632
   Approved by:    pjd (mentor)
   MFC after:      3 days
   
   Revision  Changes    Path
   1.4       +1 -0      src/sys/geom/vinum/geom_vinum_rename.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: David Adam <zanchey@ucc.gu.uwa.edu.au>
To: bug-followup@FreeBSD.org, lulf@stud.ntnu.no
Cc:  
Subject: Re: kern/125632: [gvinum] rename does not work for drive objects
Date: Mon, 21 Jul 2008 18:17:14 +0800 (WST)

 Patch applies to 6.3-STABLE and appears to solve this problem. Thanks!
 
 (Sorry for the delay in testing - the PR system didn't notify me of the 
 followup.)
 
State-Changed-From-To: open->closed 
State-Changed-By: lulf 
State-Changed-When: Tue Jul 22 19:56:40 UTC 2008 
State-Changed-Why:  
- Patch have been tested and committed to head, 7-stable and 6-stable. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125632 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125632: commit references a PR
Date: Tue, 22 Jul 2008 19:50:56 +0000 (UTC)

 lulf        2008-07-22 19:50:34 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/geom/vinum       geom_vinum_rename.c 
   Log:
   SVN rev 180721 on 2008-07-22 19:50:34Z by lulf
   
   MFC r180612:
   
   - When renaming a drive, also set the drive name in the gvinum header.
   
   PR:             kern/125632
   Approved by:    pjd (mentor)
   
   Revision  Changes    Path
   1.3.4.1   +1 -0      src/sys/geom/vinum/geom_vinum_rename.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125632: commit references a PR
Date: Tue, 22 Jul 2008 19:56:12 +0000 (UTC)

 lulf        2008-07-22 19:55:44 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_6)
     sys/geom/vinum       geom_vinum_rename.c 
   Log:
   SVN rev 180723 on 2008-07-22 19:55:44Z by lulf
   
   MFC r180612:
   
   - When renaming a drive, also set the drive name in the gvinum header.
   
   PR:             kern/125632
   Approved by:    pjd (mentor)
   
   Revision  Changes    Path
   1.3.2.2   +1 -0      src/sys/geom/vinum/geom_vinum_rename.c
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
