From: Dominik Csapak <d.csapak@proxmox.com>
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 [thread overview]
Message-ID: <20261203150649.3510587-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20261203150649.3510587-1-d.csapak@proxmox.com>
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 <d.csapak@proxmox.com>
---
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
prev parent reply other threads:[~2026-12-03 15:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 15:06 [PATCH proxmox{,-backup} 0/2] tape: add support for LTO10 densities Dominik Csapak
2026-12-03 15:06 ` [PATCH proxmox 1/2] pbs api types: tape: add lto10 densities Dominik Csapak
2026-12-03 15:06 ` Dominik Csapak [this message]
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=20261203150649.3510587-3-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