Merge pull request #33 from marineam/repair-corruption

Fix gptprio to properly detect and repair corruption
This commit is contained in:
Michael Marineau 2016-08-22 19:40:21 -07:00 committed by GitHub
commit 87dfbf34c4
4 changed files with 63 additions and 6 deletions

View file

@ -649,7 +649,7 @@ grub_gpt_write (grub_disk_t disk, grub_gpt_t gpt)
{
/* TODO: update/repair protective MBRs too. */
if (!(gpt->status & GRUB_GPT_BOTH_VALID))
if ((gpt->status & GRUB_GPT_BOTH_VALID) != GRUB_GPT_BOTH_VALID)
return grub_error (GRUB_ERR_BAD_PART_TABLE, "Invalid GPT data");
grub_dprintf ("gpt", "writing primary GPT to %s\n", disk->name);