From 0ad1491634074312009877e597748a256996ea9d Mon Sep 17 00:00:00 2001 From: df Date: Fri, 11 Dec 2020 11:18:58 +0000 Subject: [PATCH] Avoid displaying negative free space --- webif/html/diskspace/diskspace.jim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webif/html/diskspace/diskspace.jim b/webif/html/diskspace/diskspace.jim index d21b767..5cd88c8 100755 --- a/webif/html/diskspace/diskspace.jim +++ b/webif/html/diskspace/diskspace.jim @@ -9,6 +9,11 @@ lassign [system diskspace 1] size used perc free fperc tsrbuf tsrused set tsrreserve $($tsrbuf - $tsrused) # Adjust values to account for the TSR reserve set free $($free - $tsrreserve) +# In case the reserve has been over-committed +if {$free < 0)} { + # avoid displaying negative free, or used > available + set free 0 +} set used $($size - $free) set dbs 0