From c41db9e6908d3b756efd47534720c7da095abd19 Mon Sep 17 00:00:00 2001 From: Weiping Zhang Date: Thu, 21 Jun 2018 23:47:10 +0800 Subject: load main partition table if main header crc is ok mainCrcOk and secondCrcOk were overwritten by header rebuilding. Signed-off-by: Weiping Zhang --- gpt.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gpt.cc') diff --git a/gpt.cc b/gpt.cc index 28c52a7..5a14594 100644 --- a/gpt.cc +++ b/gpt.cc @@ -899,9 +899,8 @@ int GPTData::ForceLoadGPTData(void) { } // if/else/if // Figure out which partition table to load.... - // Load the main partition table, since either its header's CRC is OK or the - // backup header's CRC is not OK.... - if (mainCrcOk || !secondCrcOk) { + // Load the main partition table, if its header's CRC is OK + if (validHeaders != 2) { if (LoadMainTable() == 0) allOK = 0; } else { // bad main header CRC and backup header CRC is OK -- cgit v1.2.1