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 2D1471FF145 for ; Thu, 05 Feb 2026 13:32:35 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 1E8CAEFB5; Thu, 5 Feb 2026 13:33:07 +0100 (CET) Message-ID: Date: Thu, 5 Feb 2026 13:32:31 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH manager v2] ui: ceph: use record sizes in Ceph pool edit dialog Content-Language: en-US To: Kefu Chai , pve-devel@lists.proxmox.com References: <20260129144255.108808-2-k.chai@proxmox.com> <20260129145253.110677-2-k.chai@proxmox.com> From: Aaron Lauterer In-Reply-To: <20260129145253.110677-2-k.chai@proxmox.com> 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: 1770294673889 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.012 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_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: NKVQEQ6II7MYC24Z7ELKD63UA6SVULGY X-Message-ID-Hash: NKVQEQ6II7MYC24Z7ELKD63UA6SVULGY X-MailFrom: a.lauterer@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: Kefu Chai X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: I was only able to reproduce the bug partially by limiting the network speed via the browsers dev tools. And even then only for a non-default min-size (!=2). The size was always shown as configured, even with a non default value (3). With this patch, I wasn't able to reproduce the bug anymore. The fix looks good. Consider this patch: Reviewed-By: Aaron Lauterer Tested-By: Aaron Lauterer On 2026-01-29 15:52, Kefu Chai wrote: > From: Kefu Chai > > When editing Ceph pools via the GUI, the edit dialog displays incorrect > Size and Min Size values that don't match the pool overview table. This > can lead to accidental data loss if users save the pool configuration > without noticing the discrepancy. > > Root Cause: > The run_editor function creates the PVE.Ceph.PoolEdit dialog but fails > to pass the actual size and min_size values from the grid record. This > causes a race condition where: > > 1. Form fields initialize with undefined defaultSize/defaultMinSize > 2. Fields fall back to default values (e.g., size=2) > 3. The sizeChange handler fires and calculates minSize = size/2 > 4. ViewModel is updated with incorrect values > 5. autoLoad tries to load correct data asynchronously > 6. But pmxDisplayEditField binding doesn't work properly (see line 30) > 7. User sees wrong values and may accidentally save them > > The bug is intermittent because closing and reopening the dialog changes > the timing, allowing autoLoad to complete before form initialization. > > Fix: > Pass defaultSize and defaultMinSize from the grid record to the edit > dialog, matching the pattern already used by the Create dialog. This > ensures form fields initialize with correct values immediately, avoiding > the race condition. > > Impact: > - Prevents accidental reduction of replication factor > - Prevents data loss from incorrect min_size values > - Ensures GUI consistency between overview table and edit dialog > > Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7266 > Signed-off-by: Kefu Chai > --- > www/manager6/ceph/Pool.js | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js > index 26384e32..80d57f11 100644 > --- a/www/manager6/ceph/Pool.js > +++ b/www/manager6/ceph/Pool.js > @@ -457,6 +457,8 @@ Ext.define( > nodename: nodename, > pool_name: rec.data.pool_name, > isErasure: rec.data.type === 'erasure', > + defaultSize: rec.data.size, > + defaultMinSize: rec.data.min_size, > autoShow: true, > listeners: { > destroy: () => rstore.load(),