On Fri, 23 Mar 2007, Greg KH wrote: > > I don't buy the argument about needing to keep the number in use merely > > because the device node is still open. Once the node has been > > unregistered it is no longer visible to userspace. Only the existing open > > file references can be used, and a new device node could be created using > > the same name without conflict. > > You're right it's no longer visable to userspace, however it's still in > use within the kernel, so we can't reuse the minor device number until > it gets freed up. Unless I'm missing something in the tty layer...
To tell the truth, I don't know. It depends on the details of how devices are registered and unregistered; in principle it could be done either way. > > Regular files work like that. If a program has a file named "foo" open > > when you do "rm foo", the open file reference won't prevent you from > > creating a new file named "foo" in the same directory. There will be no > > conflict or confusion between the two files. > > But devices don't work like that on any other OS, or for other types of > devices, do they? > > Do block devices work like this if you have /dev/sda open, unplug it, > and then add it back? I need to go try that sometime... IIRC /dev/sda does _not_ work like this. If you hold it open while unplugging the device and plugging it back in, the new incarnation will be /dev/sdb. It's probably just a side effect from the way these things are implemented. If device nodes have a minor number that reflects their location in a table, and the entry cannot be freed until all existing references have been dropped, then yes -- the slot in the table will remain occupied and so new device nodes will have to get a different number. With regular files, there's no relation between a file's name and its inode number. A new file can be created with the same name, but it won't be able to use the same inode number unless all references to the old file have been released. Alan Stern ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel