atasmart: ignore sector count if it is -1
[platform/upstream/libatasmart.git] / atasmart.c
index d3be001..f3c8e32 100644 (file)
@@ -1273,7 +1273,9 @@ static void verify_sectors(SkDisk *d, SkSmartAttributeParsedData *a) {
 
         max_sectors = d->size / 512ULL;
 
-        if (max_sectors > 0 && a->pretty_value > max_sectors) {
+        if (a->pretty_value == 0xffffffffULL ||
+            a->pretty_value == 0xffffffffffffffffULL ||
+            (max_sectors > 0 && a->pretty_value > max_sectors)) {
                 a->pretty_value = SK_SMART_ATTRIBUTE_UNIT_UNKNOWN;
                 d->attribute_verification_bad = TRUE;
         } else {
@@ -1395,6 +1397,13 @@ static const char *quirk_name[] = {
         "198_UNKNOWN",
         "190_UNKNOWN",
         "232_AVAILABLERESERVEDSPACE",
+        "233_MEDIAWEAROUTINDICATOR",
+        "225_TOTALLBASWRITTEN",
+        "4_UNUSED",
+        "226_TIMEWORKLOADMEDIAWEAR",
+        "227_TIMEWORKLOADHOSTREADS",
+        "228_WORKLOADTIMER",
+        "3_UNUSED",
         NULL
 };
 /* %STRINGPOOLSTOP% */