grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Set size of partition correctly in grub_disk_open()


From: Yoshinori K. Okuji
Subject: Re: [PATCH] Set size of partition correctly in grub_disk_open()
Date: Sat, 8 Jul 2006 18:07:44 +0200
User-agent: KMail/1.8.2

Hi Jeroen,

On Wednesday 05 July 2006 22:54, Jeroen Dekkers wrote:
>    if (p)
> -    disk->partition = grub_partition_probe (disk, p + 1);
> +    {
> +      disk->partition = grub_partition_probe (disk, p + 1);
> +      if (! disk->partition)
> +     {
> +       grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition");
> +       goto fail;
> +     }

I agree with this part.

> +
> +      disk->total_sectors = grub_partition_get_len (disk->partition);
> +    }

But I don't agree with this part. The member "total_sectors" must describe the 
size of the whole disk but not of the partition. This is because GRUB 
accesses partitions through the disk interface. When accessing a partition, 
GRUB tweaks offsets by the start sector of the partition. If not, it is 
another bug.

Thanks,
Okuji




reply via email to

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