NetBSD Problem Report #44340

From buhrow@lothlorien.nfbcal.org  Fri Jan  7 16:59:47 2011
Return-Path: <buhrow@lothlorien.nfbcal.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id A3C9863B89A
	for <gnats-bugs@gnats.NetBSD.org>; Fri,  7 Jan 2011 16:59:47 +0000 (UTC)
Message-Id: <201101071659.p07GxkqN011146@lothlorien.nfbcal.org>
Date: Fri, 7 Jan 2011 08:59:46 -0800 (PST)
From: buhrow@lothlorien.nfbcal.org
Reply-To: buhrow@lothlorien.nfbcal.org
To: gnats-bugs@gnats.NetBSD.org
Subject: Raidframe has trouble with raid sets containing gpt partition tables
X-Send-Pr-Version: 3.95

>Number:         44340
>Category:       kern
>Synopsis:       Raid sets containing GPT partition tables cannot be unconfigured and reconfigured without a reboot
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    buhrow
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 07 17:00:00 +0000 2011
>Closed-Date:    Sat May 21 05:12:18 +0000 2011
>Last-Modified:  Sat May 21 05:12:18 +0000 2011
>Originator:     Brian Buhrow
>Release:        NetBSD 5.0_STABLE, 5.1_STABLE, -current
>Organization:

>Environment:


System: NetBSD host.via.net 5.1_STABLE NetBSD 5.1_STABLE (X2200) #2: Fri Jan  7 05:03:02 PST 2011  buhrow@arathorn.via.net:/usr/src/sys/arch/i386/compile/X2200 i386
Architecture: i386
Machine: i386
>Description:

	If a raid set contains a GPT partition table rather than a BSD
disklabel, it cannot be unconfigured and reconfigured on the system without
first rebooting because the raidframe system doesn't unregister the GPT
partitions before unconfiguring the raid set.
>How-To-Repeat:


To see the problem, do the following:

1.  Create a raid set and use gpt and dkctl to partition it and mount it.

2.  Once the raid set is configured and the partition recognized, you'll
see something lie: 
raid2: GPT GUID: f8b345ac-c74f-11df-806c-001e68041c80
dk1 at raid2: f8b345ca-c74f-11df-806c-001e68041c80
dk1: 573494973 blocks at 34, type: ffs
from dmesg.

3.  Run raidctl -u raidx where raidx is the raid number of the raid set you
configured.

4.  Now, run raidctl -c /etc/raidx.conf raidx where raidx is the  raid you
just destroyed.

You'll now see something like:
raid2: GPT GUID: f8b345ac-c74f-11df-806c-001e68041c80
raid2: wedge named 'f8b345ca-c74f-11df-806c-001e68041c80' already exists, trying 'f8b345ca-c74f-11df-806c-001e68041c80'
raid2: wedge named 'f8b345ca-c74f-11df-806c-001e68041c80' already exists, manual intervention required
from dmesg.

>Fix:

	The following patch fixes the issue for me.
this patch works against 5.0 and 5.1 sources, and should work against
-current sources as well.  It would be nice if this could get pulled into
the 5.x tree.
-Brian

Index: rf_netbsdkintf.c
===================================================================
RCS file: /cvsroot/src/sys/dev/raidframe/rf_netbsdkintf.c,v
retrieving revision 1.250.4.4
diff -u -r1.250.4.4 rf_netbsdkintf.c
--- rf_netbsdkintf.c	4 Apr 2009 17:15:14 -0000	1.250.4.4
+++ rf_netbsdkintf.c	7 Jan 2011 13:31:03 -0000
@@ -849,6 +849,7 @@
 			free(cf, M_RAIDFRAME);

 			/* Detach the disk. */
+			dkwedge_delall(&rs->sc_dkdev);
 			disk_detach(&rs->sc_dkdev);
 			disk_destroy(&rs->sc_dkdev);
 		}
@@ -1195,6 +1196,7 @@
 		free(cf, M_RAIDFRAME);

 		/* Detach the disk. */
+		dkwedge_delall(&rs->sc_dkdev);
 		disk_detach(&rs->sc_dkdev);
 		disk_destroy(&rs->sc_dkdev);


>Release-Note:

>Audit-Trail:
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44340 CVS commit: src/sys/dev/raidframe
Date: Fri, 7 Jan 2011 14:52:18 -0500

 Module Name:	src
 Committed By:	christos
 Date:		Fri Jan  7 19:52:18 UTC 2011

 Modified Files:
 	src/sys/dev/raidframe: rf_netbsdkintf.c

 Log Message:
 PR/44340: Brian Buhrow: Raid sets containing wedges cannot be unconfigured
 and reconfigured without a reboot.


 To generate a diff of this commit:
 cvs rdiff -u -r1.279 -r1.280 src/sys/dev/raidframe/rf_netbsdkintf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: kern-bug-people->buhrow
Responsible-Changed-By: spz@NetBSD.org
Responsible-Changed-When: Fri, 15 Apr 2011 19:09:21 +0000
Responsible-Changed-Why:
let the submitter deal with the PR himself now that he can :)
.


State-Changed-From-To: open->pending-pullups
State-Changed-By: buhrow@NetBSD.org
State-Changed-When: Mon, 02 May 2011 21:01:59 +0000
State-Changed-Why:
The original patches have been committed to head. Now, I'm requesting the patches be applied to the 5.x branch.


From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44340 CVS commit: [netbsd-5] src/sys/dev/raidframe
Date: Fri, 20 May 2011 19:24:55 +0000

 Module Name:	src
 Committed By:	bouyer
 Date:		Fri May 20 19:24:54 UTC 2011

 Modified Files:
 	src/sys/dev/raidframe [netbsd-5]: rf_netbsdkintf.c

 Log Message:
 Pull up following revision(s) (requested by buhrow in ticket #1615):
 	sys/dev/raidframe/rf_netbsdkintf.c: revision 1.280 via patch
 PR/44340: Brian Buhrow: Raid sets containing wedges cannot be unconfigured
 and reconfigured without a reboot.


 To generate a diff of this commit:
 cvs rdiff -u -r1.250.4.10 -r1.250.4.11 src/sys/dev/raidframe/rf_netbsdkintf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 21 May 2011 05:12:18 +0000
State-Changed-Why:
Pullups applied, thanks.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.