Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

driver core: update comments in device_rename()

Document that some subsystems are still going to use device_rename for
the time being, so it is not a good idea to assume it's not used. Also
remove mentions of a plan to stop renaming net devices.

Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com>
Link: https://lore.kernel.org/r/20230406045435.19452-1-wedsonaf@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wedson Almeida Filho and committed by
Greg Kroah-Hartman
11a96703 e2f06aa8

+6 -10
+6 -10
drivers/base/core.c
··· 4416 4416 * on the same device to ensure that new_name is valid and 4417 4417 * won't conflict with other devices. 4418 4418 * 4419 - * Note: Don't call this function. Currently, the networking layer calls this 4420 - * function, but that will change. The following text from Kay Sievers offers 4421 - * some insight: 4419 + * Note: given that some subsystems (networking and infiniband) use this 4420 + * function, with no immediate plans for this to change, we cannot assume or 4421 + * require that this function not be called at all. 4422 + * 4423 + * However, if you're writing new code, do not call this function. The following 4424 + * text from Kay Sievers offers some insight: 4422 4425 * 4423 4426 * Renaming devices is racy at many levels, symlinks and other stuff are not 4424 4427 * replaced atomically, and you get a "move" uevent, but it's not easy to ··· 4434 4431 * the "move" event. It's just a mess, and nothing new should ever rely on 4435 4432 * kernel device renaming. Besides that, it's not even implemented now for 4436 4433 * other things than (driver-core wise very simple) network devices. 4437 - * 4438 - * We are currently about to change network renaming in udev to completely 4439 - * disallow renaming of devices in the same namespace as the kernel uses, 4440 - * because we can't solve the problems properly, that arise with swapping names 4441 - * of multiple interfaces without races. Means, renaming of eth[0-9]* will only 4442 - * be allowed to some other name than eth[0-9]*, for the aforementioned 4443 - * reasons. 4444 4434 * 4445 4435 * Make up a "real" name in the driver before you register anything, or add 4446 4436 * some other attributes for userspace to find the device, or use udev to add