[pbs-devel] [PATCH proxmox-backup 12/17] datastore: get per-chunk file lock for chunk rename on s3 backend

Christian Ebner c.ebner at proxmox.com
Mon Nov 3 12:31:15 CET 2025


To guarantee exclusive access during s3 object store and cache
operations, acquire the per-chunk file before renaming a chunk when
the datastore is backed by s3.

This does not yet cover locking for the GC and chunk insert, part
of subsequent changes.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
 pbs-datastore/src/datastore.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index e7ec87a7f..e65f3a60c 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -2586,6 +2586,7 @@ impl DataStore {
         let (path, digest_str) = self.chunk_path(digest);
 
         let _lock = self.inner.chunk_store.mutex().lock().unwrap();
+        let _chunk_guard = self.lock_chunk_for_backend(digest)?;
 
         let mut counter = 0;
         let mut new_path = path.clone();
-- 
2.47.3





More information about the pbs-devel mailing list