fix: correct stale comment in patch.rs work-list ranges_with call

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.
This commit is contained in:
Matthew Jackson
2026-06-24 00:09:13 -07:00
parent a324e5c62f
commit 4c50ca2122
+7 -5
View File
@@ -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,