From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K6D6a-0005Yi-9J for mharc-grub-devel@gnu.org; Tue, 10 Jun 2008 19:18:20 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K6D6Y-0005YS-Dw for grub-devel@gnu.org; Tue, 10 Jun 2008 19:18:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K6D6W-0005Y4-VE for grub-devel@gnu.org; Tue, 10 Jun 2008 19:18:17 -0400 Received: from [199.232.76.173] (port=55241 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6D6W-0005Y0-Fw for grub-devel@gnu.org; Tue, 10 Jun 2008 19:18:16 -0400 Received: from c60.cesmail.net ([216.154.195.49]:63918) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1K6D6W-00027k-8c for grub-devel@gnu.org; Tue, 10 Jun 2008 19:18:16 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 10 Jun 2008 19:18:15 -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 79DCF619058 for ; Tue, 10 Jun 2008 19:18:15 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <1213138695.2345.4.camel@dv> References: <20080604233536.GA21711@thorin> <1212910148.14564.4.camel@rd> <1212950530.8619.7.camel@dv> <1212975838.3863.35.camel@dv> <1213122389.2348.21.camel@dv> <1213138695.2345.4.camel@dv> Content-Type: text/plain Date: Tue, 10 Jun 2008 19:18:14 -0400 Message-Id: <1213139894.2345.13.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: [RFC PATCH] 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 23:18:18 -0000 Hello! Here's the patch with some cleanups and nice wrapped lines. I leaving out other fixes from e3.diff, they should be applied separately and don't appear to be critical for my setup. Changelog: * fs/ext2.c (grub_ext2_blockgroup): Call grub_fshelp_map_block() for the block that contains data for the requested group. diff --git a/fs/ext2.c b/fs/ext2.c index ffe9e33..f8642bb 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -257,12 +257,18 @@ inline static grub_err_t grub_ext2_blockgroup (struct grub_ext2_data *data, int group, struct grub_ext2_block_group *blkgrp) { + int blkno, blkoff; + + blkoff = group * sizeof (struct grub_ext2_block_group); + blkno = blkoff >> (LOG2_EXT2_BLOCK_SIZE (data) + 9); + blkoff -= (blkno << (LOG2_EXT2_BLOCK_SIZE (data) + 9)); + blkno += grub_le_to_cpu32 (data->sblock.first_data_block) + 1; + return grub_disk_read (data->disk, - (grub_fshelp_map_block (data->journal, - grub_le_to_cpu32 (data->sblock.first_data_block) + 1) + (grub_fshelp_map_block (data->journal, blkno) << LOG2_EXT2_BLOCK_SIZE (data)), - group * sizeof (struct grub_ext2_block_group), - sizeof (struct grub_ext2_block_group), (char *) blkgrp); + blkoff, sizeof (struct grub_ext2_block_group), + (char *) blkgrp); } -- Regards, Pavel Roskin