mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
udev: change action check from ACTION!="add|change" to ACTION=="remove"
For DM devices, the add/change/remove can appear as action for genuine udev events. However, there are more action types (bind, unbind, move, online, offline) which never appear as actions for genuine DM udev events, but they can still be synthesized (e.g. by writing "<action>" to "/sys/.../uevent" file or by calling "udevadm trigger --action=<action>"). Let's also process these extra action types so that the udev-related content is not lost completely, keeping all the symlinks and udev db entries just like this was a synthetic udev event with "change" action. Related to https://gitlab.com/lvmteam/lvm2/-/issues/4.
This commit is contained in:
parent
71bac6f45b
commit
48188d7181
@ -49,7 +49,7 @@ KERNEL!="dm-[0-9]*", GOTO="dm_end"
|
||||
# (e.g. /dev/mapper) are created in right time after a device has its table
|
||||
# loaded and is properly resumed. For this reason, direct use of dm-X nodes
|
||||
# is not recommended.
|
||||
ACTION!="add|change", GOTO="dm_end"
|
||||
ACTION=="remove", GOTO="dm_end"
|
||||
|
||||
# Decode udev control flags and set environment variables appropriately.
|
||||
# These flags are encoded in DM_COOKIE variable that was introduced in
|
||||
|
@ -13,7 +13,7 @@
|
||||
# DM_LV_LAYER - logical volume layer (blank if not set)
|
||||
|
||||
# "add" event is processed on coldplug only!
|
||||
ACTION!="add|change", GOTO="lvm_end"
|
||||
ACTION=="remove", GOTO="lvm_end"
|
||||
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end"
|
||||
ENV{DM_UUID}!="LVM-?*", GOTO="lvm_end"
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
# DM_LV_LAYER - logical volume layer (not set if LVM device not present)
|
||||
|
||||
# "add" event is processed on coldplug only!
|
||||
ACTION!="add|change", GOTO="dm_end"
|
||||
ACTION=="remove", GOTO="dm_end"
|
||||
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"
|
||||
|
||||
# A few demonstrational examples...
|
||||
|
@ -10,7 +10,7 @@
|
||||
# suspended.
|
||||
|
||||
# "add" event is processed on coldplug only!
|
||||
ACTION!="add|change", GOTO="dm_end"
|
||||
ACTION=="remove", GOTO="dm_end"
|
||||
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"
|
||||
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user