All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] grub incorrectly identifies ext3 as fat
@ 2009-10-29 14:58 Andrew Clausen
  2009-10-30 18:57 ` Robert Millan
  0 siblings, 1 reply; 22+ messages in thread
From: Andrew Clausen @ 2009-10-29 14:58 UTC (permalink / raw)
  To: grub-devel

Hi all,

grub (both the boot loader, and grub-probe) incorrectly identifies my
ext3 partition as containing a fat file system. This means it can't
boot without manual tweaking.  The problem is caused by stale fat
signatures... this is probably a common problem, as mke2fs often
doesn't wipe old signatures.

I wrote a patch.  In order for a file system to be considered
detected, dir() must not only succeed, it also must find at least one
file or directory. This is pretty effective at ruling out misdetecting
a filesystem based on a stale signature that wasn't wiped by mkfs.
This shouldn't have any collateral damage, because empty file systems
are useless to Grub.

I filed a bug report here:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/463015

--- grub-1.97~beta4/kern/fs.c 2009-07-16 18:14:09.000000000 -0400
+++ grub-1.97~beta4-fixed/kern/fs.c 2009-10-28 22:36:49.000000000 -0400
@@ -65,12 +65,14 @@
 grub_fs_probe (grub_device_t device)
 {
   grub_fs_t p;
+ int found_file;
   auto int dummy_func (const char *filename,
          const struct grub_dirhook_info *info);

   int dummy_func (const char *filename __attribute__ ((unused)),
     const struct grub_dirhook_info *info __attribute__ ((unused)))
     {
+ found_file = 1;
       return 1;
     }

@@ -82,8 +84,10 @@
       for (p = grub_fs_list; p; p = p->next)
  {
    grub_dprintf ("fs", "Detecting %s...\n", p->name);
+
+ found_file = 0;
    (p->dir) (device, "/", dummy_func);
- if (grub_errno == GRUB_ERR_NONE)
+ if (grub_errno == GRUB_ERR_NONE && found_file)
      return p;

    grub_error_push ();

Cheers,
Andrew



^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2009-11-11 17:24 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 14:58 [patch] grub incorrectly identifies ext3 as fat Andrew Clausen
2009-10-30 18:57 ` Robert Millan
2009-10-30 19:06   ` Felix Zielcke
2009-10-30 19:19   ` Andrew Clausen
2009-10-30 22:46     ` Robert Millan
2009-10-31  6:44       ` Andrew Clausen
2009-10-31 10:04         ` Felix Zielcke
2009-10-31 15:39           ` Andrew Clausen
2009-10-31 16:06             ` Robert Millan
2009-10-31 18:43               ` Andrew Clausen
2009-10-31 18:52                 ` Vladimir 'phcoder' Serbinenko
2009-11-11 16:28                   ` Andrew Clausen
2009-10-31 19:15                 ` Robert Millan
2009-11-09 23:14                   ` Robert Millan
2009-11-11 17:24                     ` Andrew Clausen
2009-10-31 18:02           ` rubisher
2009-10-31 18:46             ` Felix Zielcke
2009-10-31 10:10         ` Robert Millan
2009-10-31 10:34           ` Felix Zielcke
2009-10-31 11:30             ` Robert Millan
2009-10-31 11:38               ` Felix Zielcke
2009-10-31 18:31                 ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.