chiark / gitweb /
priority based symlink handling
authorKay Sievers <kay.sievers@vrfy.org>
Sun, 18 Mar 2007 11:51:57 +0000 (12:51 +0100)
committerKay Sievers <kay.sievers@vrfy.org>
Sun, 18 Mar 2007 11:51:57 +0000 (12:51 +0100)
commit24f0605c1fec98b77eddb880a405289b08cb5670
tree9278532852e3c6d13234da786baca185549aca0f
parent31de3a2ba18ffa011f5054016ccc4a500cbe0cc3
priority based symlink handling

Symlinks can have priorities now, the priority is assigned to the device
and specified with OPTIONS="link_priority=100". Devices with higher
priorities overwrite the symlinks of devices with lower priorities.
If the device, that currently owns the link goes away, the symlink
will be removed, and recreated, pointing to the next device with the
highest actual priority.

This should solve the issue, that inserting an USB-stick may overwrite the
/dev/disk/by-id/-link of another disk, and removes the entire link after the
USB-stick is disconnected. If no priorities are specified, the new link will
overwrite the current one, and if the device goes away, it will restore
the old link. It should be possible to assign lower priorities to removable
devices, if needed.

In multipath setups, we see several devices, which all connect to the same
volume, and therefore all try to create the same metadata-links. The
different path-devices are combined into one device-mapper device, which also
contains the same metadata. It should be possible, to assign multipath-table
device-mapper devices a higher priority, so path-devices that appear and
disappear, will not overwrite or delete the device-mapper device links.
udev.h
udev_db.c
udev_device.c
udev_node.c