Merge "Preserve the monotonic property when subtracting 0 block"
This commit is contained in:
@@ -250,13 +250,17 @@ class SparseImage(object):
|
|||||||
with open(fn) as f:
|
with open(fn) as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
fn, ranges_text = line.rstrip().split(None, 1)
|
fn, ranges_text = line.rstrip().split(None, 1)
|
||||||
ranges = rangelib.RangeSet.parse(ranges_text)
|
raw_ranges = rangelib.RangeSet.parse(ranges_text)
|
||||||
|
|
||||||
# Note: e2fsdroid records holes in the extent tree as "0" blocks.
|
# Note: e2fsdroid records holes in the extent tree as "0" blocks.
|
||||||
# This causes confusion because clobbered_blocks always includes
|
# This causes confusion because clobbered_blocks always includes
|
||||||
# the superblock (physical block #0). Since the 0 blocks here do
|
# the superblock (physical block #0). Since the 0 blocks here do
|
||||||
# not represent actual physical blocks, remove them from the set.
|
# not represent actual physical blocks, remove them from the set.
|
||||||
ranges = ranges.subtract(rangelib.RangeSet("0"))
|
ranges = raw_ranges.subtract(rangelib.RangeSet("0"))
|
||||||
|
# b/150334561 we need to perserve the monotonic property of the raw
|
||||||
|
# range. Otherwise, the validation script will read the blocks with
|
||||||
|
# wrong order when pulling files from the image.
|
||||||
|
ranges.monotonic = raw_ranges.monotonic
|
||||||
ranges.extra['text_str'] = ranges_text
|
ranges.extra['text_str'] = ranges_text
|
||||||
|
|
||||||
if allow_shared_blocks:
|
if allow_shared_blocks:
|
||||||
|
Reference in New Issue
Block a user