From 3550371737b9330cc49b63e202e685531a39a391 Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Sep 13 2017 17:55:56 +0000 Subject: Fix issue with WD drives. Fixes bug #921430 https://bugs.freedesktop.org/show_bug.cgi?id=61998 --- diff --git a/libatasmart-0.19-wd-fix.patch b/libatasmart-0.19-wd-fix.patch new file mode 100644 index 0000000..90062b8 --- /dev/null +++ b/libatasmart-0.19-wd-fix.patch @@ -0,0 +1,26 @@ +Author: Phillip Susi +Subject: fix an incorrect IO error reading SMART status +Description: The read SMART status command's return status + was testing for a success/failure value that included 8 + bits that are "N/A" according to the standard, and required + that they be zeros. At least some drives do not fill them + with zeros, so correct this by masking off the undefined + bits. + +Index: b/atasmart.c +=================================================================== +--- a/atasmart.c ++++ b/atasmart.c +@@ -925,10 +925,10 @@ + /* SAT/USB bridges truncate packets, so we only check for 4F, + * not for 2C on those */ + if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) && +- cmd[4] == htons(0x4F00U)) ++ (cmd[4] & htons(0xFF00U)) == htons(0x4F00U)) + *good = TRUE; + else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) && +- cmd[4] == htons(0xF400U)) ++ (cmd[4] & htons(0xFF00U)) == htons(0xF400U)) + *good = FALSE; + else { + errno = EIO; diff --git a/libatasmart.spec b/libatasmart.spec index a8a5997..ad82043 100644 --- a/libatasmart.spec +++ b/libatasmart.spec @@ -1,9 +1,10 @@ Name: libatasmart Version: 0.19 -Release: 12%{?dist} +Release: 13%{?dist} Summary: ATA S.M.A.R.T. Disk Health Monitoring Library Group: System Environment/Libraries Source0: http://0pointer.de/public/libatasmart-%{version}.tar.xz +Patch0: libatasmart-0.19-wd-fix.patch License: LGPLv2+ Url: http://git.0pointer.de/?p=libatasmart.git;a=summary BuildRequires: systemd-devel @@ -26,7 +27,7 @@ Development Files for libatasmart Client Development %postun -p /sbin/ldconfig %prep -%setup -q +%autosetup %build %configure --disable-static @@ -53,6 +54,10 @@ rm $RPM_BUILD_ROOT%{_docdir}/libatasmart/README %doc blob-examples/SAMSUNG* blob-examples/ST* blob-examples/Maxtor* blob-examples/WDC* blob-examples/FUJITSU* blob-examples/INTEL* blob-examples/TOSHIBA* blob-examples/MCC* %changelog +* Wed Sep 13 2017 Kevin Fenzi - 0.19-13 +- Fix issue with WD drives. Fixes bug #921430 +- https://bugs.freedesktop.org/show_bug.cgi?id=61998 + * Thu Aug 03 2017 Fedora Release Engineering - 0.19-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild