5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-03-09 08:58:28 +03:00

datastore: actually hold the active operation file lock on update

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-11-25 10:35:43 +01:00
parent dd286be58d
commit 52f5b8ad09

View 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;