summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2019-10-01 16:30:54 -0700
committerYifan Hong <elsk@google.com>2019-10-01 19:43:33 -0700
commit1d99674e5d5627ce49b51a7cd5b52c36a9738ad1 (patch)
treeef579aa2ccab459228e23a5d078aff5f635b4140
parent55fb297a0c67939c2c70428d094105798136143e (diff)
libsnapshot: Skip initializing snapshot if not created.
If no opeartions is to be executed on a partition, it is possible that no snapshot is created for it. In that case, don't crash when initalizing snapshots. Test: libsnapshot_test Change-Id: I7bb0b5596aa6e4eca319e9c88f6552d1907a6944
-rw-r--r--fs_mgr/libsnapshot/snapshot.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs_mgr/libsnapshot/snapshot.cpp b/fs_mgr/libsnapshot/snapshot.cpp
index 020007733..354aafa90 100644
--- a/fs_mgr/libsnapshot/snapshot.cpp
+++ b/fs_mgr/libsnapshot/snapshot.cpp
@@ -1977,7 +1977,7 @@ bool SnapshotManager::InitializeUpdateSnapshots(
}
auto it = all_snapshot_status.find(target_partition->name());
- CHECK(it != all_snapshot_status.end()) << target_partition->name();
+ if (it == all_snapshot_status.end()) continue;
cow_params.partition_name = target_partition->name();
std::string cow_name;
if (!MapCowDevices(lock, cow_params, it->second, &created_devices_for_cow, &cow_name)) {