NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/44340: Raidframe has trouble with raid sets containing gpt partition tables



>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:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 07 17:00:00 +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@localhost:/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);
 

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index