FS#27060 - [udev] ata_id[474]: HDIO_GET_IDENTITY failed for '/dev/sdb': Invalid argument

Attached to Project: Arch Linux
Opened by mangust (mangust) - Friday, 18 November 2011, 22:00 GMT
Last edited by Tom Gundersen (tomegun) - Wednesday, 14 March 2012, 01:12 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Tobias Powalowski (tpowa)
Tom Gundersen (tomegun)
Architecture i686
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
After updating initscripts (2011.10.2-1 -> 2011.11.3-1) unable to mount external USB SATA driver, in other words the external driver cannot be mounted.

Issuing command hdparm -i /dev/sdb:
HDIO_GET_IDENTITY failed: Invalid argument

Plugin/Upluging driver is logged with the message: see /var/log/errors.log


Additional info:
* packages, which were updated before the problem:
[2011-11-18 21:56] Running 'pacman -Syu'
[2011-11-18 21:56] synchronizing package lists
[2011-11-18 21:56] starting full system upgrade
[2011-11-18 21:57] upgraded glibmm (2.30.0-1 -> 2.30.1-1)
[2011-11-18 21:57] upgraded glibmm-docs (2.30.0-1 -> 2.30.1-1)
[2011-11-18 21:57] upgraded gnash-common (0.8.9-5 -> 0.8.9-6)
[2011-11-18 21:57] upgraded gnash-gtk (0.8.9-5 -> 0.8.9-6)
[2011-11-18 21:57] upgraded initscripts (2011.10.2-1 -> 2011.11.3-1)
[2011-11-18 21:57] upgraded libglapi (7.11-4 -> 7.11.1-1)
[2011-11-18 21:57] upgraded libgl (7.11-4 -> 7.11.1-1)
[2011-11-18 21:57] upgraded mesa (7.11-4 -> 7.11.1-1)
[2011-11-18 21:57] upgraded nouveau-dri (7.11-4 -> 7.11.1-1)
[2011-11-18 21:57] upgraded rasqal (1:0.9.27-1 -> 1:0.9.28-1)
[2011-11-18 21:57] upgraded reiserfsprogs (3.6.21-3 -> 3.6.21-4)
[2011-11-18 21:57] upgraded wifi-select (1.0-1 -> 1.0-2)
[2011-11-18 21:57] upgraded xkeyboard-config (2.4.1-1 -> 2.4.1-2)
[2011-11-18 21:57] upgraded xorg-server-common (1.11.2-1 -> 1.11.2-2)
[2011-11-18 21:57] upgraded xorg-server (1.11.2-1 -> 1.11.2-2)
[2011-11-18 21:57] upgraded xorg-server-xephyr (1.11.2-1 -> 1.11.2-2)

* log files:
[b]/var/log/boot[/b]
Fri Nov 18 22:10:59 2011: :: Loading User-specified Modules [BUSY] [DONE]
Fri Nov 18 22:10:59 2011: :: Waiting for UDev uevents to be processed [BUSY] ata_id[474]: HDIO_GET_IDENTITY failed for '/dev/sdb': Invalid argument
Fri Nov 18 22:10:59 2011:
Fri Nov 18 22:10:59 2011: [DONE]

[b]/var/log/errors.log[/b]
Nov 18 22:39:29 localhost ata_id[12376]: HDIO_GET_IDENTITY failed for '/dev/sdb': Invalid argument

[b]/var/log/dmesg.log[/b]
[ 10.226205] scsi 4:0:0:0: Direct-Access StoreJet Transcend PQ: 0 ANSI: 2 CCS
[ 10.227569] scsi: killing requests for dead queue
[ 10.228059] sd 4:0:0:0: [sdb] 488397168 512-byte logical blocks: (250 GB/232 GiB)
[ 10.228064] scsi: killing requests for dead queue
[ 10.231436] sd 4:0:0:0: [sdb] Write Protect is off
[ 10.231441] sd 4:0:0:0: [sdb] Mode Sense: 34 00 00 00
[ 10.231480] scsi: killing requests for dead queue
[ 10.233429] sd 4:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 10.233526] scsi: killing requests for dead queue
[ 10.233653] scsi: killing requests for dead queue
[ 10.233790] scsi: killing requests for dead queue
[ 10.234070] scsi: killing requests for dead queue
[ 10.234439] scsi: killing requests for dead queue
[ 10.238959] sdb: sdb1 sdb2
[ 10.244433] sd 4:0:0:0: [sdb] Attached SCSI disk


Steps to reproduce:
Upgrade initscripts to version 2011.11.3-1. Boot the system and plugin external usb sata driver. See your logs.
This task depends upon

Closed by  Tom Gundersen (tomegun)
Wednesday, 14 March 2012, 01:12 GMT
Reason for closing:  Fixed
Additional comments about closing:  upstream in git
Comment by mangust (mangust) - Saturday, 19 November 2011, 09:02 GMT
Update:
The reason for mounting problem was old udev rule for external driver (see wiki article for udev)
There is a forum thread with description of similar problem: https://bbs.archlinux.org/viewtopic.php?pid=1015693

Hence: update of initscripts (2011.10.2-1 -> 2011.11.3-1) doesn't cause problems for mounting external usb driver. But after updating there is a error message during boot: ata_id[474]: HDIO_GET_IDENTITY failed for '/dev/sdb': Invalid argument

Comment by FRLinux (frlinux) - Monday, 28 November 2011, 00:27 GMT
That issue doesn't prevent me from mounting external USB drives but I do see these messages a lot too:

