]> git.ipfire.org Git - thirdparty/libatasmart.git/commitdiff
use only uppermost 32 bits for reallocated-sectors-count attribute pretty value
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2009 22:25:39 +0000 (00:25 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Apr 2009 22:41:47 +0000 (00:41 +0200)
This seems to fix the attribute for Fujitsu drives. And those 32 bit
should be enough to still encode bad sectors up to 2TB which should be
more than enough. Hence it is probably safe to ignore the remaing 16 bit
even on non-Fujitsu drives.

See rhbz #496087.

atasmart.c

index 20c3931c1792bec21eed5241769615a643c6dbfa..053cb889e41fe3606243876ef2905c4098b0d25f 100644 (file)
@@ -1129,6 +1129,8 @@ static void make_pretty(SkSmartAttributeParsedData *a) {
                  !strcmp(a->name, "loaded-hours") ||
                  !strcmp(a->name, "head-flying-hours"))
                 a->pretty_value = fourtyeight * 60 * 60 * 1000;
+        else if (!strcmp(a->name, "reallocated-sector-count"))
+                a->pretty_value = fourtyeight & 0xFFFFFFFFU;
         else
                 a->pretty_value = fourtyeight;
 }