From 024b3f80fa3c9fcb5d87acc0c952136b190a01f3 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 8 Apr 2015 18:13:24 +0200 Subject: [PATCH] Print failure rate also without rotation rate --- cmdline/device.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cmdline/device.c b/cmdline/device.c index fc3a733a..8d2289d2 100644 --- a/cmdline/device.c +++ b/cmdline/device.c @@ -739,14 +739,13 @@ static void state_smart(unsigned n, tommy_list* low) if (flag & (SMARTCTL_FLAG_FAIL | SMARTCTL_FLAG_PREFAIL | SMARTCTL_FLAG_PREFAIL_LOGGED)) make_it_fail = 1; + /* note that in older smartmontools, like 5.x, rotation rate is not present */ + /* and then it could remain unassigned */ + if (flag & (SMARTCTL_FLAG_UNSUPPORTED | SMARTCTL_FLAG_OPEN)) { /* if error running smartctl, skip AFR estimation */ afr = 0; printf(" n/a"); - } else if (devinfo->smart[SMART_ROTATION_RATE] == SMART_UNASSIGNED) { - /* if no rotation rate, we don't know if it's SSD or not */ - afr = 0; - printf(" n/k"); } else if (devinfo->smart[SMART_ROTATION_RATE] == 0) { /* if SSD, skip AFR estimation as data is from not SSD disks */ afr = 0;