- 64-md-raid.rules - make clear distinction between

'disk' and 'partition' cases.  In particular it
  is wrong and problematic to test for 'md/array_state'
  for 'partition' devices as they cannot see 'md/*'
  and cannot exist when it doesn't have a valid value
  anyway. (bnc#684291)

OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=35
This commit is contained in:
Neil Brown 2011-06-14 06:09:00 +00:00 committed by Git OBS Bridge
parent 2b5b347725
commit b2660b5e92
2 changed files with 20 additions and 7 deletions

View File

@ -8,6 +8,7 @@ ENV{ID_FS_TYPE}=="linux_raid_member", PROGRAM="/bin/grep -qs '^AUTO -all' /etc/m
# import data from a raid set
KERNEL!="md*", GOTO="md_end"
ENV{DEVTYPE}!="disk",GOTO="md_not_disk"
#this extra caution avoids some races with the device disappearing
TEST!="md/array_state", GOTO="md_end"
# container devices have a metadata version of e.g. 'external:ddf' and
@ -17,16 +18,18 @@ ATTR{md/array_state}=="|clear|inactive", GOTO="md_end"
LABEL="md_ignore_state"
IMPORT{program}="/sbin/mdadm --detail --export $tempnode"
ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace"
ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}"
ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}"
LABEL="md_not_disk"
ENV{DEVTYPE}!="partition", GOTO="md_vol_id"
IMPORT{program}="/sbin/mdadm --detail --export %r/$parent"
ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace"
ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n"
ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n"
ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n"
ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace"
ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n"
ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n"
ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n"
LABEL="md_vol_id"
IMPORT{program}="/sbin/blkid -o udev -p $tempnode"

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Tue Jun 14 06:07:19 UTC 2011 - nfbrown@novell.com
- 64-md-raid.rules - make clear distinction between
'disk' and 'partition' cases. In particular it
is wrong and problematic to test for 'md/array_state'
for 'partition' devices as they cannot see 'md/*'
and cannot exist when it doesn't have a valid value
anyway. (bnc#684291)
-------------------------------------------------------------------
Tue Mar 1 22:15:23 UTC 2011 - nfbrown@novell.com