[13095.148120] usb 2-5: new high speed USB device number 7 using ehci_hcd
[13095.272758] scsi7 : usb-storage 2-5:1.0
[13096.268952] scsi 7:0:0:0: Direct-Access WD My Passport 070A 1032 PQ: 0 ANSI: 4
[13096.270047] scsi 7:0:0:1: CD-ROM WD Virtual CD 070A 1032 PQ: 0 ANSI: 4
[13096.270440] sd 7:0:0:0: [sdf] 975400960 512-byte logical blocks: (499 GB/465 GiB)
[13096.272806] sd 7:0:0:0: [sdf] Write Protect is off
[13096.272811] sd 7:0:0:0: [sdf] Mode Sense: 23 00 10 00
[13096.274803] sd 7:0:0:0: [sdf] No Caching mode page present
[13096.274808] sd 7:0:0:0: [sdf] Assuming drive cache: write through
[13096.276428] sr1: scsi3-mmc drive: 51x/51x caddy
[13096.276695] sr 7:0:0:1: Attached scsi CD-ROM sr1
[13096.278668] scsi 7:0:0:2: Enclosure WD SES Device 1032 PQ: 0 ANSI: 4
[13096.278699] ses 7:0:0:2: Attached Enclosure device
[13096.280410] scsi: killing requests for dead queue
[13096.283013] sd 7:0:0:0: [sdf] No Caching mode page present
[13096.283018] sd 7:0:0:0: [sdf] Assuming drive cache: write through
[13096.283066] scsi: killing requests for dead queue
[13096.298862] sdf: sdf1
[13096.299212] scsi: killing requests for dead queue
[13096.300127] scsi: killing requests for dead queue
[13096.301645] scsi: killing requests for dead queue
[13096.302996] scsi: killing requests for dead queue
[13096.305257] scsi: killing requests for dead queue
[13096.307876] sd 7:0:0:0: [sdf] No Caching mode page present
[13096.307882] sd 7:0:0:0: [sdf] Assuming drive cache: write through
[13096.307888] sd 7:0:0:0: [sdf] Attached SCSI disk
[13096.308860] scsi: killing requests for dead queue
[13212.509436] usb 2-5: USB disconnect, device number 7

using latest arch kernel
3.1.2-1-ARCH #1 SMP PREEMPT Tue Nov 22 09:17:56 CET 2011 x86_64 Intel(R) Core(TM) i7
Comment by kurych (kurych) - Saturday, 17 December 2011, 23:10 GMT
This error generates by "/lib/udev/ata_id" utility, wich called from "/lib/udev/rules.d/60-persistent-storage.rules" string 37:

# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures)
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $tempnode"

This rule will apply to all USB storages, but "ata_id" return error EINVAL for most devices.
I think what returned value EINVAL from disk_identify() function must interpreted as info message and offer apply patch to "ata_id.c" source:

============cut======================
#diff -Naur udev-175/extras/ata_id/ata_id.c.old udev-175/extras/ata_id/ata_id.c
--- udev-175/extras/ata_id/ata_id.c.old 2011-12-18 01:44:03.450307693 +0400
+++ udev-175/extras/ata_id/ata_id.c 2011-12-18 02:18:36.089079245 +0400
@@ -532,7 +532,7 @@
} else {
/* If this fails, then try HDIO_GET_IDENTITY */
if (ioctl(fd, HDIO_GET_IDENTITY, &id) != 0) {
- if (errno == ENOTTY) {
+ if ((errno == ENOTTY) || (errno == EINVAL)) {
info(udev, "HDIO_GET_IDENTITY unsupported for '%s'\n", node);
rc = 2;
} else {
============cut=========================
Comment by mangust (mangust) - Tuesday, 20 December 2011, 20:05 GMT
kurych, thank you a lot for tracing the cause of the problem, and for the patch. The patch removes the error message, which (as it was already stated) was just information and it doesn't make any problems.

@kurych, maybe you should submit the patch to upstream?

Thanks ones again!
Comment by kurych (kurych) - Wednesday, 21 December 2011, 06:24 GMT
@mangust: Unfortunately, I don't know how and where to do it. I could not find anyone from developers to offer a patch. If it makes someone instead of me, I don't mind.
Comment by Tom Gundersen (tomegun) - Saturday, 25 February 2012, 10:51 GMT
Sorry that I missed this bug (don't know why I did not get notifications).

It seems that you guys have correctly identified udev as the source of the errors (the reason you get error messages with new initscripts is that old initscripts would hide them).

@kurych: it would be great if you could submit this upstream (with a link to this bug so they can get the background). Please first check if the problem still occurs with the most recent udev release though.

The upstream mailinglist is linux-hotplug: http://vger.kernel.org/vger-lists.html#linux-hotplug
Comment by Z.T. (t_zeev) - Saturday, 03 March 2012, 13:17 GMT
info on mailing list (archive and subscribe):

http://vger.kernel.org/vger-lists.html#linux-hotplug

upsteam trunk code against which patches need to be sent:

http://git.kernel.org/?p=linux/hotplug/udev.git;a=blob;f=src/extras/ata_id/ata_id.c;hb=HEAD#l535
Comment by Tom Gundersen (tomegun) - Wednesday, 14 March 2012, 01:12 GMT
I finally got around to taking this upstream, and a few seconds later: http://git.kernel.org/?p=linux/hotplug/udev.git;a=commit;h=4b50a3d0048d13f6e37126f20f96e8bef262cbe2

So next time you see an issue: take it upstream and don't rely on me, you could be in for a long wait ;-)

Loading...