From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 26AE21FF0E0 for ; Thu, 23 Jul 2026 16:31:17 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DCFCC2148A; Thu, 23 Jul 2026 16:31:16 +0200 (CEST) Message-ID: <42c380e8-b3eb-4860-bf12-141d3f534710@proxmox.com> Date: Thu, 23 Jul 2026 16:31:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH proxmox-backup v3 09/10] api: config: unlocked s3 bucket access check for datastore creation To: Robert Obkircher References: <20260721103643.333028-1-c.ebner@proxmox.com> <20260721103643.333028-10-c.ebner@proxmox.com> <178480753020.88450.9707249359570598383.b4-review@b4> Content-Language: en-US, de-DE From: Christian Ebner In-Reply-To: <178480753020.88450.9707249359570598383.b4-review@b4> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1784817042894 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.166 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_LOW -0.7 Sender listed at https://www.dnswl.org/, low trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: VAR76JEVZNHFXBAAT4RBLPD3HL4RDPU7 X-Message-ID-Hash: VAR76JEVZNHFXBAAT4RBLPD3HL4RDPU7 X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pbs-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On 7/23/26 1:51 PM, Robert Obkircher wrote: >> Instead of holding the lock for the whole datastore creation, use the >> maintenance-mode `create`, protected by the maintenance-mode lock. >> It is inserted and written to the config when setting the maintenance >> mode before even starting any datastore related operation. Cleanup >> from config if creation failed must be performed manually. >> >> This has the advantage that a potentially long running creation does >> not block any concurrent access to the datastore config, thereby >> blocking also any unrelated datastore. >> >> The config has to be re-parsed a second time for this, but given that >> this unblocks the config and this is no performance critical path >> that tradeoff is better than its alternative. By refactoring the >> helpers to set and unset the maintenance mode, they can be reused for >> all call sites. >> >> Rely on re-acquisition of the lock to also succeed if other operations >> are being performed, due to the 10s timeout. >> >> Ordering of locking cannot always be preserved, but deadlocks are >> excluded by timeouts. >> >> Signed-off-by: Christian Ebner >> [..] >> @@ -253,8 +253,27 @@ pub fn create_datastore_disk( >> bail!("datastore '{}' already exists.", datastore.name); >> } >> >> + let maintenance_mode_lock = >> + pbs_datastore::maintenance_mode_lock(&datastore.name, &lock)?; >> + crate::api2::helpers::set_maintenance_type( >> + lock, >> + &maintenance_mode_lock, >> + &mut datastore, >> + MaintenanceType::Create, >> + )?; >> + > Isn't this too early to drop the config lock? > > For example the `datastore.ensure_not_nested(&existing_stores)` inside > do_create_datastore could now potentially miss a newly created > datastore. Good catch! will double check and rework accordingly.