Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1IfhDW-0000Zp-QX for mharc-grub-devel@gnu.org; Wed, 10 Oct 2007 15:27:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IfhDV-0000ZL-S9 for grub-devel@gnu.org; Wed, 10 Oct 2007 15:27:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IfhDU-0000YU-Hn for grub-devel@gnu.org; Wed, 10 Oct 2007 15:27:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfhDU-0000YO-AH for grub-devel@gnu.org; Wed, 10 Oct 2007 15:27:36 -0400 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 1IfhDU-0004wz-7q for grub-devel@gnu.org; Wed, 10 Oct 2007 15:27:36 -0400 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 1IfhDS-0003fU-Gx for grub-devel@gnu.org; Wed, 10 Oct 2007 21:27:34 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1IfhD5-0007KF-V7 for grub-devel@gnu.org; Wed, 10 Oct 2007 21:27:11 +0200 Date: Wed, 10 Oct 2007 21:27:11 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20071010192711.GB26777@thorin> References: <8a2a06bb0710100815g5facd8eeyf836034b8b450447@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8a2a06bb0710100815g5facd8eeyf836034b8b450447@mail.gmail.com> Organization: free as in freedom X-Message-Flag: Microsoft discourages use of Outlook. X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-Detected-Kernel: Genre and OS details not recognized. Subject: Re: [PATCH] Workaround for grub_ofdisk_read() 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: Wed, 10 Oct 2007 19:27:38 -0000 On Wed, Oct 10, 2007 at 05:15:19PM +0200, Marcin Kurek wrote: > Hell[o] > > When testing grub on Pegasos 1 machine I was hit by quite weird > problem when reading partition table. It seems my friends firmware > version do not set status to 0 after grub_ieee1275_read() even if the > read was fine. > > Attached patch fixed the problem. > > -- > --- Marcin 'Morgoth' Kurek --- > diff -urN grub2.org/disk/ieee1275/ofdisk.c grub2/disk/ieee1275/ofdisk.c > --- grub2.org/disk/ieee1275/ofdisk.c 2007-07-22 01:32:20.000000000 +0200 > +++ grub2/disk/ieee1275/ofdisk.c 2007-10-07 22:55:48.000000000 +0200 > @@ -124,7 +124,7 @@ > grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector, > grub_size_t size, char *buf) > { > - grub_ssize_t status, actual; > + grub_ssize_t status = 0, actual = 0; > unsigned long long pos; > > grub_dprintf ("disk", The "status" part seems good; then I wondered why you also set "actual" and found... if (actual != actual) return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu", sector); woops. actual is never != actual!! what is this supposed to do? If it works like grub_ieee1275_seek, I suppose what we want is to zero it and then compare it with 0? (instead of with itself ;-)). -- 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 /.)