update_engine: fix cow estimation error
Cow sizing was accidentally doubled
Test: th
Change-Id: Id4b8860375fc820647f741df558461eb529868cf
diff --git a/payload_generator/delta_diff_generator.cc b/payload_generator/delta_diff_generator.cc
index ed9bf4e..44d97df 100644
--- a/payload_generator/delta_diff_generator.cc
+++ b/payload_generator/delta_diff_generator.cc
@@ -144,9 +144,8 @@
config_.target.dynamic_partition_metadata->compression_factor());
// add a 1% overhead to our estimation
- cow_info_->cow_size += cow_info_->cow_size * 1.01;
- cow_info_->op_count_max +=
- std::max(int(cow_info_->op_count_max * 1.01), 25);
+ cow_info_->cow_size = cow_info_->cow_size * 1.01;
+ cow_info_->op_count_max = std::max(int(cow_info_->op_count_max), 25);
// ops buffer size == 0 for v2 version of cow format
LOG(INFO) << "Estimated COW size for partition: " << new_part_.name << " "
<< cow_info_->cow_size