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
9 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61998
10 Bug-Ubuntu: https://launchpad.net/bugs/1143495
13 ===================================================================
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))
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))