From 3aa14f7fdea35e55be01217af666e6d42f3ebb48 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 19 Mar 2009 01:19:21 +0100 Subject: handle the good status of bad sector attributes especially --- atasmart.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/atasmart.c b/atasmart.c index 8580a4c..743ecaa 100644 --- a/atasmart.c +++ b/atasmart.c @@ -1331,6 +1331,16 @@ int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb, find_threshold(d, &a); + /* Handle a few fields specially */ + if ((!strcmp(a.name, "reallocated-sector-count") || + !strcmp(a.name, "reallocated-event-count") || + !strcmp(a.name, "current-pending-sector")) && + a.pretty_unit == SK_SMART_ATTRIBUTE_UNIT_SECTORS && + a.pretty_value > 0) { + a.good = FALSE; + a.good_valid = TRUE; + } + cb(d, &a, userdata); free(an); -- cgit