SHA256
1
0
forked from pool/lvm2
lvm2/udev-Check-for-DM_NR_VALID_PATHS.patch

63 lines
2.6 KiB
Diff
Raw Normal View History

From b8354ac161b5ab8a4f5842201d7ee69f5089c6dc Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Thu, 12 Jun 2014 17:07:31 +0200
Subject: [PATCH] udev: Check for DM_NR_VALID_PATHS
When the device becomes inaccessible we must not run any program
requiring disk access, as this will stall and cause udev to
eventually timeout this event.
So check for DM_NR_VALID_PATHS before calling these programs.
References: bnc#875233
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
udev/10-dm.rules.in | 1 -
udev/13-dm-disk.rules.in | 2 ++
udev/69-dm-lvm-metad.rules.in | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index 29af467..f108941 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -111,7 +111,6 @@ ENV{DM_UDEV_DISABLE_DM_RULES_FLAG}!="1", ENV{DM_NAME}=="?*", SYMLINK+="(DM_DIR)/
# We have to ignore further rule application for inappropriate events
# and devices. But still send the notification if cookie exists.
-ENV{DM_UUID}=="mpath-?*", ENV{DM_ACTION}=="PATH_FAILED", GOTO="dm_disable"
ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="dm_disable"
ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="dm_disable"
diff --git a/udev/13-dm-disk.rules.in b/udev/13-dm-disk.rules.in
index 1920260..d117a94 100644
--- a/udev/13-dm-disk.rules.in
+++ b/udev/13-dm-disk.rules.in
@@ -18,8 +18,10 @@ SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
ENV{DM_SUSPENDED}=="1", GOTO="dm_end"
+ENV{DM_NR_VALID_PATHS}=="0", GOTO="dm_blkid_end"
(BLKID_RULE)
+LABEL="dm_blkid_end"
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", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
index 706c03b..0b0ebbf 100644
--- a/udev/69-dm-lvm-metad.rules.in
+++ b/udev/69-dm-lvm-metad.rules.in
@@ -19,6 +19,7 @@ SUBSYSTEM!="block", GOTO="lvm_end"
# Device-mapper devices are processed only on change event or on supported synthesized event.
KERNEL=="dm-[0-9]*", ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="lvm_end"
+KERNEL=="dm-[0-9]*", ENV{DM_NR_VALID_PATHS}=="0", GOTO="lvm_end"
# Only process devices already marked as a PV - this requires blkid to be called before.
ENV{ID_FS_TYPE}=="LVM2_member|LVM1_member", RUN+="(LVM_EXEC)/lvm pvscan --cache --activate ay --major $major --minor $minor"
--
1.8.4.5