grub-devel
[Top][All Lists]
Advanced

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

[PATCH] show an error instead of segfaulting on grub-probe -t partmap on


From: Felix Zielcke
Subject: [PATCH] show an error instead of segfaulting on grub-probe -t partmap on a unsynced raid
Date: Tue, 29 Jul 2008 22:20:29 +0200

#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);
         probe_partmap (list->disk);
         tmp = list->next;
         free (list);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]