[pbs-devel] [RFC v2 proxmox-backup 06/21] api: tape: check trash marker when trying to write snapshot
Christian Ebner
c.ebner at proxmox.com
Thu May 8 15:05:40 CEST 2025
Since snapshots might be marked as trash, the snapshot directory
can still be present until cleaned up by garbage collection.
Therefore, check for the presence of the trash marker after acquiring
the locked snapshot reader and skip over marked ones.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
src/api2/tape/backup.rs | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/api2/tape/backup.rs b/src/api2/tape/backup.rs
index 923cb7834..17c8bc605 100644
--- a/src/api2/tape/backup.rs
+++ b/src/api2/tape/backup.rs
@@ -574,7 +574,13 @@ fn backup_snapshot(
info!("backup snapshot {snapshot_path:?}");
let snapshot_reader = match snapshot.locked_reader() {
- Ok(reader) => reader,
+ Ok(reader) => {
+ if snapshot.is_trashed() {
+ info!("snapshot {snapshot_path:?} trashed, skipping");
+ return Ok(SnapshotBackupResult::Ignored);
+ }
+ reader
+ }
Err(err) => {
if !snapshot.full_path().exists() {
// we got an error and the dir does not exist,
--
2.39.5
More information about the pbs-devel
mailing list