[pbs-devel] [PATCH proxmox-backup v2 1/3] chunk store: limit scope for atime update helper methods

Christian Ebner c.ebner at proxmox.com
Thu Nov 6 18:13:56 CET 2025


In preparation for fixing a race window due to missing chunk store
locking. These should never be called from outside the crate.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
changes since version 1:
- not present in previous version

 pbs-datastore/src/chunk_store.rs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/pbs-datastore/src/chunk_store.rs b/pbs-datastore/src/chunk_store.rs
index ba7618e40..1262377d5 100644
--- a/pbs-datastore/src/chunk_store.rs
+++ b/pbs-datastore/src/chunk_store.rs
@@ -204,7 +204,7 @@ impl ChunkStore {
         })
     }
 
-    pub fn touch_chunk(&self, digest: &[u8; 32]) -> Result<(), Error> {
+    fn touch_chunk(&self, digest: &[u8; 32]) -> Result<(), Error> {
         // unwrap: only `None` in unit tests
         assert!(self.locker.is_some());
 
@@ -212,7 +212,11 @@ impl ChunkStore {
         Ok(())
     }
 
-    pub fn cond_touch_chunk(&self, digest: &[u8; 32], assert_exists: bool) -> Result<bool, Error> {
+    pub(super) fn cond_touch_chunk(
+        &self,
+        digest: &[u8; 32],
+        assert_exists: bool,
+    ) -> Result<bool, Error> {
         // unwrap: only `None` in unit tests
         assert!(self.locker.is_some());
 
@@ -220,7 +224,7 @@ impl ChunkStore {
         self.cond_touch_path(&chunk_path, assert_exists)
     }
 
-    pub fn cond_touch_path(&self, path: &Path, assert_exists: bool) -> Result<bool, Error> {
+    pub(super) fn cond_touch_path(&self, path: &Path, assert_exists: bool) -> Result<bool, Error> {
         // unwrap: only `None` in unit tests
         assert!(self.locker.is_some());
 
-- 
2.47.3





More information about the pbs-devel mailing list