* grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): Don't try to
retrieve the metadat sector if size isn't known. * grub-core/disk/mdraid_linux.c (grub_mdraid_detect): Likewise.
This commit is contained in:
parent
9dfe92d07a
commit
7b61e6096b
3 changed files with 11 additions and 0 deletions
|
@ -123,6 +123,9 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array,
|
|||
|
||||
for (minor_version = 0; minor_version < 3; ++minor_version)
|
||||
{
|
||||
if (size == GRUB_DISK_SIZE_UNKNOWN && minor_version == 0)
|
||||
continue;
|
||||
|
||||
switch (minor_version)
|
||||
{
|
||||
case 0:
|
||||
|
|
|
@ -170,6 +170,8 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array,
|
|||
|
||||
/* The sector where the mdraid 0.90 superblock is stored, if available. */
|
||||
size = grub_disk_get_size (disk);
|
||||
if (size == GRUB_DISK_SIZE_UNKNOWN)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "not 0.9x raid");
|
||||
sector = NEW_SIZE_SECTORS (size);
|
||||
|
||||
if (grub_disk_read (disk, sector, 0, SB_BYTES, &sb))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue