[parted-devel] [PATCH 1/2] gpt_read: reintroduce restoring the primary/backup GPT when corruption

Hatayama, Daisuke d.hatayama at jp.fujitsu.com
Wed Nov 7 07:11:05 GMT 2018


Currently, no primary/backup GPT is restored when one of them is
corrupted due to the commit 432a33115c50005bbe96a09d55edc7d034715ec8.

According to the description of the commit, the purpose of the commit
is to deal with corruption of pMBR due to another issue during
clobbering, but there seems no such issue because now
ped_disk_clobber() avoids pMBR to clobber.

This is essentially a revert of the commit
432a33115c50005bbe96a09d55edc7d034715ec8.
---
 libparted/labels/gpt.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libparted/labels/gpt.c b/libparted/labels/gpt.c
index 860f415..914dfe3 100644
--- a/libparted/labels/gpt.c
+++ b/libparted/labels/gpt.c
@@ -1042,6 +1042,7 @@ gpt_read (PedDisk *disk)
         goto error_free_gpt;
 
       gpt = primary_gpt;
+      write_back = 1;
     }
   else /* !primary_gpt && backup_gpt */
     {
@@ -1054,6 +1055,7 @@ gpt_read (PedDisk *disk)
         goto error_free_gpt;
 
       gpt = backup_gpt;
+      write_back = 1;
     }
   backup_gpt = NULL;
   primary_gpt = NULL;
-- 
1.7.1





More information about the parted-devel mailing list