From 4c50ca2122233eeb9c37483257703ebc45cbc18e Mon Sep 17 00:00:00 2001 From: Matthew Jackson <1085847+MattJackson@users.noreply.github.com> Date: Wed, 24 Jun 2026 00:09:13 -0700 Subject: [PATCH] fix: correct stale comment in patch.rs work-list ranges_with call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The comment at line 404 claimed "every non-Finished range" but the immediately-following ranges_with call lists only NonTrimmed, NonScraped, and Unreadable — deliberately omitting NonTried. Update the comment to accurately reflect the actual status list and explain that NonTried is excluded because it is handled by a preceding sweep pass, not by patch. --- src/disc/patch.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/disc/patch.rs b/src/disc/patch.rs index 5c20c18..16c0bd0 100644 --- a/src/disc/patch.rs +++ b/src/disc/patch.rs @@ -401,11 +401,13 @@ pub(super) fn compute_initial_state( let total_bytes = map.total_size(); let initial_stats = map.stats(); let initial_entries: Vec<_> = map.entries().to_vec(); - // Every retry pass acts on every non-Finished range. Including - // Unreadable means a sector that failed in pass N gets a fresh - // shot in pass N+1 — drive state evolves, the same read can - // succeed later. Each pass owns its own jumps/skips; if pass 5 - // jumps over the same zone as pass 2, fine. + // Every retry pass acts on NonTrimmed, NonScraped, and Unreadable + // ranges. Including Unreadable means a sector that failed in pass N + // gets a fresh shot in pass N+1 — drive state evolves, the same + // read can succeed later. Each pass owns its own jumps/skips; if + // pass 5 jumps over the same zone as pass 2, fine. NonTried ranges + // are intentionally excluded — they are covered by a preceding + // sweep pass, not by patch. let mut bad_ranges = map.ranges_with(&[ mapfile::SectorStatus::NonTrimmed, mapfile::SectorStatus::NonScraped,