From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K6CnI-0005Qn-V3 for mharc-grub-devel@gnu.org; Tue, 10 Jun 2008 18:58:25 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6CnH-0005QS-I5 for grub-devel@gnu.org; Tue, 10 Jun 2008 18:58:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6CnG-0005Q2-6W for grub-devel@gnu.org; Tue, 10 Jun 2008 18:58:23 -0400 Received: from [199.232.76.173] (port=42187 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6CnF-0005Px-Tf for grub-devel@gnu.org; Tue, 10 Jun 2008 18:58:22 -0400 Received: from c60.cesmail.net ([216.154.195.49]:6047) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1K6CnF-0008MU-Ee for grub-devel@gnu.org; Tue, 10 Jun 2008 18:58:21 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 10 Jun 2008 18:58:16 -0400 Received: from [192.168.0.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id BEAF3619058 for ; Tue, 10 Jun 2008 18:58:16 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: References: <20080604233536.GA21711@thorin> <1212910148.14564.4.camel@rd> <1212950530.8619.7.camel@dv> <1212975838.3863.35.camel@dv> <1213122389.2348.21.camel@dv> Content-Type: text/plain Date: Tue, 10 Jun 2008 18:58:15 -0400 Message-Id: <1213138695.2345.4.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 (2.22.2-2.fc9) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] biosdisk / open_device() messing up offsets 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: Tue, 10 Jun 2008 22:58:23 -0000 On Wed, 2008-06-11 at 02:51 +0800, Bean wrote: > Hi, > > I spot another bug, please try the new patch. You probably meant to use (LOG2_EXT2_BLOCK_SIZE (data) + 9) in your patch because the block size is in 512 bytes units, unlike sizeof: diff --git a/fs/ext2.c b/fs/ext2.c index e4ce47b..fb13a80 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -260,8 +260,8 @@ grub_ext2_blockgroup (struct grub_ext2_data *data, int group, int blkno, blkoff; group *= sizeof (struct grub_ext2_block_group); - blkno = group >> LOG2_EXT2_BLOCK_SIZE (data); - blkoff = group - (blkno << LOG2_EXT2_BLOCK_SIZE (data)); + blkno = group >> (LOG2_EXT2_BLOCK_SIZE (data) + 9); + blkoff = group - (blkno << (LOG2_EXT2_BLOCK_SIZE (data) + 9)); return grub_disk_read (data->disk, (grub_fshelp_map_block (data->journal, That appears to fix everything!!! grub-fstest is loading, GRUB is working in qemu on the live filesystem, and the normal boot is still working. I think we should consider having a journaling layer above grub_disk_read() that would do the substitution and avoid such bugs in the future. -- Regards, Pavel Roskin