From e8c68a03c8406a9cf239ee11240bfeb83c15e523 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Sun, 26 Feb 2017 10:48:11 -0800 Subject: [PATCH] releasetools: Fix an equality check bug when asserting stash size. Otherwise the comparison is inconsistent between ReviseStashSize() and WriteTransfers(). Bug: 35775675 Test: Successfully generate a previously failed incremental. Change-Id: I554a51a210bf322cb5c79e28cf85607a417b094a --- tools/releasetools/blockimgdiff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/releasetools/blockimgdiff.py b/tools/releasetools/blockimgdiff.py index 1edf5b2a6d..c204c90b2e 100644 --- a/tools/releasetools/blockimgdiff.py +++ b/tools/releasetools/blockimgdiff.py @@ -567,7 +567,7 @@ class BlockImageDiff(object): cache_size = common.OPTIONS.cache_size stash_threshold = common.OPTIONS.stash_threshold max_allowed = cache_size * stash_threshold - assert max_stashed_blocks * self.tgt.blocksize < max_allowed, \ + assert max_stashed_blocks * self.tgt.blocksize <= max_allowed, \ 'Stash size %d (%d * %d) exceeds the limit %d (%d * %.2f)' % ( max_stashed_blocks * self.tgt.blocksize, max_stashed_blocks, self.tgt.blocksize, max_allowed, cache_size,