diff --git a/vm/devices/storage/ide/src/lib.rs b/vm/devices/storage/ide/src/lib.rs index 198b9c46b2..b8051dfb79 100644 --- a/vm/devices/storage/ide/src/lib.rs +++ b/vm/devices/storage/ide/src/lib.rs @@ -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; @@ -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 => {