Re: How do I choose an arbitrary minor number for my tty device?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kay Sievers
Date: Wednesday, December 1, 2010 - 2:54 am

On Wed, Dec 1, 2010 at 02:00, Greg KH <greg@kroah.com> wrote:

A bit more details:

First: never rename anything! :)

It's racy at many levels, symlinks and other stuff are not replaced
atomically, you get a "move" uevent", but it's not easy to connect the
event to the old and new device. Device nodes are not renamed at all,
there isn't even support for that in the kernel now.

In the meantime during renaming, your target name might be taken by
another driver, creating conflicts. Or the old name is taken directly
after you renamed it -- then you get events for the same DEVPATH,
before you even seet the "move" event. It's just a mess, and nothing
new should ever rely on kernel device renaming. Besides that it's not
even implemented now for other things than (driver-core wise very
simple) network devices.

We are currently about to change network renaming in udev to
completely disallow renaming of devices in the same namespace as the
kernel uses, because we can't solve the problems properly, that arise
with swapping names of multiple interfaces without races. Means,
renaming of eth[0-9]* will only be allowed to some other name than
eth[0-9]*, for the mentioned reasons.

Make up a "real" name in the driver before you register anything, or
add some other attributes for userspace to find the device, or use
udev to add symlinks -- but never rename kernel devices later, it's a
complete mess. We don't even want to get into that and try to
implement the missing pieces in the core. We really have other pieces
to fix in the driver core mess. :)

Kay
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: How do I choose an arbitrary minor number for my tty d ..., Tabi Timur-B04825, (Mon Nov 29, 9:15 pm)
Re: How do I choose an arbitrary minor number for my tty d ..., Kay Sievers, (Wed Dec 1, 2:54 am)