From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id F15BA1FF17E for ; Thu, 30 Oct 2025 11:50:41 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 82B6B1E261; Thu, 30 Oct 2025 11:51:15 +0100 (CET) From: Robert Obkircher To: pbs-devel@lists.proxmox.com Date: Thu, 30 Oct 2025 11:48:50 +0100 Message-ID: <20251030105034.45964-1-r.obkircher@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761821427677 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.000 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_MSPIKE_H2 0.001 Average reputation (+2) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [datastore.rs, proxmox.com] Subject: [pbs-devel] [PATCH proxmox-backup] Avoid lost updates to configuration during datastore deletion X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" 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/ Signed-off-by: Robert Obkircher --- 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)?; } -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel