]> git.proxmox.com Git - proxmox-backup.git/commitdiff
datastore: actually hold the active operation file lock on update
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 25 Nov 2022 09:35:43 +0000 (10:35 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 25 Nov 2022 13:11:38 +0000 (14:11 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
pbs-datastore/src/task_tracking.rs

index dcb73d9bda820cc51ed207d518363cef23353d5d..1f9717b136dd118662084c6a2f660ccbf12ec81a 100644 (file)
@@ -62,7 +62,7 @@ pub fn update_active_operations(name: &str, operation: Operation, count: i64) ->
         .perm(nix::sys::stat::Mode::from_bits_truncate(0o660));
 
     let timeout = std::time::Duration::new(10, 0);
-    open_file_locked(&lock_path, timeout, true, options.clone())?;
+    let _lock = open_file_locked(&lock_path, timeout, true, options.clone())?;
 
     let pid = std::process::id();
     let starttime = procfs::PidStat::read_from_pid(Pid::from_raw(pid as pid_t))?.starttime;