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] tape: fix read element status for some changers
Date: Mon, 26 Aug 2024 16:04:59 +0200	[thread overview]
Message-ID: <20240826140459.2550345-1-d.csapak@proxmox.com> (raw)

It seems some changers are setting the PVolTag/AVolTag flags in the
ELEMENT STATUS page response, but don't include the actual fields then.
To make it work with such changers, downgrade the errors to warnings, so
we can continue to decode the remaining data.

This is OK since one volume tag is optional and the other is skipped
anyway.

Reported in the forum:
https://forum.proxmox.com/threads/hpe-storeonce-vtl.152547/

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

diff --git a/pbs-tape/src/sg_pt_changer.rs b/pbs-tape/src/sg_pt_changer.rs
index b600a49d..940eed4a 100644
--- a/pbs-tape/src/sg_pt_changer.rs
+++ b/pbs-tape/src/sg_pt_changer.rs
@@ -746,9 +746,18 @@ fn decode_element_status_page(
                     let desc: TransportDescriptor = unsafe { reader.read_be_value()? };
 
                     let full = (desc.flags1 & 1) != 0;
-                    let volume_tag = subhead.parse_optional_volume_tag(&mut reader, full)?;
 
-                    subhead.skip_alternate_volume_tag(&mut reader)?;
+                    let volume_tag = match subhead.parse_optional_volume_tag(&mut reader, full) {
+                        Ok(tag) => tag,
+                        Err(err) => {
+                            log::warn!("could not read optional volume tag: {err}");
+                            None
+                        }
+                    };
+
+                    if let Err(err) = subhead.skip_alternate_volume_tag(&mut reader) {
+                        log::warn!("could not skip alternate volume tag: {err}");
+                    }
 
                     result.last_element_address = Some(desc.element_address);
 
-- 
2.39.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


             reply	other threads:[~2024-08-26 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26 14:04 Dominik Csapak [this message]
2024-09-03  5:26 ` Dietmar Maurer
2024-09-03  6:55   ` Dominik Csapak

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=20240826140459.2550345-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