kpartx.rules: don't rely on DM_DEPS and DM_TABLE_STATE
authorMartin Wilck <mwilck@suse.com>
Sat, 2 Sep 2017 22:38:52 +0000 (00:38 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 20 Sep 2017 16:01:28 +0000 (18:01 +0200)
These tests (which were SUSE-specific anyway) are not needed
here. The kpartx invocation further down is guarded separately.
SYMLINK actions must be run in any case for consistency, and
there's no need to access the udev db here because kpartx_id
also works on otherwise broken devices.

Signed-off-by: Martin Wilck <mwilck@suse.com>
kpartx/kpartx.rules

index 64d550d..ea34e44 100644 (file)
@@ -5,12 +5,12 @@
 #
 
 KERNEL!="dm-*", GOTO="kpartx_end"
-ACTION=="remove", GOTO="kpartx_end"
+ACTION!="add|change", GOTO="kpartx_end"
+ENV{DM_UUID}!="?*", GOTO="kpartx_end"
 
-ENV{DM_TABLE_STATE}!="LIVE", GOTO="kpartx_end"
-ENV{DM_DEPS}=="0", GOTO="kpartx_end"
-
-ENV{DM_UUID}=="?*", IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}"
+# kpartx_id is very robust, it works for suspended maps and maps
+# with 0 dependencies
+IMPORT{program}=="kpartx_id %M %m $env{DM_UUID}"
 
 OPTIONS="link_priority=50"