all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH manager] fix #5293: ceph status: fix division-by-zero when calculating usage
@ 2024-03-12  9:13 Christoph Heiss
  2024-03-19 17:18 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Heiss @ 2024-03-12  9:13 UTC (permalink / raw)
  To: pve-devel

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>
---
 www/manager6/ceph/Status.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/ceph/Status.js b/www/manager6/ceph/Status.js
index 32be91ac7..72b3c990d 100644
--- a/www/manager6/ceph/Status.js
+++ b/www/manager6/ceph/Status.js
@@ -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;
-- 
2.43.1





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pve-devel] applied: [PATCH manager] fix #5293: ceph status: fix division-by-zero when calculating usage
  2024-03-12  9:13 [pve-devel] [PATCH manager] fix #5293: ceph status: fix division-by-zero when calculating usage Christoph Heiss
@ 2024-03-19 17:18 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2024-03-19 17:18 UTC (permalink / raw)
  To: Proxmox VE development discussion, Christoph Heiss

On 12/03/2024 10:13, Christoph Heiss wrote:
> 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>
> ---
>  www/manager6/ceph/Status.js | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
>

applied, thanks!




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-19 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-12  9:13 [pve-devel] [PATCH manager] fix #5293: ceph status: fix division-by-zero when calculating usage Christoph Heiss
2024-03-19 17:18 ` [pve-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal