[pbs-devel] [PATCH proxmox-backup] fix #4357: datastore: take into account namespaces when marking chunks

Stefan Sterz s.sterz at proxmox.com
Thu Apr 20 10:08:53 CEST 2023


previously when marking used chunks the namespace wasn't taken into
account and valid snapshots were marked as "strange paths". this lead
to a line in the log of a gc job such as this:

found (and marked) 2 index files outside of expected directory scheme

which some users perceived as an error. parse the namespace too and
only mark the path as strange if parsing the namespace and/or backup
dir fails.

Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
---
 pbs-datastore/src/datastore.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index bf951305..a500c0ab 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -964,7 +964,7 @@ impl DataStore {
             if let Some(backup_dir_path) = img.parent() {
                 let backup_dir_path = backup_dir_path.strip_prefix(self.base_path())?;
                 if let Some(backup_dir_str) = backup_dir_path.to_str() {
-                    if pbs_api_types::BackupDir::from_str(backup_dir_str).is_err() {
+                    if pbs_api_types::parse_ns_and_snapshot(backup_dir_str).is_err() {
                         strange_paths_count += 1;
                     }
                 }
-- 
2.30.2






More information about the pbs-devel mailing list