Fix missing label ops during cow size estimation
When installing OTA, update_engine periodically writes label ops to COW
image. But when generating OTA updates, some of those label ops are not
taken into account.
Test: th
Bug: 237362269
Change-Id: I6db5fd9cf310d20177048c67ea4cedf0ead7c7c6
diff --git a/payload_generator/cow_size_estimator.cc b/payload_generator/cow_size_estimator.cc
index 3a23f44..5326d13 100644
--- a/payload_generator/cow_size_estimator.cc
+++ b/payload_generator/cow_size_estimator.cc
@@ -106,14 +106,15 @@
cow_writer->AddLabel(0);
}
for (const auto& op : operations) {
+ cow_writer->AddLabel(0);
if (op.type() == InstallOperation::ZERO) {
for (const auto& ext : op.dst_extents()) {
visited.AddExtent(ext);
cow_writer->AddZeroBlocks(ext.start_block(), ext.num_blocks());
}
- cow_writer->AddLabel(0);
}
}
+ cow_writer->AddLabel(0);
const size_t last_block = partition_size / block_size;
const auto unvisited_extents =
FilterExtentRanges({ExtentForRange(0, last_block)}, visited);