[pbs-devel] [PATCH proxmox-backup] Avoid lost updates to configuration during datastore deletion
Fiona Ebner
f.ebner at proxmox.com
Thu Oct 30 13:05:17 CET 2025
Am 30.10.25 um 11:51 AM schrieb Robert Obkircher:
> Previously, the following steps created files in /srv/test2 but
> removed test2 from the configuration:
>
> proxmox-backup-manager datastore create test1 /srv/test1
> proxmox-backup-manager datastore remove test1 --destroy-data &
> sleep 0.1
> proxmox-backup-manager datastore create test2 /srv/test2
>
> Reported-by: https://forum.proxmox.com/threads/possible-bug-when-deleting-a-datastore.174715/
Please tell the user (and other developers to avoid potentially
duplicate work ;)) about the proposed fix in the forum.
> Signed-off-by: Robert Obkircher <r.obkircher at proxmox.com>
> ---
> pbs-datastore/src/datastore.rs | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
> index 03830616..14dad93a 100644
> --- a/pbs-datastore/src/datastore.rs
> +++ b/pbs-datastore/src/datastore.rs
> @@ -2154,6 +2154,8 @@ impl DataStore {
> if ok {
> info!("Removing datastore from config...");
> let _lock = pbs_config::datastore::lock_config()?;
> + // read again to avoid loosing concurrent modifications
> + let (mut config, _digest) = pbs_config::datastore::config()?;
> let _ = config.sections.remove(name);
> pbs_config::datastore::save_config(&config)?;
> }
Not very familiar with the code here, but looks good to me :)
More information about the pbs-devel
mailing list