From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Wed, 29 Aug 2007 05:05:52 +0000 Subject: Re: udev naming for PATA drives Message-Id: <1188363952.3672.23.camel@lov.localdomain> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, 2007-08-29 at 06:30 +0200, Jan Engelhardt wrote: > On Aug 29 2007 06:11, Kay Sievers wrote: > >On 8/28/07, Jan Engelhardt wrote: > >> alim15x3.ko: > >> /dev/disk/by-id/ata-TOSHIBA_MK2003GAH_73A30603T > >> > >> pata_ali.ko: > >> /dev/disk/by-id/ata-TOSHIBA_MK2003GA_73A30603T______ > >> /dev/disk/by-id/scsi-SATA-TOSHIBA_MK2003G73A30603T > >> > >> With pata_ali, the model name is truncated, and I've got six odd > >> underscores (limited scsi layer?). Then, scsi is wrong, but perhaps > >> acceptable, because it is, indeed, the scsi layer. But SATA is totally > >> out of place. > > > >SCSI, unlike ATA, is limited to 16 chars, yes. So it can't pass the > >whole string. Recent udev versions call ata_id also for libata drives. > > But it needs kernel support, which was added for ATA-pass-through. > > > >What does: > > udevtest /block/sda > >print on your box? > > <<< > main: looking at device '/block/sda' from subsystem 'block' > run_program: 'usb_id -x' > run_program: '/lib/udev/usb_id' returned with status 1 > run_program: 'scsi_id -g -x -s /block/sda -d /dev/.tmp-8-0' > run_program: '/lib/udev/scsi_id' (stdout) 'ID_VENDOR=ATA' > run_program: '/lib/udev/scsi_id' (stdout) 'ID_MODEL=TOSHIBA_MK2003GA' > run_program: '/lib/udev/scsi_id' (stdout) 'ID_REVISION=AM.0' > run_program: '/lib/udev/scsi_id' (stdout) 'ID_SERIAL=SATA_TOSHIBA_MK2003G73A30603T' > run_program: '/lib/udev/scsi_id' (stdout) 'ID_SERIAL_SHORTsA30603T_`<344><377><377><^B>' > run_program: '/lib/udev/scsi_id' (stdout) 'ID_TYPE=disk' > run_program: '/lib/udev/scsi_id' (stdout) 'ID_BUS=scsi' > run_program: '/lib/udev/scsi_id' returned with status 0 > udev_rules_get_name: add symlink 'disk/by-id/scsi-SATA_TOSHIBA_MK2003G73A30603T' > udev_rules_get_name: 5 untrusted character(s) replaced > udev_rules_get_name: add symlink 'disk/by-id/ata-TOSHIBA_MK2003GA_73A30603T______' > run_program: 'path_id /block/sda' > run_program: '/lib/udev/path_id' (stdout) 'ID_PATH=pci-0000:00:10.0-scsi-0:0:0:0' > run_program: '/lib/udev/path_id' returned with status 0 > udev_rules_get_name: add symlink 'disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0' > run_program: 'vol_id --export /dev/.tmp-8-0' > run_program: '/lib/udev/vol_id' (stderr) '/dev/.tmp-8-0: unknown volume type' > run_program: '/lib/udev/vol_id' returned with status 4 > run_program: 'edd_id --export /dev/.tmp-8-0' > run_program: '/lib/udev/edd_id' (stderr) 'no kernel EDD support' > run_program: '/lib/udev/edd_id' returned with status 2 > udev_rules_get_name: no node name set, will use kernel name 'sda' > udev_device_event: device '/block/sda' already in database, validate currently present symlinks > udev_node_add: creating device node '/dev/sda', major = '8', minor = '0', mode = '0640', uid = '0', gid = '6' > udev_node_add: creating symlink '/dev/disk/by-id/scsi-SATA_TOSHIBA_MK2003G73A30603T' to '../../sda' > udev_node_add: creating symlink '/dev/disk/by-id/ata-TOSHIBA_MK2003GA_73A30603T______' to '../../sda' > udev_node_add: creating symlink '/dev/disk/by-path/pci-0000:00:10.0-scsi-0:0:0:0' to '../../sda' > main: run: 'socket:/org/freedesktop/hal/udev_event' > main: run: 'socket:/org/kernel/udev/monitor' > >>> > > So that would explain the six underscores. Some uninitialized char array or so > seems to be happening. Yep, it was fixed here: http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;hR84454d5f4e7ebe6c7095cf78318020ca9991bf SERIAL_SHORT is not used anymore, as native SCSI strings are too short for IDE disk links, and we switched to ATA pass-trough which was added to make this possible. > And I also wonder why the ID_MODEL gets truncated by one > character when copies to ID_SERIAL_SHORT. (The 'A' of MK2003GA is missing.) They are unfortunately truncated to 15 chars, which should be 16, yes. And if you read the native ATA string it has an additional 'H' too, which does not survive the SCSI layer. :) Kay ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel