Fix partial read failure on last block of src partition
When an XOR op is at the very end of partition with >0 src_offest,
update_engine will attempt to read beyond partition size and fail.
Convert such blocks to REPLACE instead.
Bug: 276366819
Change-Id: I6e50037c192599f4d0c78da35ef2aa26cf2e92de
diff --git a/payload_consumer/vabc_partition_writer.cc b/payload_consumer/vabc_partition_writer.cc
index 92f27a9..17b7d50 100644
--- a/payload_consumer/vabc_partition_writer.cc
+++ b/payload_consumer/vabc_partition_writer.cc
@@ -358,7 +358,11 @@
std::unique_ptr<ExtentWriter> writer =
IsXorEnabled() ? std::make_unique<XORExtentWriter>(
- operation, source_fd, cow_writer_.get(), xor_map_)
+ operation,
+ source_fd,
+ cow_writer_.get(),
+ xor_map_,
+ partition_update_.old_partition_info().size())
: CreateBaseExtentWriter();
return executor_.ExecuteDiffOperation(
operation, std::move(writer), source_fd, data, count);