From c2bb3ee6d67ebe4853845004cc0fa8b2dec38bba Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 16 Jul 2021 20:02:11 -0700 Subject: [PATCH] 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: 193549218 Test: manual test Change-Id: I31fdae6bde48e3a71b6f3fcc663541257f7ebd8f --- fs_mgr/libsnapshot/snapshot.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/fs_mgr/libsnapshot/snapshot.cpp b/fs_mgr/libsnapshot/snapshot.cpp index bed5f563d..c3db32e33 100644 --- a/fs_mgr/libsnapshot/snapshot.cpp +++ b/fs_mgr/libsnapshot/snapshot.cpp @@ -2530,6 +2530,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); }