[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] sanity checks for RAID
From: |
Robert Millan |
Subject: |
Re: [PATCH] sanity checks for RAID |
Date: |
Sat, 9 Feb 2008 11:53:36 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Thu, Feb 07, 2008 at 12:43:08AM +0100, Robert Millan wrote:
> diff -x configure -x config.h.in -x CVS -x '*~' -x '*.mk' -urp
> ../grub2/disk/raid.c ./disk/raid.c
> --- ../grub2/disk/raid.c 2007-12-30 09:52:03.000000000 +0100
> +++ ./disk/raid.c 2008-02-06 23:22:46.000000000 +0100
> @@ -493,6 +493,28 @@ grub_raid_scan_device (const char *name)
> /* Add the device to the array. */
> array->device[sb.this_disk.number].name = grub_strdup (name);
> array->device[sb.this_disk.number].disk = grub_disk_open (name);
> +
> + if (array->disk_size != array->device[sb.this_disk.number]->total_sectors)
> + {
> + if (array->total_devs == 1)
> + {
> + grub_dprintf ("raid", "Array contains only one disk, but its size
> (0x%llx) "
> + "doesn't match with size indicated by superblock
> (0x%llx). "
> + "Assuming superblock is wrong.\n",
> + array->device[sb.this_disk.number]->total_sectors,
> array->disk_size);
> + array->disk_size = array->device[sb.this_disk.number]->total_sectors;
> + }
> + else if (array->level == 1)
> + {
> + grub_dprintf ("raid", "Array is RAID level 1, but the size of disk %d
> (0x%llx) "
> + "doesn't match with size indicated by superblock
> (0x%llx). "
> + "Assuming superblock is wrong.\n",
> + sb.this_disk.number,
> + array->device[sb.this_disk.number]->total_sectors,
> array->disk_size);
> + array->disk_size = array->device[sb.this_disk.number]->total_sectors;
> + }
> + }
> +
Committed.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)