gmirror comes up DEGRADED

Max Laier max at love2party.net
Mon Dec 18 17:55:10 PST 2006


On Saturday 16 December 2006 18:09, Pawel Jakub Dawidek wrote:
> On Sat, Dec 16, 2006 at 03:37:15PM +0100, Max Laier wrote:
> > Hi,
> >
> > I'm new to really playing with gmirror and friends, so please forgive
> > me if this is a FAQ - my searches didn't turn up anything.  Please CC
> > me, for I'm not on the list.
> >
> > Following setup: 6.2-pre as of Wednesday
> >
> > ad0, ad2	250G ata on
> > 		atapci0 at pci0:31:1:	class=0x010180 card=0x80281043 chip=0x244b8086
> > 					rev=0x05 hdr=0x00
> > 		    vendor   = 'Intel Corporation'
> > 		    device   = '82801BA (ICH2) UltraATA/100 IDE Controller'
> > 		    class    = mass storage
> > 		    subclass = ATA
> >
> > mirror/gm0	over ad0, ad2
> >
> > mirror/gm0s1	spanning all of the available space on gm0
> > mirror/gm0s1a	spanning all of the available space on gm0s1
> >
> > mirror/gm0s1a.bde	gbde encryption on gm0s1a.bde
> >
> > Now if I wait for the mirror to get in sync and do a reboot, it comes
> > up DEGRADED and resyncs ad0 (again) :-\  Does that mean I have to
> > stop everything manually before rebooting?  Is there a fundamental
> > error in the setup that I can remedy?  How do you do this right?  It
> > certainly is not a good idea to do it the other way round (i.e.
> > mirror two gbde provider), right?
> >
> > Any help greatly appreciated.
>
> If I read the code properly, the problem you are seeing is because gbde
> doesn't close its consumers on shutdown. It opens consumer r1w1e1 on
> attach, but it only close it on manual detach. This is wrong. It should
> open consumer on first provider open or should close it on shutdown. I
> decided not to touch gbde, so you need to ask phk@ or someone else to
> fix it.

Would it make sense to have a "graceful orphanization" for this kind of 
things?  i.e. an operation with a semantic like "somebody asked me to go 
away, so next time you get the chance - could you do so as well (for I 
depend on you being okay with this)?"  It seems overly complicated to ask 
classes that don't require a state save to implement a dedicated hook to 
go away on system shutdown.  For a "graceful orphanization", however, all 
you need to do is keep a flag in the softc, pass down the request and 
wait for the open count to drop to zero.

Does that sound like it might work?  I'd try to dig into it if it makes 
sense.

> I also found a bug in g_bde_access() function:
>
> 	if ((cp->acr + dr) == 0 && (cp->acw + dw) == 0 && (cp->ace + de) == 1)
> {
>
> I think it should be:
>
> 	if ((cp->acr + dr) == 1 && (cp->acw + dw) == 0 && (cp->ace + de) == 1)
> {

Since *dr is decremented in the body, this seems to be the case indeed.

-- 
/"\  Best regards,                      | mlaier at freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-geom/attachments/20061219/4d0ba2dc/attachment.pgp


More information about the freebsd-geom mailing list