Do not skip copying in place block if source corrupted
In VAB(both plain and VABC), we will skip copying some blocks if the
source and target extents are exactly the same. However, if these source
blocks are corrupted then we would miss the oppoturnity to correct them
using FEC.
To address this issue, attempt to FEC correct the corrupted blocks and
write these blocks back to source partition.
Test: th
Bug: 276846805
Change-Id: Ic1e0276a310cff0be3695ef5f3a2c99437c29159
diff --git a/payload_consumer/verified_source_fd.h b/payload_consumer/verified_source_fd.h
index f7d0620..6d859b9 100644
--- a/payload_consumer/verified_source_fd.h
+++ b/payload_consumer/verified_source_fd.h
@@ -39,6 +39,9 @@
[[nodiscard]] bool Open();
private:
+ bool WriteBackCorrectedSourceBlocks(
+ const std::vector<unsigned char>& source_data,
+ const google::protobuf::RepeatedPtrField<Extent>& extents);
bool OpenCurrentECCPartition();
const size_t block_size_;
const std::string source_path_;