Recover source hash failures on SOURCE_COPY operations.
SOURCE_COPY operations may fail due to a mismatch in the source data
read from the device and the expected hash of such data as specified in
the operation. This means either a failure to read the source partition
block device or corrupt data on the source partition.
A device in this state may continue to work even with a corrupt source
partition if the corrupt block has not be accessed or if the error
correction data stored with the verity metadata is able to correct that
block.
This patch attempts to use libfec to parse the error-correction data and
correct the corrupt blocks when the source hash mismatches in
SOURCE_COPY operations.
Bug: 34284069
Test: Added unittests to the error-correction fallback logic.
Change-Id: I9400405071de0d124ab3330c335b8ab87e60532e
9 files changed