From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KO94T-0007Eg-Fl for mharc-grub-devel@gnu.org; Wed, 30 Jul 2008 06:38:18 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KO94O-0007Dl-DM for grub-devel@gnu.org; Wed, 30 Jul 2008 06:38:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KO94L-0007Bw-UI for grub-devel@gnu.org; Wed, 30 Jul 2008 06:38:11 -0400 Received: from [199.232.76.173] (port=58856 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KO94L-0007BV-AA for grub-devel@gnu.org; Wed, 30 Jul 2008 06:38:09 -0400 Received: from aybabtu.com ([69.60.117.155]:59306) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KO94L-0008Fp-EO for grub-devel@gnu.org; Wed, 30 Jul 2008 06:38:09 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1KO8xf-0008Bx-KD for grub-devel@gnu.org; Wed, 30 Jul 2008 12:31:16 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1KO93M-0004dk-Vs for grub-devel@gnu.org; Wed, 30 Jul 2008 12:37:09 +0200 Date: Wed, 30 Jul 2008 12:37:08 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080730103708.GA17771@thorin> References: <1217286307.4016.107.camel@fz-deb.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] show an error instead of segfaulting on grub-probe -t partmap on a unsynced raid X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2008 10:38:13 -0000 On Tue, Jul 29, 2008 at 10:20:29PM +0200, Felix Zielcke wrote: > >#0 0x00000000004015f9 in probe_partmap (disk=0x0) > >at /home/fz/grub/grub2-1.96+20080724/util/grub-probe.c:87 > >87 if (disk->partition == NULL) > > > This is really a good way to get more into this coding and debugging C > stuff in general and especially, into grub2's code. > > As far as I could find out now (more with trying it out then reading the > code) grub itself can handle a raid1 > with one missing device or an unsynced one. > Here's a patch which print an error on "grub-probe -t partmap /" instead of > segfaulting. > I have to find out why "grub-probe -t fs /" fails with one missing device > but succeeds with an unsynced one. > First I thought I let it continue and just print out a warning, but there's > no grub_util_warn() and probable anyway better > to reject installing grub on a not fully synced raid. > > Please comment :) > > > Index: util/grub-probe.c > =================================================================== > --- util/grub-probe.c (Revision 1747) > +++ util/grub-probe.c (Arbeitskopie) > @@ -179,6 +179,8 @@ > list = dev->disk->dev->memberlist (dev->disk); > while (list) > { > + if (! list->disk) > + grub_util_error ("At least one underlying device for %s is > missing.",dev->disk->name); We generate that list ourselves (I think in util/raid.c), so if one device is linked in the list but just points to NULL that's our own fault, at least up to the util/raid.c layer. -- Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."