summaryrefslogtreecommitdiffstats
path: root/debian/patches/ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 13:00:48 +0000
commitf542925b701989ba6eed7b08b5226d4021b9b85f (patch)
tree57e14731f21a6d663326d30b7b88736e9d51c420 /debian/patches/ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch
parentAdding upstream version 247.3. (diff)
downloadsystemd-debian/247.3-7+deb11u4.tar.xz
systemd-debian/247.3-7+deb11u4.zip
Adding debian version 247.3-7+deb11u4.debian/247.3-7+deb11u4
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch')
-rw-r--r--debian/patches/ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/debian/patches/ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch b/debian/patches/ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch
new file mode 100644
index 0000000..de1b1f2
--- /dev/null
+++ b/debian/patches/ata_id-Fixed-getting-Response-Code-from-SCSI-Sense-Data-2.patch
@@ -0,0 +1,37 @@
+From: Aleksey Vasenev <margtu-fivt@ya.ru>
+Date: Wed, 5 Oct 2022 22:33:53 +0300
+Subject: ata_id: Fixed getting Response Code from SCSI Sense Data (#24921)
+
+The Response Code is contained in the first byte of the SCSI Sense Data.
+Bit number 7 is reserved or has a different meaning for some Response Codes
+and is set to 1 for some drives.
+
+(cherry picked from commit 2be1ae54badf7a3a12908a8094ebaba8f91887ca)
+---
+ src/udev/ata_id/ata_id.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/udev/ata_id/ata_id.c b/src/udev/ata_id/ata_id.c
+index ce0bf5d..c86e40b 100644
+--- a/src/udev/ata_id/ata_id.c
++++ b/src/udev/ata_id/ata_id.c
+@@ -162,8 +162,8 @@ static int disk_identify_command(
+ return ret;
+ }
+
+- if (!(sense[0] == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c) &&
+- !(sense[0] == 0x70 && sense[12] == 0x00 && sense[13] == 0x1d)) {
++ if (!((sense[0] & 0x7f) == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c) &&
++ !((sense[0] & 0x7f) == 0x70 && sense[12] == 0x00 && sense[13] == 0x1d)) {
+ errno = EIO;
+ return -1;
+ }
+@@ -240,7 +240,7 @@ static int disk_identify_packet_device_command(
+ return ret;
+ }
+
+- if (!(sense[0] == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c)) {
++ if (!((sense[0] & 0x7f) == 0x72 && desc[0] == 0x9 && desc[1] == 0x0c)) {
+ errno = EIO;
+ return -1;
+ }