* grub-core/disk/diskfilter.c (is_lv_readable): New argument "easily".

All users updated. If easily=1 require raid-5/-6 to be full.
	(is_node_readable): Likewise.
	(scan_devices): Scan incomplete but readable LVs at the end.
	(grub_diskfilter_memberlist): Pull missing devices.
	(insert_array): Skip scanning until device is complete or scan is
	done otherwise.
	* grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Fix wrong
	check.
	* include/grub/diskfilter.h (grub_diskfilter_lv): New member scanned.
	* util/raid.c (grub_util_raid_getmembers): Handle "removed" disks.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-03-04 01:33:09 +01:00
parent aff05d45f9
commit 49de079bbe
5 changed files with 89 additions and 35 deletions

View file

@ -70,19 +70,22 @@ grub_util_raid_getmembers (const char *name, int bootable)
devicelist = xmalloc ((info.nr_disks + 1) * sizeof (char *));
for (i = 0, j = 0; i <info.nr_disks; i++)
for (i = 0, j = 0; j < info.nr_disks; i++)
{
disk.number = i;
ret = ioctl (fd, GET_DISK_INFO, &disk);
if (ret != 0)
grub_util_error (_("ioctl GET_DISK_INFO error: %s"), strerror (errno));
if (disk.state & (1 << MD_DISK_REMOVED))
continue;
if (disk.state & (1 << MD_DISK_ACTIVE))
{
devicelist[j] = grub_find_device (NULL,
makedev (disk.major, disk.minor));
j++;
}
devicelist[j] = grub_find_device (NULL,
makedev (disk.major, disk.minor));
else
devicelist[j] = NULL;
j++;
}
devicelist[j] = NULL;