]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/fs.c (grub_fs_probe) [GRUB_UTIL]: Add workaround for
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 3 May 2012 22:36:23 +0000 (00:36 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 3 May 2012 22:36:23 +0000 (00:36 +0200)
btrfs.

ChangeLog
grub-core/kern/fs.c

index 632572a6449e24fddc5df6d1c41f88e6b1c3810b..d654fd7f653717f53d69599e810dfedbf59bc42b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-04  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/kern/fs.c (grub_fs_probe) [GRUB_UTIL]: Add workaround for
+       btrfs.
+
 2012-05-04  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * docs/grub.cfg: Update.
index 8fe28cc5dcb5e84fb89d74900eac6d4803af9cdc..a45004034b7db37ac0ce189bb89bc7c9114a4253 100644 (file)
@@ -53,7 +53,23 @@ grub_fs_probe (grub_device_t device)
       for (p = grub_fs_list; p; p = p->next)
        {
          grub_dprintf ("fs", "Detecting %s...\n", p->name);
-         (p->dir) (device, "/", dummy_func);
+
+         /* This is evil: newly-created just mounted BtrFS after copying all
+            GRUB files has a very peculiar unrecoverable corruption which
+            will be fixed at sync but we'd rather not do a global sync and
+            syncing just files doesn't seem to help. Relax the check for
+            this time.  */
+#ifdef GRUB_UTIL
+         if (grub_strcmp (p->name, "btrfs") == 0)
+           {
+             char *label = 0;
+             p->uuid (device, &label);
+             if (label)
+               grub_free (label);
+           }
+         else
+#endif
+           (p->dir) (device, "/", dummy_func);
          if (grub_errno == GRUB_ERR_NONE)
            return p;