public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] tape: work around buggy changer implementations
@ 2023-12-13  8:09 Dominik Csapak
  2023-12-13  8:57 ` Dietmar Maurer
  0 siblings, 1 reply; 2+ messages in thread
From: Dominik Csapak @ 2023-12-13  8:09 UTC (permalink / raw)
  To: pbs-devel

allocation length for read element status is a 3 byte field, but it
seems some changers only look at the bottom two bytes. Since we used
0x010000 for it, those changers did not return any data and the calls
failed.

To work around it, request one byte less (0xFFFF) which should still be
enough for the data, but should now work with those buggy
implementations.

Reported by a user in the forum: https://forum.proxmox.com/threads/137391/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 pbs-tape/src/sg_pt_changer.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pbs-tape/src/sg_pt_changer.rs b/pbs-tape/src/sg_pt_changer.rs
index cfddbf9a..c82bd8f6 100644
--- a/pbs-tape/src/sg_pt_changer.rs
+++ b/pbs-tape/src/sg_pt_changer.rs
@@ -369,7 +369,7 @@ pub fn read_element_status<F: AsRawFd>(file: &mut F) -> Result<MtxStatus, Error>
     // first, request address assignment (used for sanity checks)
     let setup = read_element_address_assignment(file)?;
 
-    let allocation_len: u32 = 0x10000;
+    let allocation_len: u32 = 0xFFFF;
 
     let mut sg_raw = SgRaw::new(file, allocation_len as usize)?;
     sg_raw.set_timeout(SCSI_CHANGER_DEFAULT_TIMEOUT);
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pbs-devel] [PATCH proxmox-backup] tape: work around buggy changer implementations
  2023-12-13  8:09 [pbs-devel] [PATCH proxmox-backup] tape: work around buggy changer implementations Dominik Csapak
@ 2023-12-13  8:57 ` Dietmar Maurer
  0 siblings, 0 replies; 2+ messages in thread
From: Dietmar Maurer @ 2023-12-13  8:57 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Dominik Csapak

Please add an comment here, to make sure that we do not change it back later.

> -    let allocation_len: u32 = 0x10000;
> +    let allocation_len: u32 = 0xFFFF;




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-13  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13  8:09 [pbs-devel] [PATCH proxmox-backup] tape: work around buggy changer implementations Dominik Csapak
2023-12-13  8:57 ` Dietmar Maurer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal