From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K4koq-0006Im-E2 for mharc-grub-devel@gnu.org; Fri, 06 Jun 2008 18:54:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4koo-0006IV-Dy for grub-devel@gnu.org; Fri, 06 Jun 2008 18:53:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4kol-0006II-W4 for grub-devel@gnu.org; Fri, 06 Jun 2008 18:53:57 -0400 Received: from [199.232.76.173] (port=51739 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4kol-0006IF-RN for grub-devel@gnu.org; Fri, 06 Jun 2008 18:53:55 -0400 Received: from c60.cesmail.net ([216.154.195.49]:35008) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1K4kok-00022Y-DC for grub-devel@gnu.org; Fri, 06 Jun 2008 18:53:55 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 06 Jun 2008 18:53:53 -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 06F99619058 for ; Fri, 6 Jun 2008 18:53:52 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <20080606155649.GA13255@thorin> References: <20080604233536.GA21711@thorin> <20080606155649.GA13255@thorin> Content-Type: text/plain Date: Fri, 06 Jun 2008 18:53:52 -0400 Message-Id: <1212792832.1893.17.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: Fri, 06 Jun 2008 22:53:58 -0000 On Fri, 2008-06-06 at 17:56 +0200, Robert Millan wrote: > Committed. I believe it's wrong. util/biosdisk.c is a low level disk driver. It's supposed to read data relative to the disk, like other drivers do. Besides, is_partition becomes write-only. It means that the result of linux_find_partition() is ignored. Please note that linux_find_partition() modifies its first argument on success. It rewrites the disk device (e.g. /dev/sda) with the partition device (e.g. /dev/sda1). If the result of linux_find_partition() is not checked, nobody knows whether fd is a handle to the partition or to the whole disk. Yet the sector variable is used to seek on that device. Needless to say that different values would be obtained. Also, grub-emu is not the only user of util/biosdisk.c. It is also used by grub-setup, which is working correctly, as far as I can tell. By the way, the current GRUB just failed to install on my test system. After I rebooted it, GRUB hung on startup after showing "GRUB". It may be something else. It was an unclean reboot after a panic for unrelated reasons, so the hanging problem may be an issue with ext3. Anyway, extreme caution is required with the current code! -- Regards, Pavel Roskin