From 076aeb5022dc043e523e931459500840883085a2 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 4 May 2012 00:36:23 +0200 Subject: [PATCH] * grub-core/kern/fs.c (grub_fs_probe) [GRUB_UTIL]: Add workaround for btrfs. --- ChangeLog | 5 +++++ grub-core/kern/fs.c | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) 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;