grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Workaround for grub_ofdisk_read()


From: Robert Millan
Subject: Re: [PATCH] Workaround for grub_ofdisk_read()
Date: Wed, 10 Oct 2007 21:27:11 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

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

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]