liblp: Improve reliability of UpdatePartitionTable.
If UpdatePartitionTable is interrupted while writing metadata, the next update becomes much more risky, as only one valid copy may exist. If that subsequent update is interrupted, all metadata copies may be corrupt. To alleviate this, we now synchronize both metadata copies before each update. If the backup copy is corrupted, we replace it with the primary copy, and vice versa. Similarly if the primary and backup metadata do not match, we sync the backup to contain the same data as the primary. If for some reason this synchronization process fails, we do not proceed to write a new partition table. Bug: 79173901 Test: liblp_test gtest Change-Id: Ic80cf9a5dc6336ff532e069ca5c8c76371550cb9
Loading
Please register or sign in to comment