From 4d1e2bc9e39f61d7c1ee9b077fcbef1baedb13e9 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Sat, 14 Jan 2012 11:37:34 +0100 Subject: [PATCH] * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Skip disks with unknown size. * grub-core/disk/raid.c (scan_devices): Allow disks with unknown sizes. --- ChangeLog | 6 ++++++ grub-core/disk/dmraid_nvidia.c | 6 ++++-- grub-core/disk/raid.c | 3 +-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80c774256..28cb5d792 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-01-14 Vladimir Serbinenko + + * grub-core/disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Skip + disks with unknown size. + * grub-core/disk/raid.c (scan_devices): Allow disks with unknown sizes. + 2012-01-14 Vladimir Serbinenko Remove defines pertaining to arbitrary limits not affecting GRUB diff --git a/grub-core/disk/dmraid_nvidia.c b/grub-core/disk/dmraid_nvidia.c index 154193eb0..08600519a 100644 --- a/grub-core/disk/dmraid_nvidia.c +++ b/grub-core/disk/dmraid_nvidia.c @@ -100,8 +100,10 @@ grub_dmraid_nv_detect (grub_disk_t disk, struct grub_raid_array *array, if (disk->partition) return grub_error (GRUB_ERR_OUT_OF_RANGE, "skip partition"); - sector = grub_disk_get_size (disk) - 2; - + sector = grub_disk_get_size (disk); + if (sector == GRUB_DISK_SIZE_UNKNOWN) + return grub_error (GRUB_ERR_OUT_OF_RANGE, "not raid"); + sector -= 2; if (grub_disk_read (disk, sector, 0, sizeof (sb), &sb)) return grub_errno; diff --git a/grub-core/disk/raid.c b/grub-core/disk/raid.c index db1e969b3..490cfa92a 100644 --- a/grub-core/disk/raid.c +++ b/grub-core/disk/raid.c @@ -131,8 +131,7 @@ scan_devices (const char *arname) } } - if ((disk->total_sectors != GRUB_ULONG_MAX) && - (! raid->detect (disk, &array, &start_sector)) && + if ((! raid->detect (disk, &array, &start_sector)) && (! insert_array (disk, &array, start_sector, raid->name, raid))) return 0;