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:
@@ -5,6 +5,7 @@
|
||||
pub(crate) fn extract_scsi_context(e: &Error) -> (u8, Option<crate::scsi::ScsiSense>) {
|
||||
match e {
|
||||
Error::ScsiError { status, sense, .. } => (*status, *sense),
|
||||
Error::DiscRead { status, sense, .. } => (status.unwrap_or(0), *sense),
|
||||
_ => (0, None),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user