Write blocks in increasing order if src/dst extent start at same block
This is because xor ops can have non-zero offsets, which means dst block
depends on src_block and the block right after that.
Test: th
Bug: 200076590
Bug: 177104308
Change-Id: I9f40a52ff667ebc5f1b334d9d204ac2d5ccb2c6b
diff --git a/payload_consumer/vabc_partition_writer.cc b/payload_consumer/vabc_partition_writer.cc
index 07eff92..6ca94c1 100644
--- a/payload_consumer/vabc_partition_writer.cc
+++ b/payload_consumer/vabc_partition_writer.cc
@@ -170,7 +170,7 @@
// If this is self-overlapping op and |dst_extent| comes before
// |src_extent|, we must write in ascending order for correctness.
if (ExtentRanges::ExtentsOverlap(src_extent, dst_extent) &&
- dst_extent.start_block() < src_extent.start_block()) {
+ dst_extent.start_block() <= src_extent.start_block()) {
for (size_t i = 0; i < dst_extent.num_blocks(); i++) {
blocks_merge_order.push_back(dst_extent.start_block() + i);
}