[Top][All Lists]

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

Re: grub-probe detects ext4 wronly as ext2

From: Javier Martín
Subject: Re: grub-probe detects ext4 wronly as ext2
Date: Mon, 11 Aug 2008 16:14:00 +0200

Hi there,

After reading Felix's reply I've once again found your post and
implemented your request, so here is a new version of the patch
("version 6"). Sorry for missing your message in the first instance...

2008/7/19 Robert Millan <address@hidden>:
> On Sat, Jul 05, 2008 at 08:36:13PM +0200, Javier Martín wrote:
>> > >    grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_ext2_sblock),
>> > >                    (char *) &data->sblock);
>> > >    if (grub_errno)
>> > > -    goto fail;
>> > > +    EXT2_DRIVER_MOUNT_FAIL("could not read the superblock")
>> >
>> > This overrides the grub_errno and grub_errmsg provided by grub_disk_read 
>> > and
>> > replaces them with values that hide the true problem.  If there was a disk
>> > read error, we really want to know about it from the lower layer.
>> Well, the old version did just the same (even worse, because the message
>> was generic). What would be the correct path of action here? I mean, how
>> can we propagate the error messages?
> It shouldn't call grub_error().

So in the cases the fail is caused by an underlying error (like I/O)
the code should just return failure and leave the old error in errno
and errmsg? OK then, II adapted the code to cope with this: now it
only raises its own errors when appropriate.

>>   fail:
>> -  grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem");
>> +  if (!err_msg)
>> +    err_msg = "DEBUG: mount failed but no error message supplied!";
> No need to check for consistency in your own code.  This might be a good
> practice in userland programs but here it's a waste of space.  Just make sure
> your code is correct.

Ok, removed this particular check (but now there is another one to
check whether raising a local error is required).


> --
> Robert Millan
> <GPLv2> I know my rights; I want my phone call!
> <DRM> What good is a phone call… if you are unable to speak?
> (as seen on /.)
> _______________________________________________
> Grub-devel mailing list
> address@hidden

Attachment: ext2_incompat.patch.6
Description: Binary data

reply via email to

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