[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] show an error instead of segfaulting on grub-probe -t partma
From: |
Felix Zielcke |
Subject: |
Re: [PATCH] show an error instead of segfaulting on grub-probe -t partmap on a unsynced raid |
Date: |
Wed, 30 Jul 2008 13:39:10 +0200 |
I have told this all Robert just on IRC, but it would be really nice if
others would comment on this problem too :)
I just don't know if GRUB_UTIL should ignore the missing devices just
like real GRUB or if it's a good idea to at least warn the user that
sth. is wrong with the mdraid.
Am Mittwoch, den 30.07.2008, 12:37 +0200 schrieb Robert Millan:
> 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.
>
The list is generated by grub_raid_memberlist at disk/raid.c:72
and that doestn't handle missing devices, it adds every disk to the list
for (i = 0; i < array->total_devs; i++)
{
tmp = grub_malloc (sizeof (*tmp));
tmp->disk = array->device[i];
tmp->next = list;
list = tmp;
}
grub_raid_read for raid1 can handle missing devices without problems
disk/raid.c:209
for (i = 0; i < array->total_devs; i++)
{
if (array->device[i])
This is from grub_raid_scan_device after hd0,1 is added
sdb1 / hd1,1 has been removed and --zero-superblock'ed
(gdb) print *array
$3 = {number = 0, version = 0, level = 1, layout = 0, total_devs = 1, nr_devs
= 1, chunk_size = 0, uuid = {1191940856, 3853190239,
1276382316, 2567164211},
name = 0x19e1230 "md0", disk_size = 16777216, device = {0x0, 0x19e1080, 0x0
<repeats 30 times>}, next = 0x0}