rpms/libatasmart/F-11 0001-Seagate-s-ST9160821AS-drive-encodes-something-strang.patch, NONE, 1.1 0001-don-t-claim-we-would-know-what-reallocated-event-cou.patch, NONE, 1.1 0001-use-only-uppermost-32-bits-for-reallocated-sectors-c.patch, NONE, 1.1 libatasmart.spec, 1.15, 1.16

Lennart Poettering lennart at fedoraproject.org
Wed Apr 22 23:37:05 UTC 2009


Author: lennart

Update of /cvs/pkgs/rpms/libatasmart/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13289

Modified Files:
	libatasmart.spec 
Added Files:
	0001-Seagate-s-ST9160821AS-drive-encodes-something-strang.patch 
	0001-don-t-claim-we-would-know-what-reallocated-event-cou.patch 
	0001-use-only-uppermost-32-bits-for-reallocated-sectors-c.patch 
Log Message:
Properly handle some ST and FUJITSU drive attributes. (rhbz 496087, 497107)

0001-Seagate-s-ST9160821AS-drive-encodes-something-strang.patch:

--- NEW FILE 0001-Seagate-s-ST9160821AS-drive-encodes-something-strang.patch ---
>From d274be25f7cd7ac60f5c10dcf569b57019e803b2 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart at poettering.net>
Date: Thu, 23 Apr 2009 00:30:19 +0200
Subject: [PATCH] Seagate's ST9160821AS drive encodes something strange in attribute 9

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 |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/atasmart.c b/atasmart.c
index 8b44aa4..5cf6c30 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -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;
-- 
1.6.2.2


0001-don-t-claim-we-would-know-what-reallocated-event-cou.patch:

--- NEW FILE 0001-don-t-claim-we-would-know-what-reallocated-event-cou.patch ---
>From 1d770b0d655cb20dfd093f012eaef72b2efe07fa Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart at poettering.net>
Date: Thu, 23 Apr 2009 00:28:54 +0200
Subject: [PATCH] don't claim we would know what reallocated-event-count actually is

We don't reliably know what this actually is on many drives and since it
is redundant to reallocated-sectors-count it's no loss to admit that we
have no clue.

See rhbz #497107.
---
 atasmart.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/atasmart.c b/atasmart.c
index 053cb88..8b44aa4 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -1165,14 +1165,14 @@ static const SkSmartAttributeInfo const attribute_info[256] = {
         [193] = { "load-cycle-count",            SK_SMART_ATTRIBUTE_UNIT_NONE },
         [194] = { "temperature-celsius-2",       SK_SMART_ATTRIBUTE_UNIT_MKELVIN },
         [195] = { "hardware-ecc-recovered",      SK_SMART_ATTRIBUTE_UNIT_NONE },
-        [196] = { "reallocated-event-count",     SK_SMART_ATTRIBUTE_UNIT_SECTORS },
+        [196] = { "reallocated-event-count",     SK_SMART_ATTRIBUTE_UNIT_NONE },
         [197] = { "current-pending-sector",      SK_SMART_ATTRIBUTE_UNIT_SECTORS },
         [198] = { "offline-uncorrectable",       SK_SMART_ATTRIBUTE_UNIT_SECTORS },
         [199] = { "udma-crc-error-count",        SK_SMART_ATTRIBUTE_UNIT_NONE },
         [200] = { "multi-zone-error-rate",       SK_SMART_ATTRIBUTE_UNIT_NONE },
         [201] = { "soft-read-error-rate",        SK_SMART_ATTRIBUTE_UNIT_NONE },
         [202] = { "ta-increase-count",           SK_SMART_ATTRIBUTE_UNIT_NONE },
-        [203] = { "run-out-cancel",              SK_SMART_ATTRIBUTE_UNIT_NONE },
+        [203] = { "run-out-cancel",              SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
         [204] = { "shock-count-write-open",      SK_SMART_ATTRIBUTE_UNIT_NONE },
         [205] = { "shock-rate-write-open",       SK_SMART_ATTRIBUTE_UNIT_NONE },
         [206] = { "flying-height",               SK_SMART_ATTRIBUTE_UNIT_UNKNOWN },
@@ -1665,7 +1665,6 @@ int sk_disk_smart_parse_attributes(SkDisk *d, SkSmartAttributeParseCallback cb,
 
                 /* 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) {
-- 
1.6.2.2


0001-use-only-uppermost-32-bits-for-reallocated-sectors-c.patch:

--- NEW FILE 0001-use-only-uppermost-32-bits-for-reallocated-sectors-c.patch ---
>From aa1f82fd2ba0cd0345cb5a36a66de64a0b70d321 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart at poettering.net>
Date: Thu, 23 Apr 2009 00:25:39 +0200
Subject: [PATCH] use only uppermost 32 bits for reallocated-sectors-count attribute pretty value

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 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/atasmart.c b/atasmart.c
index 20c3931..053cb88 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -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;
 }
-- 
1.6.2.2



Index: libatasmart.spec
===================================================================
RCS file: /cvs/pkgs/rpms/libatasmart/F-11/libatasmart.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- libatasmart.spec	15 Apr 2009 22:08:55 -0000	1.15
+++ libatasmart.spec	22 Apr 2009 23:37:01 -0000	1.16
@@ -1,6 +1,6 @@
 Name: libatasmart
 Version: 0.12
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: ATA S.M.A.R.T. Disk Health Monitoring Library
 Group: System Environment/Libraries
 Source0: http://0pointer.de/public/libatasmart-%{version}.tar.gz
@@ -8,6 +8,9 @@
 Url: http://git.0pointer.de/?p=libatasmart.git;a=summary
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: libudev-devel
+Patch1: 0001-don-t-claim-we-would-know-what-reallocated-event-cou.patch
+Patch2: 0001-Seagate-s-ST9160821AS-drive-encodes-something-strang.patch
+Patch3: 0001-use-only-uppermost-32-bits-for-reallocated-sectors-c.patch
 
 %description
 A small and lightweight parser library for ATA S.M.A.R.T. hard disk
@@ -27,6 +30,9 @@
 
 %prep
 %setup -q
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
 
 %build
 %configure --disable-static
@@ -55,6 +61,9 @@
 %doc blob-examples/SAMSUNG* blob-examples/ST* blob-examples/Maxtor* blob-examples/WDC*
 
 %changelog
+* Wed Apr 22 2009 Lennart Poettering <lpoetter at redhat.com> 0.12-2
+- Properly handle some ST and FUJITSU drive attributes. (rhbz 496087, 497107)
+
 * Wed Apr 15 2009 Lennart Poettering <lpoetter at redhat.com> 0.12-1
 - New upstream release
 




More information about the fedora-extras-commits mailing list