Description of problem: Systemd-udevd does not handle disk ids properly, thus failing to create symlinks in /dev/disk/by-id/ directory. The problem occurs on device ids containing metacharacters, namely `/' (the slash). Version-Release number of selected component (if applicable): 204-8.fc19 How reproducible: Always Steps to Reproduce: 1. Create a device (e.g. software raid) with a name containing a slash. In the case of mine that was raid1 arrays named after their mount points: /usr/local/, /var/spool/, etc. 2. Let systemd notice that device. Actual results: A number (1 per each such device) of systemd-udevd processes appears in the proccess table eating 100% of CPU time, taking the system on its knees. After a while they die leaving log lines like: | | 22:45:51,353 ERR systemd-udevd: rename '/dev/disk/by-id/md-name-localhost:/var/.tmp-b9:121' '/dev/disk/by-id/md-name-localhost:/var/' failed: Not a directory | 22:45:52,001 ERR systemd-udevd: rename '/dev/disk/by-id/md-name-localhost:/usr/.tmp-b9:115' '/dev/disk/by-id/md-name-localhost:/usr/' failed: Not a directory | 22:45:52,118 ERR systemd-udevd: rename '/dev/disk/by-id/md-name-localhost:/usr/.tmp-b9:115' '/dev/disk/by-id/md-name-localhost:/usr/' failed: Not a directory | 22:45:52,299 ERR systemd-udevd: rename '/dev/disk/by-id/md-name-localhost:/var/.tmp-b9:121' '/dev/disk/by-id/md-name-localhost:/var/' failed: Not a directory [...] | 22:46:19,696 ERR systemd-udevd: worker [734] /devices/virtual/block/md127 timeout; kill it | 22:46:19,697 ERR systemd-udevd: seq 2475 '/devices/virtual/block/md127' killed | 22:46:19,697 ERR systemd-udevd: worker [734] terminated by signal 9 (Killed) | 22:46:22,700 ERR systemd-udevd: worker [725] /devices/virtual/block/md114 timeout; kill it | 22:46:22,700 ERR systemd-udevd: seq 2504 '/devices/virtual/block/md114' killed | 22:46:22,700 ERR systemd-udevd: worker [726] /devices/virtual/block/md120 timeout; kill it | 22:46:22,701 ERR systemd-udevd: seq 2491 '/devices/virtual/block/md120' killed | 22:46:22,701 ERR systemd-udevd: worker [727] /devices/virtual/block/md118 timeout; kill it | 22:46:22,702 ERR systemd-udevd: seq 2495 '/devices/virtual/block/md118' killed | 22:46:22,702 ERR systemd-udevd: worker [728] /devices/virtual/block/md117 timeout; kill it | 22:46:22,702 ERR systemd-udevd: seq 2498 '/devices/virtual/block/md117' killed | 22:46:22,706 ERR systemd-udevd: worker [730] /devices/virtual/block/md125 timeout; kill it | 22:46:22,706 ERR systemd-udevd: seq 2481 '/devices/virtual/block/md125' killed | 22:46:22,706 ERR systemd-udevd: worker [731] /devices/virtual/block/md126 timeout; kill it | 22:46:22,706 ERR systemd-udevd: seq 2485 '/devices/virtual/block/md123' killed | 22:46:22,707 ERR systemd-udevd: worker [732] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [736] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [741] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [727] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [730] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [726] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [728] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [742] terminated by signal 9 (Killed) | 22:46:22,710 ERR systemd-udevd: worker [725] terminated by signal 9 (Killed) | 22:47:02,720 ERR systemd-udevd: worker [994] /devices/virtual/block/md18 timeout; kill it | 22:47:02,720 ERR systemd-udevd: seq 2618 '/devices/virtual/block/md18' killed | 22:47:02,734 ERR systemd-udevd: worker [994] terminated by signal 9 (Killed) | 22:48:24,223 ERR systemd-udevd: worker [995] /devices/virtual/block/md18 timeout; kill it | 22:48:24,223 ERR systemd-udevd: seq 2679 '/devices/virtual/block/md18' killed | 22:48:24,224 ERR systemd-udevd: worker [995] terminated by signal 9 (Killed) | 22:48:55,859 ERR systemd-udevd: worker [1021] /devices/virtual/block/md18 timeout; kill it | 22:48:55,860 ERR systemd-udevd: seq 2680 '/devices/virtual/block/md18' killed | 22:48:55,864 ERR systemd-udevd: worker [1021] terminated by signal 9 (Killed) | A this moment the systemd decides that the devices fail and are unusable. Although actually they are operational, the bootup curve gets ruined by systemd, the system becomes absolutely useless. Expected results: As device ids can contain metacharacters they should not be used as filenames directly, some precautions (univocal name encoding scheme (like url-encoding)? sanitization?) must be taken. OTOH those name mangling should not lead to filenames clash. Additional info:
$ fgrep -r md-name /lib/udev/rules.d/ /lib/udev/rules.d/64-md-raid.rules:ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" /lib/udev/rules.d/64-md-raid.rules:ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" $ rpm -qf /lib/udev/rules.d/64-md-raid.rules mdadm-3.2.6-19.fc19.x86_64 According to the udev source code, the OPTIONS+="string_escape=replace" has to be processed before the SYMLINK+="..." Is the issue fixed, if you rewrite the rules in /lib/udev/rules.d/64-md-raid.rules to look like: ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", OPTIONS+="string_escape=replace", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}" ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", OPTIONS+="string_escape=replace", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n"
The string returned from the executed mdadm contains the '/' character. Udev will not replace that character and tries to handle it as a subdirectory; '/' cannot be controlled by OPTIONS+="string_escape=replace". '/' is currently just not supported fo MD name, it cannot be used; symlinks will not be correct. Mdadm would need escaped the names itself, and not expect udev to do it.
mdadm and md do not support device names with / in them either (the devices may get started, but that does not mean that the name of the device is a supported name). In the past, I've been known to use things such as home for /home, repos for /srv/repos, etc. You can use whatever you want, there is no need for it to be a full path name and if you really want full path name, you'll need to use something like _usr_local instead of /usr/local.