public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup v2] tape: work around buggy changer implementations
Date: Wed, 13 Dec 2023 10:00:26 +0100	[thread overview]
Message-ID: <20231213090026.1073501-1-d.csapak@proxmox.com> (raw)

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>
---
changes from v1:
* add a comment to make sure we know why we set this value
 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..5b8596f0 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; // some changer only use the lower 2 bytes
 
     let mut sg_raw = SgRaw::new(file, allocation_len as usize)?;
     sg_raw.set_timeout(SCSI_CHANGER_DEFAULT_TIMEOUT);
-- 
2.30.2





             reply	other threads:[~2023-12-13  9:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13  9:00 Dominik Csapak [this message]
2023-12-14  8:39 ` Dominik Csapak
2023-12-22  8:15 ` [pbs-devel] applied: " Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231213090026.1073501-1-d.csapak@proxmox.com \
    --to=d.csapak@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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