From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 03 Jun 2002 23:50:41 +0000 Subject: Re: Which node has the device been bound to? Message-Id: 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 Tue, Jun 04, 2002 at 01:37:13AM +0200, Oliver Neukum wrote: > Am Dienstag, 4. Juni 2002 01:16 schrieb Greg KH: > > On Tue, Jun 04, 2002 at 01:05:09AM +0200, Oliver Neukum wrote: > > > > > I can't come up with anything better than a set of ioctls that > > > > > return the contents of the individual files. And I know that this > > > > > is ugly. I don't claim that this is a good solution, just that > > > > > it's the only solution I have and that there's a race otherwise. > > > > > You simply cannot use names, thus parsing files for the name of > > > > > the node won't work. > > > > > > > > Or we could just drop the whole idea of using ioctl() and live with > > > > the "instability" of parsing a filesystem :) > > > > > > There is no such thing is an acceptable race condition. > > > > Then use the device tree in driverfs as a "hint" as to where you might > > find your device. Then rely on other things (fs labels, usb serial > > numbers, ethernet mac addresses, etc.) to verify if the device you are > > talking to really is the one you think it is. > > The project started out to solve the problem once and forever and now we > are back at several heuristics. Wait, what project? linux-hotplug was created to "solve" the initial problem of people calling /sbin/hotplug in different ways, which broke userspace tools. It then became a forum for the linux-hotplug package, and general hotplugging issues. It was never created to solve "the hotplugging/device naming/persistent path/fish slicing and dicing" problem. > IMHO this defeats the purpose. What purpose? driverfs? driverfs is for a system-wide driver topology, and to provide a driver specific place for driver specific interface files (instead of /proc). And it meets that purpose quite well. Just because we can't uniquely, and race-free identify a device node with a physical device (either mapping, you choose) doesn't mean all is lost. We've never been able to do that :) thanks, greg k-h _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ 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