From c560cfddca5477e18d80024ef8ca49c4f16e8e12 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 9 Apr 2021 09:45:28 +0200 Subject: [PATCH] tape: read_drive_status - ignore media changed sense info --- src/tape/drive/lto/sg_tape.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tape/drive/lto/sg_tape.rs b/src/tape/drive/lto/sg_tape.rs index b7cd677f..5ef77922 100644 --- a/src/tape/drive/lto/sg_tape.rs +++ b/src/tape/drive/lto/sg_tape.rs @@ -44,6 +44,7 @@ use crate::{ alloc_page_aligned_buffer, scsi_inquiry, scsi_mode_sense, + scsi_request_sense, }, }; @@ -657,6 +658,10 @@ impl SgTape { /// block_descriptor. This is all information we need for now. pub fn read_drive_status(&mut self) -> Result { + // We do a Request Sense, but ignore the result. + // This clears deferred error or media changed events. + let _ = scsi_request_sense(&mut self.file); + let (head, block_descriptor, page) = self.read_compression_page()?; Ok(LtoTapeStatus {