From a2cff952cf28b33338a45bd57e37d04ebfaec93e Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 2 Nov 2018 15:44:07 -0700 Subject: updater: Error out on underrun during patching. Test: Run recovery_component_test on marlin. Change-Id: If23baf42aeacb48500edabc2eadd2e7119a848da --- updater/blockimg.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'updater/blockimg.cpp') diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp index 47849a155..c4c09098e 100644 --- a/updater/blockimg.cpp +++ b/updater/blockimg.cpp @@ -1399,7 +1399,10 @@ static int PerformCommandDiff(CommandParameters& params) { // We expect the output of the patcher to fill the tgt ranges exactly. if (!writer.Finished()) { - LOG(ERROR) << "range sink underrun?"; + LOG(ERROR) << "Failed to fully write target blocks (range sink underrun): Missing " + << writer.AvailableSpace() << " bytes"; + failure_type = kPatchApplicationFailure; + return -1; } } else { LOG(INFO) << "skipping " << blocks << " blocks already patched to " << tgt.blocks() << " [" -- cgit v1.2.3