From 6c5fd844aa9fd960168ea2b008aa9006185ce50c6c817947d538760d75eb8999 Mon Sep 17 00:00:00 2001 From: LiuhuaMelody Wang Date: Tue, 21 Jul 2015 02:18:40 +0000 Subject: [PATCH] Accepting request 316548 from home:zhonglidong:branches:Base:System bug fix for 909358 and 932300 OBS-URL: https://build.opensuse.org/request/show/316548 OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=132 --- ...t-state-variable-for-spurious-events.patch | 18 ++++++++ Import-ID_FS_XXX-variables-bnc909358.patch | 44 +++++++++++++++++++ lvm2.changes | 13 ++++++ lvm2.spec | 6 ++- 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 10-dm.rules-Reset-state-variable-for-spurious-events.patch create mode 100644 Import-ID_FS_XXX-variables-bnc909358.patch diff --git a/10-dm.rules-Reset-state-variable-for-spurious-events.patch b/10-dm.rules-Reset-state-variable-for-spurious-events.patch new file mode 100644 index 0000000..c9e8f27 --- /dev/null +++ b/10-dm.rules-Reset-state-variable-for-spurious-events.patch @@ -0,0 +1,18 @@ +References: bsc#932300 +--- +Index: LVM2.2.02.120/udev/10-dm.rules.in +=================================================================== +--- LVM2.2.02.120.orig/udev/10-dm.rules.in ++++ LVM2.2.02.120/udev/10-dm.rules.in +@@ -127,6 +127,11 @@ ENV{DM_UDEV_DISABLE_DM_RULES_FLAG}!="1", + # We have to ignore further rule application for inappropriate events + # and devices. But still send the notification if cookie exists. + ++# Reset variables for spurious events ++ENV{DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG}="" ++ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}="" ++ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}="" ++ + # Avoid processing and scanning a DM device in the other (foreign) + # rules if it is in suspended state. However, we still keep 'disk' + # and 'DM subsystem' related rules enabled in this case. diff --git a/Import-ID_FS_XXX-variables-bnc909358.patch b/Import-ID_FS_XXX-variables-bnc909358.patch new file mode 100644 index 0000000..dc8c1ec --- /dev/null +++ b/Import-ID_FS_XXX-variables-bnc909358.patch @@ -0,0 +1,44 @@ +From 41c91bba5f696c6b6571218fcbf8bef8b41aa9d9 Mon Sep 17 00:00:00 2001 +From: Hannes Reinecke +Date: Wed, 25 Mar 2015 09:44:03 +0100 +Subject: [PATCH] 13-dm-disk.rules: Import ID_FS_XXX variables from udev + database +References: bnc#909358 + +If the disk is unavailable we need to import the existing ID_FS_XXX +variables from the database, otherwise the filesystem UUID won't +be set and the by-uuid symlink will disappear, leading to +intermittent boot failures. + +Signed-off-by: Hannes Reinecke +--- + +Index: LVM2.2.02.120/udev/13-dm-disk.rules.in +=================================================================== +--- LVM2.2.02.120.orig/udev/13-dm-disk.rules.in ++++ LVM2.2.02.120/udev/13-dm-disk.rules.in +@@ -17,15 +17,22 @@ ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1 + SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}", OPTIONS+="string_escape=replace" + ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}", OPTIONS+="string_escape=replace" + +-ENV{DM_SUSPENDED}=="1", GOTO="dm_end" ++ENV{DM_SUSPENDED}=="1", GOTO="dm_blkid_end" + ENV{DM_NR_VALID_PATHS}=="0", GOTO="dm_blkid_end" + ENV{DM_NOSCAN}=="1", GOTO="dm_watch" + ENV{DM_TARGET_TYPES}=="|*error*", GOTO="dm_end" + + (BLKID_RULE) + LABEL="dm_blkid_end" ++# For a suspended or otherwise unavailable device we ++# need to import the variables from the database, otherwise ++# a service interruption might occur ++ENV{ID_FS_TYPE}!="?*", IMPORT{db}="ID_FS_TYPE" ++ENV{ID_FS_USAGE}!="?*", IMPORT{db}="ID_FS_USAGE" ++ENV{ID_FS_UUID}!="?*", IMPORT{db}="ID_FS_UUID" ++ENV{ID_FS_UUID_ENC}!="?*", IMPORT{db}="ID_FS_UUID_ENC" ++ENV{ID_FS_VERSION}!="?*", IMPORT{db}="ID_FS_VERSION" + ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS+="link_priority=-100" +-OPTIONS+="watch" + ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS+="link_priority=-90" + 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/lvm2.changes b/lvm2.changes index 78f3493..d4df666 100644 --- a/lvm2.changes +++ b/lvm2.changes @@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Tue Jul 14 05:41:55 UTC 2015 - lzhong@suse.com + +-13-dm-disk.rules: Import ID_FS_XXX variables from udev + database(bnc#909358) + If the disk is unavailable we need to import the existing ID_FS_XXX + variables from the database, otherwise the filesystem UUID won't + be set and the by-uuid symlink will disappear, leading to + intermittent boot failures + + Import-ID_FS_XXX-variables-bnc909358.patch + +-10-dm.rules: Reset state variables for spurious events (bsc#932300) + + 10-dm.rules-Reset-state-variable-for-spurious-events.patch +------------------------------------------------------------------- Tue May 19 16:30:47 UTC 2015 - jeffm@suse.com - Update to 2.02.120 diff --git a/lvm2.spec b/lvm2.spec index 7bbfde0..65fa380 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -1,7 +1,7 @@ # # spec file for package lvm2 # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -87,6 +87,8 @@ Patch2005: udev-Check-for-DM_NR_VALID_PATHS.patch # suse, boo#910327 Patch2006: lvm2-do-not-strip-pdata_tools.patch Patch2007: fsadm-add-support-for-btrfs.patch +Patch2008: Import-ID_FS_XXX-variables-bnc909358.patch +Patch2009: 10-dm.rules-Reset-state-variable-for-spurious-events.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: autoconf @@ -148,6 +150,8 @@ Volume Manager. %patch2005 -p1 %patch2006 -p1 %patch2007 -p1 +%patch2008 -p1 +%patch2009 -p1 %build #set path so that thin_check can be found