1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-21 22:04:19 +03:00

Remove 'last_rule' from udev rules.

'last_rule' option has been removed from udev (version >= 147).

From now on, we require foreign rules to check and honor
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG} instead. Foreign
rules should be skipped totally when this flag is set.
This commit is contained in:
Peter Rajnoha 2009-11-13 12:33:27 +00:00
parent cf7f096db7
commit 01d3349587
3 changed files with 8 additions and 16 deletions

View File

@ -1,5 +1,6 @@
Version 1.02.40 - Version 1.02.40 -
=================================== ===================================
Remove 'last_rule' from udev rules: honor ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}.
Add dmsetup --inactive support. Add dmsetup --inactive support.
Add dm_task_query_inactive_table to libdevmapper for kernel driver >= 4.16. Add dm_task_query_inactive_table to libdevmapper for kernel driver >= 4.16.
Fix hash lookup segfault when keys compared are different lengths. Fix hash lookup segfault when keys compared are different lengths.

View File

@ -1058,9 +1058,9 @@ void dm_report_field_set_value(struct dm_report_field *field, const void *value,
/* /*
* DM_UDEV_DISABLE_OTHER_RULES_FLAG is set in case we need to disable * DM_UDEV_DISABLE_OTHER_RULES_FLAG is set in case we need to disable
* all the other rules that are not general device-mapper nor subsystem * all the other rules that are not general device-mapper nor subsystem
* related (the rules belong to other software or packages). Use this * related (the rules belong to other software or packages). All foreign
* flag with care since it will cutoff the rule processing after the * rules should check this flag directly and they should ignore further
* last device-mapper/subsytem rule is applied. * rule processing for such event.
*/ */
#define DM_UDEV_DISABLE_OTHER_RULES_FLAG 0x0008 #define DM_UDEV_DISABLE_OTHER_RULES_FLAG 0x0008
/* /*

View File

@ -10,27 +10,18 @@
# suspended. # suspended.
# "add" event is processed on coldplug only! # "add" event is processed on coldplug only!
ACTION!="add|change", GOTO="dm_other" ACTION!="add|change", GOTO="dm_end"
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_other" ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_other" ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end"
SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
ENV{DM_SUSPENDED}=="1", GOTO="dm_other" ENV{DM_SUSPENDED}=="1", GOTO="dm_end"
IMPORT{program}="$env{DM_SBIN_PATH}/blkid -o udev -p $tempnode" IMPORT{program}="$env{DM_SBIN_PATH}/blkid -o udev -p $tempnode"
ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100" ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100"
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_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
# Cutoff all subsequent rules if instructed by a flag.
# This flag should be used in well-founded situations only to prevent
# any problems that could arise when processing this event further by
# foreign rules (various temporary and hidden devices mostly).
LABEL="dm_other"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="dm_end"
ENV{DM_COOKIE}=="?*", RUN+="$env{DM_SBIN_PATH}/dmsetup udevcomplete $env{DM_COOKIE}"
OPTIONS+="last_rule"
LABEL="dm_end" LABEL="dm_end"