From: Vladimir 'phcoder' Serbinenko Date: Thu, 3 May 2012 22:36:23 +0000 (+0200) Subject: * grub-core/kern/fs.c (grub_fs_probe) [GRUB_UTIL]: Add workaround for X-Git-Tag: 2.00~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=076aeb5022dc043e523e931459500840883085a2;p=thirdparty%2Fgrub.git * grub-core/kern/fs.c (grub_fs_probe) [GRUB_UTIL]: Add workaround for btrfs. --- diff --git a/ChangeLog b/ChangeLog index 632572a64..d654fd7f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-05-04 Vladimir Serbinenko + + * grub-core/kern/fs.c (grub_fs_probe) [GRUB_UTIL]: Add workaround for + btrfs. + 2012-05-04 Vladimir Serbinenko * docs/grub.cfg: Update. diff --git a/grub-core/kern/fs.c b/grub-core/kern/fs.c index 8fe28cc5d..a45004034 100644 --- a/grub-core/kern/fs.c +++ b/grub-core/kern/fs.c @@ -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;