Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions vm/devices/storage/ide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,6 @@ impl Channel {
return IoResult::Err(IoError::InvalidAccessSize);
}

if let Some(status) = self.current_drive_status() {
if status.err() {
tracelimit::warn_ratelimited!(
"drive is in error state, ignoring enlightened command",
);
return IoResult::Ok;
} else if status.bsy() || status.drq() {
tracelimit::warn_ratelimited!(
"command is already pending on this drive, ignoring enlightened command"
);
return IoResult::Ok;
}
}
if self.enlightened_write.is_some() {
tracelimit::error_ratelimited!("enlightened write while one is in progress, ignoring");
return IoResult::Ok;
Expand Down Expand Up @@ -341,6 +328,20 @@ impl Channel {
bus_master_state,
);

if let Some(status) = self.current_drive_status() {
if status.err() {
tracelimit::warn_ratelimited!(
"drive is in error state, ignoring enlightened command",
);
return IoResult::Ok;
} else if status.bsy() || status.drq() {
tracelimit::warn_ratelimited!(
"command is already pending on this drive, ignoring enlightened command"
);
return IoResult::Ok;
}
}

let result = if let Some(drive_type) = self.current_drive_type() {
match drive_type {
DriveType::Optical => {
Expand Down
Loading