[check-disk] skip checks on inodesFreePct if disk.InodesTotal is zero
@@ -46,17 +46,13 @@ func checkStatus(current checkers.Status, threshold string, units float64, disk
}
freePct := float64(100) - disk.UsedPercent
-
inodesFreePct := float64(100) - disk.InodesUsedPercent
- if float64(disk.InodesTotal) == float64(0) {
- inodesFreePct = float64(0)
- }
- if chkInode && v > inodesFreePct {
+ if chkInode && (disk.InodesTotal != 0 && v > inodesFreePct) {
current = status
}
- if !chkInode && (v > freePct || v > inodesFreePct) {
+ if !chkInode && (v > freePct || (disk.InodesTotal != 0 && v > inodesFreePct)) {
current = status
}
} else {
