Print failure rate also without rotation rate

This commit is contained in:
Andrea Mazzoleni 2015-04-08 18:13:24 +02:00
parent 1613ca1c86
commit 024b3f80fa

View file

@ -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;