From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3E5A1BC291 for ; Fri, 22 Dec 2023 09:16:01 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1A3A0731 for ; Fri, 22 Dec 2023 09:15:31 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 22 Dec 2023 09:15:29 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 6449F48C62 for ; Fri, 22 Dec 2023 09:15:29 +0100 (CET) Message-ID: <87a3715b-1c1a-411b-b3b3-93335dbd2def@proxmox.com> Date: Fri, 22 Dec 2023 09:15:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: Proxmox Backup Server development discussion , Dominik Csapak References: <20231213090026.1073501-1-d.csapak@proxmox.com> Content-Language: en-US From: Dietmar Maurer In-Reply-To: <20231213090026.1073501-1-d.csapak@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.362 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com] Subject: [pbs-devel] applied: [PATCH proxmox-backup v2] tape: work around buggy changer implementations X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2023 08:16:01 -0000 applied On 12/13/23 10:00, Dominik Csapak wrote: > 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 > --- > 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(file: &mut F) -> Result > // 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);