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 80DF61FF13F for ; Thu, 29 Jan 2026 15:43:52 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D6BD686AD; Thu, 29 Jan 2026 15:44:14 +0100 (CET) From: Kefu Chai To: pve-devel@lists.proxmox.com Subject: [PATCH manager] ui: ceph: use record sizes in Ceph pool edit dialog Date: Thu, 29 Jan 2026 22:42:56 +0800 Message-ID: <20260129144255.108808-2-k.chai@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1769697751198 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.169 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: Z4B4GVCVXA5AR3F3DN7HFCHUQZ7JZTGY X-Message-ID-Hash: Z4B4GVCVXA5AR3F3DN7HFCHUQZ7JZTGY X-MailFrom: k.chai@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: 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 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(), -- 2.47.3