[pve-devel] [PATCH storage 3/3] Diskmanage: correctly add wearout value of 0

Dominik Csapak d.csapak at proxmox.com
Tue Jun 4 13:05:29 CEST 2019


if wearout is 0 we showed 'N/A' instead of 100%
(wearout is really the 'life left' value)

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 PVE/Diskmanage.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm
index 10b5737..41158f4 100644
--- a/PVE/Diskmanage.pm
+++ b/PVE/Diskmanage.pm
@@ -512,7 +512,7 @@ sub get_disks {
 		if ($type eq 'ssd') {
 		    # if we have an ssd we try to get the wearout indicator
 		    my $wearval = get_wear_leveling_info($smartdata, $data->{model} || $sysdata->{model});
-		    $wearout = $wearval if $wearval;
+		    $wearout = $wearval if defined($wearval);
 		}
 	    };
 	}
-- 
2.11.0





More information about the pve-devel mailing list