From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id EDCF81FF0C2 for ; Thu, 03 Dec 2026 16:06:52 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id A6B0021765; Thu, 03 Dec 2026 16:06:52 +0100 (CET) From: Dominik Csapak To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 2/2] tape: don't fail on unknown reported density Date: Thu, 3 Dec 2026 16:06:27 +0100 Message-ID: <20261203150649.3510587-3-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261203150649.3510587-1-d.csapak@proxmox.com> References: <20261203150649.3510587-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.240 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: Y22GYJNFOI5QOJJAJHXPOBZYPQZEWE6D X-Message-ID-Hash: Y22GYJNFOI5QOJJAJHXPOBZYPQZEWE6D X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Whenever a new LTO standard is released (and sometimes in between versions), a new tape density code is used to represent a generation of tapes. Querying the drive and media status bails out on such unknown codes, which breaks the status API and `pmt status` until the code is added. Fall back to 'unknown' instead, like format_media already does. Code paths that depend on the density might then take a non-optimal path, but should still work. Signed-off-by: Dominik Csapak --- pbs-tape/src/sg_tape.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pbs-tape/src/sg_tape.rs b/pbs-tape/src/sg_tape.rs index a98e8960a..185a63c14 100644 --- a/pbs-tape/src/sg_tape.rs +++ b/pbs-tape/src/sg_tape.rs @@ -1109,7 +1109,10 @@ impl SgTape { blocksize: drive_status.block_length, compression: drive_status.compression, buffer_mode: drive_status.buffer_mode, - density: drive_status.density_code.try_into()?, + density: drive_status + .density_code + .try_into() + .unwrap_or(TapeDensity::Unknown), alert_flags, write_protect: None, file_number: None, -- 2.47.3