diff options
author | CoprDistGit <infra@openeuler.org> | 2024-08-06 02:22:05 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2024-08-06 02:22:05 +0000 |
commit | ba42dab79286cfe880811277c6d5f63d9a23bd87 (patch) | |
tree | b75f198f34e87ddebea3f4c1a6f4a06c4e344fe1 /libatasmart-0.19-wd-fix.patch | |
parent | d4519e44a5f6efd56e0943973dc3975e737e7139 (diff) |
automatic import of libatasmartopeneuler24.03_LTS
Diffstat (limited to 'libatasmart-0.19-wd-fix.patch')
-rw-r--r-- | libatasmart-0.19-wd-fix.patch | 26 |
1 files changed, 26 insertions, 0 deletions
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 <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. + +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; |