fix: enforce WEDGE_FAMILY_COOLDOWN_SECS == ZONE_ENTRY_COOLDOWN_SECS at compile time
This commit is contained in:
+4
-2
@@ -319,7 +319,9 @@ const CONSECUTIVE_FAIL_LONG_PAUSE_THRESHOLD: u64 = 10;
|
|||||||
const ADAPTIVE_UPSCALE_THRESHOLD: u32 = 16;
|
const ADAPTIVE_UPSCALE_THRESHOLD: u32 = 16;
|
||||||
// Wedge-family (HARDWARE_ERROR / ILLEGAL_REQUEST) cooldown and abort
|
// Wedge-family (HARDWARE_ERROR / ILLEGAL_REQUEST) cooldown and abort
|
||||||
// thresholds — see `handle_read_failure` below for context.
|
// thresholds — see `handle_read_failure` below for context.
|
||||||
const WEDGE_FAMILY_COOLDOWN_SECS: u64 = 30;
|
// Single source of truth lives in `disc::read_error` so this cannot
|
||||||
|
// drift from `ZONE_ENTRY_COOLDOWN_SECS`.
|
||||||
|
const WEDGE_FAMILY_COOLDOWN_SECS: u64 = crate::disc::read_error::ZONE_ENTRY_COOLDOWN_SECS;
|
||||||
const WEDGE_ABORT_THRESHOLD: u32 = 16;
|
const WEDGE_ABORT_THRESHOLD: u32 = 16;
|
||||||
// Whole-pass stall watchdog: bytes_good must increase within
|
// Whole-pass stall watchdog: bytes_good must increase within
|
||||||
// STALL_SECS or the pass bails out as wedged.
|
// STALL_SECS or the pass bails out as wedged.
|
||||||
@@ -1291,7 +1293,7 @@ pub(super) fn handle_read_failure<R: SectorSource + ?Sized>(
|
|||||||
// the senses the BU40N's firmware fast-fail mode returns. When
|
// the senses the BU40N's firmware fast-fail mode returns. When
|
||||||
// the drive is wedged, every subsequent read returns these in
|
// the drive is wedged, every subsequent read returns these in
|
||||||
// <100ms — exactly the rapid-retry cadence that bricks the drive
|
// <100ms — exactly the rapid-retry cadence that bricks the drive
|
||||||
// further. Long cooldown (30s, matching
|
// further. Long cooldown (WEDGE_FAMILY_COOLDOWN_SECS, sourced from
|
||||||
// read_error::ZONE_ENTRY_COOLDOWN_SECS) gives the firmware
|
// read_error::ZONE_ENTRY_COOLDOWN_SECS) gives the firmware
|
||||||
// breathing room to clear the fast-fail state. After
|
// breathing room to clear the fast-fail state. After
|
||||||
// WEDGE_ABORT_THRESHOLD consecutive wedge senses with no recovery,
|
// WEDGE_ABORT_THRESHOLD consecutive wedge senses with no recovery,
|
||||||
|
|||||||
@@ -365,7 +365,7 @@ const FAIL_PAUSE_SECS: u64 = 5;
|
|||||||
/// Cost on clean discs: zero (first-error path doesn't trigger).
|
/// Cost on clean discs: zero (first-error path doesn't trigger).
|
||||||
/// Cost on damaged discs: ~30s × N damage zones; on a 5-zone disc
|
/// Cost on damaged discs: ~30s × N damage zones; on a 5-zone disc
|
||||||
/// that's 2.5 min extra. Trade for never wedging the drive.
|
/// that's 2.5 min extra. Trade for never wedging the drive.
|
||||||
const ZONE_ENTRY_COOLDOWN_SECS: u64 = 30;
|
pub(crate) const ZONE_ENTRY_COOLDOWN_SECS: u64 = 30;
|
||||||
/// Cooldown when a long streak of failures suggests the drive is
|
/// Cooldown when a long streak of failures suggests the drive is
|
||||||
/// stuck in a damage zone and needs MORE breathing room than the
|
/// stuck in a damage zone and needs MORE breathing room than the
|
||||||
/// standard inter-error pause. Same value as `FAIL_PAUSE_SECS`
|
/// standard inter-error pause. Same value as `FAIL_PAUSE_SECS`
|
||||||
|
|||||||
Reference in New Issue
Block a user