[pbs-devel] [PATCH proxmox-backup] sync: make LocalSourceReader snapshot lock non-pub

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Sep 29 11:21:39 CEST 2025


this field is just there to hold the actual lock guard, but accidentally using
it would potentially problematic (if holding the Mutex across an await point),
so let's not expose it in the first place.

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
found while going through std::sync::Mutex usage combined with S3

 src/server/sync.rs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/server/sync.rs b/src/server/sync.rs
index 50e41ae5c..514e82132 100644
--- a/src/server/sync.rs
+++ b/src/server/sync.rs
@@ -107,7 +107,8 @@ pub(crate) struct RemoteSourceReader {
 }
 
 pub(crate) struct LocalSourceReader {
-    pub(crate) _dir_lock: Arc<Mutex<BackupLockGuard>>,
+    // must not be accessed/made pub, this is just a hack for Send+Sync
+    _dir_lock: Arc<Mutex<BackupLockGuard>>,
     pub(crate) path: PathBuf,
     pub(crate) datastore: Arc<DataStore>,
 }
-- 
2.47.3





More information about the pbs-devel mailing list