archrelease: copy trunk to extra-x86_64
[arch-packages.git] / libatasmart / trunk / 0001-Dont-test-undefined-bits.patch
blob9b32bba5dd632fd17eca9a1492d9c4644299b150
1 Author: Phillip Susi <psusi@ubuntu.com>
2 Subject: fix an incorrect IO error reading SMART status
3 Description: The read SMART status command's return status
4 was testing for a success/failure value that included 8
5 bits that are "N/A" according to the standard, and required
6 that they be zeros. At least some drives do not fill them
7 with zeros, so correct this by masking off the undefined
8 bits.
9 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61998
10 Bug-Ubuntu: https://launchpad.net/bugs/1143495
12 Index: b/atasmart.c
13 ===================================================================
14 --- a/atasmart.c
15 +++ b/atasmart.c
16 @@ -925,10 +925,10 @@
17 /* SAT/USB bridges truncate packets, so we only check for 4F,
18 * not for 2C on those */
19 if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x00C2U)) &&
20 - cmd[4] == htons(0x4F00U))
21 + (cmd[4] & htons(0xFF00U)) == htons(0x4F00U))
22 *good = TRUE;
23 else if ((d->type == SK_DISK_TYPE_ATA_PASSTHROUGH_12 || cmd[3] == htons(0x002CU)) &&
24 - cmd[4] == htons(0xF400U))
25 + (cmd[4] & htons(0xFF00U)) == htons(0xF400U))
26 *good = FALSE;
27 else {
28 errno = EIO;