Loading fs_mgr/libsnapshot/include/libsnapshot/snapshot.h +1 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,7 @@ class SnapshotManager final { std::string GetSnapshotBootIndicatorPath(); std::string GetRollbackIndicatorPath(); std::string GetForwardMergeIndicatorPath(); // Return the name of the device holding the "snapshot" or "snapshot-merge" // target. This may not be the final device presented via MapSnapshot(), if Loading fs_mgr/libsnapshot/snapshot.cpp +16 −2 Original line number Diff line number Diff line Loading @@ -228,10 +228,17 @@ bool SnapshotManager::RemoveAllUpdateState(LockedFile* lock, const std::function return false; } // It's okay if these fail - first-stage init performs a deeper check after // It's okay if these fail: // - For SnapshotBoot and Rollback, first-stage init performs a deeper check after // reading the indicator file, so it's not a problem if it still exists // after the update completes. std::vector<std::string> files = {GetSnapshotBootIndicatorPath(), GetRollbackIndicatorPath()}; // - For ForwardMerge, FinishedSnapshotWrites asserts that the existence of the indicator // matches the incoming update. std::vector<std::string> files = { GetSnapshotBootIndicatorPath(), GetRollbackIndicatorPath(), GetForwardMergeIndicatorPath(), }; for (const auto& file : files) { RemoveFileIfExists(file); } Loading Loading @@ -992,6 +999,10 @@ std::string SnapshotManager::GetRollbackIndicatorPath() { return metadata_dir_ + "/" + android::base::Basename(kRollbackIndicatorPath); } std::string SnapshotManager::GetForwardMergeIndicatorPath() { return metadata_dir_ + "/allow-forward-merge"; } void SnapshotManager::AcknowledgeMergeSuccess(LockedFile* lock) { RemoveAllUpdateState(lock); } Loading Loading @@ -2438,6 +2449,9 @@ bool SnapshotManager::Dump(std::ostream& os) { ss << "Rollback indicator: " << (access(GetRollbackIndicatorPath().c_str(), F_OK) == 0 ? "exists" : strerror(errno)) << std::endl; ss << "Forward merge indicator: " << (access(GetForwardMergeIndicatorPath().c_str(), F_OK) == 0 ? "exists" : strerror(errno)) << std::endl; bool ok = true; std::vector<std::string> snapshots; Loading Loading
fs_mgr/libsnapshot/include/libsnapshot/snapshot.h +1 −0 Original line number Diff line number Diff line Loading @@ -452,6 +452,7 @@ class SnapshotManager final { std::string GetSnapshotBootIndicatorPath(); std::string GetRollbackIndicatorPath(); std::string GetForwardMergeIndicatorPath(); // Return the name of the device holding the "snapshot" or "snapshot-merge" // target. This may not be the final device presented via MapSnapshot(), if Loading
fs_mgr/libsnapshot/snapshot.cpp +16 −2 Original line number Diff line number Diff line Loading @@ -228,10 +228,17 @@ bool SnapshotManager::RemoveAllUpdateState(LockedFile* lock, const std::function return false; } // It's okay if these fail - first-stage init performs a deeper check after // It's okay if these fail: // - For SnapshotBoot and Rollback, first-stage init performs a deeper check after // reading the indicator file, so it's not a problem if it still exists // after the update completes. std::vector<std::string> files = {GetSnapshotBootIndicatorPath(), GetRollbackIndicatorPath()}; // - For ForwardMerge, FinishedSnapshotWrites asserts that the existence of the indicator // matches the incoming update. std::vector<std::string> files = { GetSnapshotBootIndicatorPath(), GetRollbackIndicatorPath(), GetForwardMergeIndicatorPath(), }; for (const auto& file : files) { RemoveFileIfExists(file); } Loading Loading @@ -992,6 +999,10 @@ std::string SnapshotManager::GetRollbackIndicatorPath() { return metadata_dir_ + "/" + android::base::Basename(kRollbackIndicatorPath); } std::string SnapshotManager::GetForwardMergeIndicatorPath() { return metadata_dir_ + "/allow-forward-merge"; } void SnapshotManager::AcknowledgeMergeSuccess(LockedFile* lock) { RemoveAllUpdateState(lock); } Loading Loading @@ -2438,6 +2449,9 @@ bool SnapshotManager::Dump(std::ostream& os) { ss << "Rollback indicator: " << (access(GetRollbackIndicatorPath().c_str(), F_OK) == 0 ? "exists" : strerror(errno)) << std::endl; ss << "Forward merge indicator: " << (access(GetForwardMergeIndicatorPath().c_str(), F_OK) == 0 ? "exists" : strerror(errno)) << std::endl; bool ok = true; std::vector<std::string> snapshots; Loading