mirror of
https://github.com/systemd/systemd.git
synced 2025-01-12 13:18:14 +03:00
Merge pull request #29691 from yuwata/dissect
udev: update devlink with the newer device node even when priority is equivalent
This commit is contained in:
commit
df594373a4
@ -134,17 +134,6 @@ KERNEL!="sr*|mmcblk[0-9]boot[0-9]", IMPORT{builtin}="blkid"
|
||||
LABEL="persistent_storage_blkid_probe_end"
|
||||
{% endif %}
|
||||
|
||||
# Decrease devlink priority for whole disk of ISO hybrid images, and make the
|
||||
# priority for partitions in the image relatively higher. This is for the case
|
||||
# that a disk and one of its partition have the same label or so.
|
||||
# See issue #28468.
|
||||
ENV{ID_FS_TYPE}=="iso9660", ENV{DEVTYPE}=="disk", OPTIONS+="link_priority=-10"
|
||||
|
||||
# Decrease devlink priority for encrypted partitions, and make the priority for
|
||||
# decrypted DM devices relatively higher. This is for the case that an encrypted
|
||||
# partition and its decrypted DM device have the same label.
|
||||
ENV{ID_FS_USAGE}=="crypto", OPTIONS+="link_priority=-10"
|
||||
|
||||
# by-label/by-uuid links (filesystem metadata)
|
||||
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
|
||||
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
|
||||
|
@ -467,13 +467,13 @@ static int link_update(sd_device *dev, const char *slink, bool add) {
|
||||
/* The devlink priority is downgraded. Another device may have a higher
|
||||
* priority now. Let's find the device node with the highest priority. */
|
||||
} else {
|
||||
if (current_prio >= prio)
|
||||
/* The devlink with equal or higher priority already exists and is
|
||||
* owned by another device. Hence, it is not necessary to recreate it. */
|
||||
if (current_prio > prio)
|
||||
/* The devlink with a higher priority already exists and is owned by
|
||||
* another device. Hence, it is not necessary to recreate it. */
|
||||
return 0;
|
||||
|
||||
/* This device has a higher priority than the current. Let's create the
|
||||
* devlink to our device node. */
|
||||
/* This device has the equal or a higher priority than the current. Let's
|
||||
* create the devlink to our device node. */
|
||||
return node_symlink(dev, NULL, slink);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user