~ubuntu-branches/debian/stretch/libatasmart/stretch

« back to all changes in this revision

Viewing changes to debian/patches/0001-Dont-test-undefined-bits.patch

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-03-25 07:38:36 UTC
  • Revision ID: package-import@ubuntu.com-20130325073836-xd81eeji99de2dn5
Tags: 0.19-2
* debian/local/apport-hook.py: Fix syntax to be Python 3 compatible.
  (LP: #1013171)
* debian/local/apport-hook.py: Include output of "udisksctl dump" from
  udisks2.
* Add 0001-Dont-test-undefined-bits.patch: Fix an incorrect IO error reading
  SMART status, by filtering out undefined bits. Thanks Phillip Susi.
  (LP: #1143495)
* Bump Standards-Version to 3.9.4, no changes necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
11
 
 
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;