]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tape locate_file: fix off by one error
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 11 May 2021 10:37:04 +0000 (12:37 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 11 May 2021 10:37:04 +0000 (12:37 +0200)
src/tape/drive/lto/sg_tape.rs

index 6df69cb233341a1f153872dc20f4ecdccc00b109..25c239a2d845251ce83a26eb0c8207f2a43bc0c9 100644 (file)
@@ -300,6 +300,8 @@ impl SgTape {
             return self.rewind();
         }
 
+        let position = position -1;
+
         let mut sg_raw = SgRaw::new(&mut self.file, 16)?;
         sg_raw.set_timeout(Self::SCSI_TAPE_DEFAULT_TIMEOUT);
         let mut cmd = Vec::new();