diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-06-04 04:00:35 +0000 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-06-04 04:00:35 +0000 |
commit | 8faa42b28f39ace5fc2c3ec8a054fa0a5b246eab (patch) | |
tree | e904cb1dcc6423b414bae5d134c3ea83ac01efa1 /extra/libatasmart/0001-Dont-test-undefined-bits.patch | |
parent | 11196316291f49af2bacd1b4531e0a548729dea2 (diff) |
Wed Jun 4 03:57:00 UTC 2014
Diffstat (limited to 'extra/libatasmart/0001-Dont-test-undefined-bits.patch')
-rw-r--r-- | extra/libatasmart/0001-Dont-test-undefined-bits.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/extra/libatasmart/0001-Dont-test-undefined-bits.patch b/extra/libatasmart/0001-Dont-test-undefined-bits.patch new file mode 100644 index 000000000..9b32bba5d --- /dev/null +++ b/extra/libatasmart/0001-Dont-test-undefined-bits.patch @@ -0,0 +1,28 @@ +Author: Phillip Susi <psusi@ubuntu.com> +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. +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61998 +Bug-Ubuntu: https://launchpad.net/bugs/1143495 + +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; |