From af5ff86a2603f7a539d3575b86cb08d96e185285 Mon Sep 17 00:00:00 2001 From: Shannon Sterz Date: Wed, 16 Apr 2025 10:56:45 +0200 Subject: [PATCH] sync: switch reader back to a shared lock the below commit accidentally switched this lock to an exclusive lock when it should just be a shared one as that is sufficient for a reader: e2c1866b: datastore/api/backup: prepare for fix of #3935 by adding lock helpers this has already caused failed backups for a user with a sync job that runs while they are trying to create a new backup. https://forum.proxmox.com/threads/165038 Signed-off-by: Shannon Sterz --- src/server/sync.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/sync.rs b/src/server/sync.rs index 528e2054..09814ef0 100644 --- a/src/server/sync.rs +++ b/src/server/sync.rs @@ -480,7 +480,7 @@ impl SyncSource for LocalSource { ) -> Result, Error> { let dir = self.store.backup_dir(ns.clone(), dir.clone())?; let guard = dir - .lock() + .lock_shared() .with_context(|| format!("while reading snapshot '{dir:?}' for a sync job"))?; Ok(Arc::new(LocalSourceReader { _dir_lock: Arc::new(Mutex::new(guard)),