From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JNnMu-0005SP-6i for mharc-grub-devel@gnu.org; Sat, 09 Feb 2008 05:55:36 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JNnMt-0005S2-BT for grub-devel@gnu.org; Sat, 09 Feb 2008 05:55:35 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JNnMr-0005QC-AB for grub-devel@gnu.org; Sat, 09 Feb 2008 05:55:34 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JNnMr-0005Pu-3A for grub-devel@gnu.org; Sat, 09 Feb 2008 05:55:33 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JNnMq-0007MR-PL for grub-devel@gnu.org; Sat, 09 Feb 2008 05:55:32 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1JNnMn-0000R3-Tb; Sat, 09 Feb 2008 11:55:30 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1JNnKy-0007RH-IY; Sat, 09 Feb 2008 11:53:36 +0100 Date: Sat, 9 Feb 2008 11:53:36 +0100 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20080209105336.GD21087@thorin> References: <20080206234308.GA25944@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080206234308.GA25944@thorin> Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Jeroen Dekkers Subject: Re: [PATCH] sanity checks for RAID X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2008 10:55:35 -0000 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 I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)