From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carl-Daniel Hailfinger Date: Tue, 23 Mar 2004 20:57:57 +0000 Subject: Re: libsysfs/udev hang Message-Id: <4060A4D5.9050808@gmx.net> List-Id: References: <4060259D.4000905@gmx.net> In-Reply-To: <4060259D.4000905@gmx.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Daniel Stekloff wrote: > On Tuesday 23 March 2004 11:09 am, Greg KH wrote: > >>On Tue, Mar 23, 2004 at 06:04:16PM +0100, Carl-Daniel Hailfinger wrote: >> >>>>That's probably the bug. >>> >>>Then it has to be fixed in udevinfo.c:print_device_chain, too. >> >>Probably. Care to send a patch? > > > Yes, udevinfo.c print_device_chain is wrong. It doesn't properly use libsysfs > mechanisms of "open/close" and "get". I will make a patch, unless someone > else beats me to it. > > If there's confusion on "open/close" and "get" and how that works with > libsysfs, please let me know. I can explain further. Well, I assumed the udevinfo.c code was correct and took it as a starting point since the libsysfs documentation has many bugs and sports unclear wording (will send a patch for those sections once I've understood what all of those functions do). Greg: I noticed libsysfs in udev was updated recently, but it seems to differ in a few definitions from libsysfs-1.0.0. Is that intended? To explain my motivation for the buggy code I posted: For my ataraid detection code, I need a list of all hard disks attached to the system hanging off a pci ATA/SATA controller. For each disk, I need the size, the ability to read from the correct device, the vendor/device/ subsystem_vendor/subsystem_device of the hard disk controller. struct harddisk { char name[SYSFS_PATH_MAX]; dev_t device; unsigned long size; unsigned int vendor; unsigned int device; unsigned int subsystem_vendor; unsigned int subsystem_device; } The ataraid detection gets a list of struct harddisk and checks if it can find devices which are the basis of a Promise/Highpoint/whatever RAID. Greg: Is there some block device enumeration code in udev I could adapt to my purposes? I was inspired to hack a bit on udev by kpartx (utility to enable partitions on top of dm) which uses the udev build environment quite successfully and am contemplating where ataraid detection from userspace should end up in the long run. Should it be integrated into udev? Separate package? Dan: Is there a preferred way for getting the above accomplished with libsysfs? Regards, Carl-Daniel ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ 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