commit | 7407e55c61333a68b0a5226e69b9b5bb59551a5f | [log] [tgz] |
---|---|---|
author | David Anderson <dvander@google.com> | Wed Mar 10 02:11:56 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Mar 10 02:11:56 2021 +0000 |
tree | 7cb21e4b5dbb81c72662b47136b75315fe1d2f07 | |
parent | ab2d6d18684a19e783dc60bbb1343ecbe55825f6 [diff] | |
parent | 0e1c7fd2729c9de9ae10abe96eb41a35285eada5 [diff] |
Verify that dynamic partitions have a usable size after resizing. am: 0e1c7fd272 Original change: https://android-review.googlesource.com/c/platform/system/update_engine/+/1622586 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Id2d80013a6beb366c034211ed011b33f74cc2f8c
diff --git a/aosp/dynamic_partition_control_android.cc b/aosp/dynamic_partition_control_android.cc index 62da659..6bf896c 100644 --- a/aosp/dynamic_partition_control_android.cc +++ b/aosp/dynamic_partition_control_android.cc
@@ -939,6 +939,12 @@ << " to size " << partition_size << ". Not enough space?"; return false; } + if (p->size() < partition_size) { + LOG(ERROR) << "Partition " << partition_name_suffix + << " was expected to have size " << partition_size + << ", but instead has size " << p->size(); + return false; + } LOG(INFO) << "Added partition " << partition_name_suffix << " to group " << group_name_suffix << " with size " << partition_size; }