the actual raid implementation doesn't handle spare or faulty drives in
a linux software raid array in a sane way. grub-probe will reproducible
crash in such a setup.
please include the attached trivial patch to fix this problem.
for more information see:
https://savannah.gnu.org/bugs/?31119
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593652
=== modified file 'grub-core/disk/raid.c'
--- grub-core/disk/raid.c 2010-09-13 21:59:22 +0000
+++ grub-core/disk/raid.c 2010-09-25 22:20:29 +0000
@@ -501,7 +501,8 @@
grub_dprintf ("raid", "array->nr_devs > array->total_devs (%d)?!?",
array->total_devs);
- if (array->device[new_array->index] != NULL)
+ if ((new_array->index < GRUB_RAID_MAX_DEVICES) &&
+ (array->device[new_array->index] != NULL))
/* We found multiple devices with the same number. Again,
this shouldn't happen. */
grub_dprintf ("raid", "Found two disks with the number %d?!?",
@@ -609,9 +610,14 @@
}
/* Add the device to the array. */
- array->device[new_array->index] = disk;
- array->start_sector[new_array->index] = start_sector;
- array->nr_devs++;
+
+ /* ignore spare/faulty disks and more then GRUB_RAID_MAX_DEVICES */
+ if (new_array->index < GRUB_RAID_MAX_DEVICES)
+ {
+ array->device[new_array->index] = disk;
+ array->start_sector[new_array->index] = start_sector;
+ array->nr_devs++;
+ }
return 0;
}
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel