From b4db4f39f017cc7cf97890523bd6e6b219a9a326 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 29 Mar 2011 10:51:58 +0100 Subject: [PATCH] * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): If real_sb->size is zero (e.g. RAID-0), get the disk size from real_sb->data_size instead. Fixes Ubuntu bug #743136. --- ChangeLog | 7 +++++++ grub-core/disk/mdraid1x_linux.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8d976d770..ab5182b8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-03-29 Colin Watson + + * grub-core/disk/mdraid1x_linux.c (grub_mdraid_detect): If + real_sb->size is zero (e.g. RAID-0), get the disk size from + real_sb->data_size instead. + Fixes Ubuntu bug #743136. + 2011-03-29 Vladimir Serbinenko * grub-core/normal/misc.c (grub_normal_print_device_info): Use correct diff --git a/grub-core/disk/mdraid1x_linux.c b/grub-core/disk/mdraid1x_linux.c index 296d1375b..1d08abf5b 100644 --- a/grub-core/disk/mdraid1x_linux.c +++ b/grub-core/disk/mdraid1x_linux.c @@ -192,7 +192,10 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array, array->level = grub_le_to_cpu32 (real_sb->level); array->layout = grub_le_to_cpu32 (real_sb->layout); array->total_devs = grub_le_to_cpu32 (real_sb->raid_disks); - array->disk_size = grub_le_to_cpu64 (real_sb->size); + if (real_sb->size) + array->disk_size = grub_le_to_cpu64 (real_sb->size); + else + array->disk_size = grub_le_to_cpu64 (real_sb->data_size); array->chunk_size = grub_le_to_cpu32 (real_sb->chunksize); if (grub_le_to_cpu32 (real_sb->dev_number) >=