Seagate's ST9160821AS drive encodes something strange in attribute 9
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2009 22:30:19 +0000 (00:30 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2009 22:42:22 +0000 (00:42 +0200)
Attribute 9 of ST9160821AS apparently is not the power on time in hours.
Since we have no idea what it is and how it is encoded this adds a quirk
to mark the attribute as 'unknown' for this drive.

See rhbz #497107.

atasmart.c

index 8b44aa4..5cf6c30 100644 (file)
@@ -1205,6 +1205,7 @@ typedef enum SkSmartQuirk {
         SK_SMART_QUIRK_194_UNKNOWN = 64,
         SK_SMART_QUIRK_200_WRITEERRORCOUNT = 128,
         SK_SMART_QUIRK_201_DETECTEDTACOUNT = 256,
+        SK_SMART_QUIRK_9_UNKNOWN = 512
 } SkSmartQuirk;
 
 /* %STRINGPOOLSTART% */
@@ -1218,6 +1219,7 @@ static const char *quirk_name[] = {
         "194_UNKNOWN",
         "200_WRITEERRORCOUNT",
         "201_DETECTEDTACOUNT",
+        "9_UNKNOWN",
         NULL
 };
 /* %STRINGPOOLSTOP% */
@@ -1230,6 +1232,12 @@ typedef struct SkSmartQuirkDatabase {
 
 static const SkSmartQuirkDatabase quirk_database[] = { {
 
+        /*** Seagate */
+                "^ST9160821AS$",
+                NULL,
+                SK_SMART_QUIRK_9_UNKNOWN
+        }, {
+
         /*** Fujitsu */
                 "^FUJITSU MHR2040AT$",
                 NULL,
@@ -1451,7 +1459,8 @@ static const SkSmartAttributeInfo *lookup_attribute(SkDisk *d, uint8_t id) {
                                                 "power-on-half-minutes", SK_SMART_ATTRIBUTE_UNIT_MSECONDS
                                         };
                                         return &a;
-                                }
+                                } else if (quirk & SK_SMART_QUIRK_9_UNKNOWN)
+                                        return NULL;
                                 /* %STRINGPOOLSTOP% */
 
                                 break;