File udisks2-identify-fail.patch of Package udisks2.openSUSE_13.1_Update
From 81a350fca9431048175fcf639909d988aceb2a17 Mon Sep 17 00:00:00 2001
From: Peter Paluch <peter.paluch@fri.uniza.sk>
Date: Mon, 20 Jan 2014 20:16:44 +0000
Subject: Use SECTOR_COUNT=1 when issuing ATA IDENTIFY COMMAND
... otherwise this fails with some devices / translqation layers. For
more information see
https://bugs.freedesktop.org/show_bug.cgi?id=73780
Signed-off-by: David Zeuthen <zeuthen@gmail.com>
---
diff --git a/src/udiskslinuxdevice.c b/src/udiskslinuxdevice.c
index 0b65a69..8c4a3ed 100644
--- a/src/udiskslinuxdevice.c
+++ b/src/udiskslinuxdevice.c
@@ -199,6 +199,7 @@ probe_ata (UDisksLinuxDevice *device,
{
/* ATA8: 7.16 IDENTIFY DEVICE - ECh, PIO Data-In */
input.command = 0xec;
+ input.count = 1;
output.buffer = g_new0 (guchar, 512);
output.buffer_size = 512;
if (!udisks_ata_send_command_sync (fd,
@@ -221,6 +222,7 @@ probe_ata (UDisksLinuxDevice *device,
{
/* ATA8: 7.17 IDENTIFY PACKET DEVICE - A1h, PIO Data-In */
input.command = 0xa1;
+ input.count = 1;
output.buffer = g_new0 (guchar, 512);
output.buffer_size = 512;
if (!udisks_ata_send_command_sync (fd,
diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c
index 48cc6e6..534ef4d 100644
--- a/src/udiskslinuxdriveata.c
+++ b/src/udiskslinuxdriveata.c
@@ -1943,7 +1943,7 @@ udisks_linux_drive_ata_secure_erase_sync (UDisksLinuxDriveAta *drive,
/* First get the IDENTIFY data directly from the drive, for sanity checks */
{
/* ATA8: 7.16 IDENTIFY DEVICE - ECh, PIO Data-In */
- UDisksAtaCommandInput input = {.command = 0xec};
+ UDisksAtaCommandInput input = {.command = 0xec, .count = 1};
UDisksAtaCommandOutput output = {.buffer = identify.buf, .buffer_size = sizeof (identify.buf)};
if (!udisks_ata_send_command_sync (fd,
-1,
--
cgit v0.9.0.2-2-gbebe