From 6b8a26575b6d36d5eb1e3d840f3c6527e6fbedf0 Mon Sep 17 00:00:00 2001 From: Jakob Cornell Date: Sun, 21 Aug 2022 10:31:39 -0500 Subject: [PATCH] Fix verify output range merge bug (disk block unaligned pieces) --- disk_jumble/src/disk_jumble/verify.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.30.2