]> git.proxmox.com Git - pve-manager.git/commitdiff
fix #5293: ceph status: fix division-by-zero when calculating usage
authorChristoph Heiss <c.heiss@proxmox.com>
Tue, 12 Mar 2024 09:13:46 +0000 (10:13 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 19 Mar 2024 17:16:00 +0000 (18:16 +0100)
Fixes #5293 [0]. This happens when no OSDs are created yet and thus the
total space is 0, which leads to a division-by-zero.

Add a simple check if the total space is greater than 0.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=5293

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/ceph/Status.js

index 32be91ac74461c37f2627443e02ec9e52bc5b3d6..72b3c990d1ee7dd526ae297e13e72400285f211c 100644 (file)
@@ -346,7 +346,8 @@ Ext.define('PVE.node.CephStatus', {
        );
 
        // update the usage widget
-       me.down('#space').updateValue(used/total, text);
+       const usage = total > 0 ? used / total : 0;
+       me.down('#space').updateValue(usage, text);
 
        let readiops = pgmap.read_op_per_sec;
        let writeiops = pgmap.write_op_per_sec;