From: Jakob Cornell Date: Sun, 21 Aug 2022 15:31:39 +0000 (-0500) Subject: Fix verify output range merge bug (disk block unaligned pieces) X-Git-Url: https://jcornell.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=HEAD;p=eros.git Fix verify output range merge bug (disk block unaligned pieces) --- diff --git a/disk_jumble/src/disk_jumble/verify.py b/disk_jumble/src/disk_jumble/verify.py index 19cf1a7..5229f51 100644 --- a/disk_jumble/src/disk_jumble/verify.py +++ b/disk_jumble/src/disk_jumble/verify.py @@ -359,7 +359,9 @@ def _do_verify( def clean_up(ranges): out = [] for r in sorted(ranges, key = lambda r: r.start): - if out and r.start == out[-1].stop: + if out: + assert r.start >= out[-1].stop - 1 + if out and r.start <= out[-1].stop: out[-1] = range(out[-1].start, r.stop) else: out.append(r)