From 2f3fef6f75a876eaf58c3d92905c64d17d8f30b109f261595b698093adbc17de Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 16:12:43 +0000 Subject: [PATCH] Accepting request 527340 from home:Zaitor:branches:Base:System - Add libatasmart-0.19-wd-fix.patch: Fix issue with WD drives. Fixes fdo#61998. OBS-URL: https://build.opensuse.org/request/show/527340 OBS-URL: https://build.opensuse.org/package/show/Base:System/libatasmart?expand=0&rev=21 --- libatasmart-0.19-wd-fix.patch | 26 ++++++++++++++++++++++++++ libatasmart.changes | 6 ++++++ libatasmart.spec | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 libatasmart-0.19-wd-fix.patch diff --git a/libatasmart-0.19-wd-fix.patch b/libatasmart-0.19-wd-fix.patch new file mode 100644 index 0000000..c8b2ae6 --- /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.changes b/libatasmart.changes index 2e2c073..cd0e678 100644 --- a/libatasmart.changes +++ b/libatasmart.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 13 18:45:50 UTC 2017 - zaitor@opensuse.org + +- Add libatasmart-0.19-wd-fix.patch: Fix issue with WD drives. + Fixes fdo#61998. + ------------------------------------------------------------------- Fri Apr 29 12:59:30 UTC 2016 - perry.werneck@gmail.com diff --git a/libatasmart.spec b/libatasmart.spec index 21908e3..4443493 100644 --- a/libatasmart.spec +++ b/libatasmart.spec @@ -24,6 +24,7 @@ License: LGPL-2.1+ Group: System/Libraries Url: http://git.0pointer.net/libatasmart.git/ Source: http://0pointer.de/public/%{name}-%{version}.tar.xz +Patch0: libatasmart-0.19-wd-fix.patch BuildRequires: libudev-devel BuildRequires: pkgconfig @@ -75,6 +76,7 @@ health monitoring. %prep %setup -q +%patch0 -p1 %build %configure --disable-static