[pbs-devel] [PATCH proxmox-backup] tape: fix read element status for some changers

Dominik Csapak d.csapak at proxmox.com
Mon Aug 26 16:04:59 CEST 2024


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 at 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





More information about the pbs-devel mailing list