disc: DiscRead carries SCSI status/sense

Fix extract_scsi_context() and Error::scsi_sense() to handle Error::DiscRead
in addition to Error::ScsiError, so is_marginal_read() works for DiscRead
errors and disc::copy() can properly route MEDIUM ERROR as a marginal
(bad sector) instead of bailing.

Closes: freemkv-private#20260427
This commit is contained in:
2026-04-27 18:38:57 -07:00
parent 8fa748cdb4
commit 4b353d674f
3 changed files with 3 additions and 1 deletions
+1
View File
@@ -490,6 +490,7 @@ impl Error {
pub fn scsi_sense(&self) -> Option<&crate::scsi::ScsiSense> {
match self {
Error::ScsiError { sense: Some(s), .. } => Some(s),
Error::DiscRead { sense: Some(s), .. } => Some(s),
_ => None,
}
}