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: (internal)#20260427
This commit is contained in:
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user