summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2021-07-16 20:02:11 -0700
committerDavid Anderson <dvander@google.com>2022-01-05 23:47:11 +0000
commit6834fe66d7995b4016dcaa652c847f1948cf1571 (patch)
tree229b3924cc1cbff27ed24e0e357a029d0f39a1f9
parent654bb5225bcaedb388839b60675c3751573bb174 (diff)
libsnapshot: Propagate merge phase across merge failures.
If a merge fails we write a new snapshot status indicating that the merge failed. If this happens to occur during the second merge phase, we fail to propagate the phase counter to the new status. This means the merge is unlikely to make progress and succeed later. Bug: 213031779 Bug: 213253413 Bug: 193549218 Ignore-AOSP-First: cherry-pick from AOSP Test: inject transient failure into CheckMergeConsistency, apply OTA, reboot and complete merge. Change-Id: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f Merged-In: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f
-rw-r--r--fs_mgr/libsnapshot/snapshot.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs_mgr/libsnapshot/snapshot.cpp b/fs_mgr/libsnapshot/snapshot.cpp
index 4c94da28f..9a5f6902f 100644
--- a/fs_mgr/libsnapshot/snapshot.cpp
+++ b/fs_mgr/libsnapshot/snapshot.cpp
@@ -2556,6 +2556,7 @@ bool SnapshotManager::WriteUpdateState(LockedFile* lock, UpdateState state,
SnapshotUpdateStatus old_status = ReadSnapshotUpdateStatus(lock);
status.set_compression_enabled(old_status.compression_enabled());
status.set_source_build_fingerprint(old_status.source_build_fingerprint());
+ status.set_merge_phase(old_status.merge_phase());
}
return WriteSnapshotUpdateStatus(lock, status);
}