From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1FzFLY-0005da-Ie for mharc-grub-devel@gnu.org; Sat, 08 Jul 2006 12:07:56 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FzFLX-0005dS-1m for grub-devel@gnu.org; Sat, 08 Jul 2006 12:07:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FzFLS-0005dG-5b for grub-devel@gnu.org; Sat, 08 Jul 2006 12:07:53 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FzFLS-0005dD-1G for grub-devel@gnu.org; Sat, 08 Jul 2006 12:07:50 -0400 Received: from [212.85.152.101] (helo=kotoba.storever.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FzFM7-0008OL-HT for grub-devel@gnu.org; Sat, 08 Jul 2006 12:08:31 -0400 Received: from kotoba.oasis.nexedi.com (kotoba.oasis.nexedi.com [212.85.152.101]) by kotoba.storever.com (Postfix) with ESMTP id EADB83C9D65E1 for ; Sat, 8 Jul 2006 19:58:55 +0200 (CEST) Received: from [??1] (localhost [127.0.0.1]) by kotoba.storever.com (Postfix) with ESMTP id 996513C9D65E0 for ; Sat, 8 Jul 2006 19:58:55 +0200 (CEST) From: "Yoshinori K. Okuji" Organization: enbug.org To: The development of GRUB 2 Date: Sat, 8 Jul 2006 18:07:44 +0200 User-Agent: KMail/1.8.2 References: <87wtarepr8.wl%jeroen@vrijschrift.org> In-Reply-To: <87wtarepr8.wl%jeroen@vrijschrift.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200607081807.44495.okuji@enbug.org> X-Bogosity: No, tests=bogofilter, spamicity=0.475607, version=0.17.2 Subject: Re: [PATCH] Set size of partition correctly in grub_disk_open() 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, 08 Jul 2006 16:07:55 -0000 Hi Jeroen, On Wednesday 05 July 2006 22:54, Jeroen Dekkers wrote: > if (p) > - disk->partition = grub_partition_probe (disk, p + 1); > + { > + disk->partition = grub_partition_probe (disk, p + 1); > + if (! disk->partition) > + { > + grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition"); > + goto fail; > + } I agree with this part. > + > + disk->total_sectors = grub_partition_get_len (disk->partition); > + } But I don't agree with this part. The member "total_sectors" must describe the size of the whole disk but not of the partition. This is because GRUB accesses partitions through the disk interface. When accessing a partition, GRUB tweaks offsets by the start sector of the partition. If not, it is another bug. Thanks, Okuji