Bug 987655
| Summary: | 64-md-raid.rules produce unescaped SYMLINKS | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | QingLong <qinglong> |
| Component: | mdadm | Assignee: | Doug Ledford <dledford> |
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 19 | CC: | agk, dledford, harald, Jes.Sorensen, johannbg, lnykryn, msekleta, notting, plautrba, prajnoha, qinglong, systemd-maint, vpavlin, zbyszek |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2013-07-30 15:26:40 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
QingLong
2013-07-23 19:54:38 UTC
$ 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. |