summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules-available/statistics/inc/hardwareparser.inc.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules-available/statistics/inc/hardwareparser.inc.php b/modules-available/statistics/inc/hardwareparser.inc.php
index 428f7d55..fb8060e8 100644
--- a/modules-available/statistics/inc/hardwareparser.inc.php
+++ b/modules-available/statistics/inc/hardwareparser.inc.php
@@ -515,6 +515,8 @@ class HardwareParser
$smart['rotation_rate'] = 0;
}
$size = $lsblk['size'] ?? $smart['user_capacity']['bytes'] ?? -1;
+ if ($size !== -1 && $size < 256000000)
+ continue; // Ignore too small
// Don't change the global props, it would change the HW ID
$hwid = self::writeGlobalHardwareData(HardwareInfo::HDD, [
// Try to use the model name as the unique identifier
@@ -614,7 +616,7 @@ class HardwareParser
++$i;
}
}
- $table['unused'] = $size - $used;
+ $table['unused'] = max(0, $size - $used);
$table['dev'] = $dev['readlink'];
$table += self::propsFromArray($smart + $lsblk,
'serial_number', 'firmware_version',