From 3a625f13eae232693697bdd37b4a08f6eb23e597 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Thu, 28 Jan 2021 20:58:58 -0800 Subject: [PATCH] Failed to use all possible sd block device major number matches, which led to false disk total/used reports, that is, totals less than used. --- inxi | 4 +++- inxi.changelog | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index 0b9a515..9134e2d 100755 --- a/inxi +++ b/inxi @@ -9458,7 +9458,9 @@ sub proc_data { # Note: with > 1 nvme drives, the minor number no longer passes the modulus tests, # It appears to just increase randomly from the first 0 minor of the first nvme to # nvme partitions to next nvme, so it only passes the test for the first nvme drive. - if ( $row->[0] =~ /^(3|8|22|33|43|179|202|252|253|254|259)$/ && + # note: 66 16 9766436864 sdah ; 65 240 9766436864 sdaf[maybe special case when double letters? + # Check /proc/devices for major number matches + if ( $row->[0] =~ /^(3|8|22|33|43|6[5-9]|7[12]|12[89]|13[0-5]|179|202|252|253|254|259)$/ && $row->[-1] =~ /(mmcblk[0-9]+|n[b]?d[0-9]+|nvme[0-9]+n[0-9]+|fio[a-z]+|[hsv]d[a-z]+)$/ && ( $row->[1] % 16 == 0 || $row->[1] % 16 == 8 || $row->[-1] =~ /(nvme[0-9]+n[0-9]+)$/) ) { $size += $row->[2]; diff --git a/inxi.changelog b/inxi.changelog index d0ed3e2..06b9838 100644 --- a/inxi.changelog +++ b/inxi.changelog @@ -25,6 +25,9 @@ for the drives but now it's fixed anyway. I had not realized that smartctl made it plural when logical/physical were different, and singular when they were the same. +4. Failed to use all possible sd block device major number matches, which +led to false disk total/used reports, that is, totals less than used. + Fixes: 1. Going along with bug 2, fixed some other admin/non admin report glitches. Made patterns more aggressively matching, whitelist based to avoid the types