summaryrefslogtreecommitdiffstats
path: root/rules.d/60-persistent-storage.rules.in
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2023-07-21 04:39:45 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2023-07-21 12:42:34 +0200
commitdf1dccd25547b430258bd42ec60428fc9aff1370 (patch)
treef76ffa1bb9249b93d6c1045f5beb4ce309a4fc80 /rules.d/60-persistent-storage.rules.in
parenttree-wide: fix typo found by Fossies Codespell report (diff)
downloadsystemd-df1dccd25547b430258bd42ec60428fc9aff1370.tar.xz
systemd-df1dccd25547b430258bd42ec60428fc9aff1370.zip
udev: decrease devlink priority for iso disks
Previously, if the priority is same, devlinks are always replaced by newer events. The commit 331aa7aa15ee5dd12b369b276f575d521435eb52 changes that to keep the existing devlink. That should not change any behavior when the devices that request the same symlink do not have any dependency, e.g. when /dev/sda1 and /dev/adb1 request the same /dev/disk/by-label symlink, as there are no guarantee that which device is processed first. However, when devices has dependency, e.g. /dev/sda and /dev/sda1 request the same /dev/disk/by-label symlink, previously the symlink always pointed to the partition, as the partition is always processed later. But, 331aa7aa15ee5dd12b369b276f575d521435eb52 makes the symlink point to the whole disk. The change by 331aa7aa15ee5dd12b369b276f575d521435eb52 is crucial to improve performance of devlink handling, especially when a system has large number of disks with same label or so. Hence, cannot and should not be reverted. So, let's workaround the case, as such situation should happen only when the disk is a hybrind ISO image, I guess. Fixes #28468.
Diffstat (limited to 'rules.d/60-persistent-storage.rules.in')
-rw-r--r--rules.d/60-persistent-storage.rules.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/rules.d/60-persistent-storage.rules.in b/rules.d/60-persistent-storage.rules.in
index b3c222a268..f08fc0da2f 100644
--- a/rules.d/60-persistent-storage.rules.in
+++ b/rules.d/60-persistent-storage.rules.in
@@ -132,6 +132,12 @@ 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"
+
# 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}"