diff options
author | Gilad Arnold <garnold@chromium.org> | 2013-05-14 09:19:17 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-05-14 20:43:26 -0700 |
commit | 4f50b413c60a5ef8d642b9d7493baa92c8eedd09 (patch) | |
tree | 69d8701d45ac7c74617282f4b1ca474823a73306 /scripts/update_payload/checker.py | |
parent | 658185a5bd909c0abe8a55523a4e3cab3f9b26c8 (diff) |
paycheck: allow src_extents to span the whole new partition size
In a previous fix, we allowed paycheck to consider the whole new
partition (beyond just the filesystem) as valid range for write
operations. However, since updates are done in place, they should also
be considered valid for read operations. This is now fixed.
BUG=chromium:240726
TEST=Previously failing delta update now verified successfully
Change-Id: Ib904c0265e2fd61ab0768169b3257c4131441888
Reviewed-on: https://gerrit.chromium.org/gerrit/51138
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
Diffstat (limited to 'scripts/update_payload/checker.py')
-rw-r--r-- | scripts/update_payload/checker.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/update_payload/checker.py b/scripts/update_payload/checker.py index 7631cb0b..a9edce3f 100644 --- a/scripts/update_payload/checker.py +++ b/scripts/update_payload/checker.py @@ -772,7 +772,7 @@ class PayloadChecker(object): total_dst_blocks * self.block_size)) def _CheckOperation(self, op, op_name, is_last, old_block_counters, - new_block_counters, old_fs_size, new_usable_size, + new_block_counters, old_usable_size, new_usable_size, prev_data_offset, allow_signature, blob_hash_counts): """Checks a single update operation. @@ -782,8 +782,8 @@ class PayloadChecker(object): is_last: whether this is the last operation in the sequence old_block_counters: arrays of block read counters new_block_counters: arrays of block write counters - old_fs_size: the old filesystem size in bytes - new_usable_size: the overall usable size of the new partition in bytes + old_usable_size: the overall usable size for src data in bytes + new_usable_size: the overall usable size for dst data in bytes prev_data_offset: offset of last used data bytes allow_signature: whether this may be a signature operation blob_hash_counts: counters for hashed/unhashed blobs @@ -795,7 +795,7 @@ class PayloadChecker(object): """ # Check extents. total_src_blocks = self._CheckExtents( - op.src_extents, old_fs_size, old_block_counters, + op.src_extents, old_usable_size, old_block_counters, op_name + '.src_extents', allow_pseudo=True) allow_signature_in_extents = (allow_signature and is_last and op.type == common.OpType.REPLACE) @@ -897,7 +897,7 @@ class PayloadChecker(object): base_name: the name of the operation block old_fs_size: the old filesystem size in bytes new_fs_size: the new filesystem size in bytes - new_usable_size: the olverall usable size of the new partition in bytes + new_usable_size: the overall usable size of the new partition in bytes prev_data_offset: offset of last used data bytes allow_signature: whether this sequence may contain signature operations Returns: @@ -931,7 +931,7 @@ class PayloadChecker(object): blob_hash_counts['signature'] = 0 # Allocate old and new block counters. - old_block_counters = (self._AllocBlockCounters(old_fs_size) + old_block_counters = (self._AllocBlockCounters(new_usable_size) if old_fs_size else None) new_block_counters = self._AllocBlockCounters(new_usable_size) @@ -948,8 +948,9 @@ class PayloadChecker(object): is_last = op_num == len(operations) curr_data_used = self._CheckOperation( op, op_name, is_last, old_block_counters, new_block_counters, - old_fs_size, new_usable_size, prev_data_offset + total_data_used, - allow_signature, blob_hash_counts) + new_usable_size if old_fs_size else 0, new_usable_size, + prev_data_offset + total_data_used, allow_signature, + blob_hash_counts) if curr_data_used: op_blob_totals[op.type] += curr_data_used total_data_used += curr_data_used |