SHA256
1
0
forked from pool/lvm2

Accepting request 521767 from home:mwilck:branches:Base:System

New request after ruuning pre_checkin.sh

- Dropped udev rule patches (bsc#1054363)
 * dropped udev_rules-update.diff
 * dropped device-mapper-dmsetup-export.patch
 * dropped udev-Check-for-DM_NR_VALID_PATHS.patch
 * dropped Import-ID_FS_XXX-variables-bnc909358.patch
 * dropped 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch

- Dropped udev rule patches (bsc#1054363)
 * dropped udev_rules-update.diff
 * dropped device-mapper-dmsetup-export.patch
 * dropped udev-Check-for-DM_NR_VALID_PATHS.patch
 * dropped Import-ID_FS_XXX-variables-bnc909358.patch
 * dropped 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch

- Dropped udev rule patches (bsc#1054363)
 * dropped udev_rules-update.diff
 * dropped device-mapper-dmsetup-export.patch
 * dropped udev-Check-for-DM_NR_VALID_PATHS.patch
 * dropped Import-ID_FS_XXX-variables-bnc909358.patch
 * dropped 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch

OBS-URL: https://build.opensuse.org/request/show/521767
OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=202
This commit is contained in:
Eric ren 2017-09-06 20:42:11 +00:00 committed by Git OBS Bridge
parent 758f14c3c7
commit aa0494a377
11 changed files with 30 additions and 417 deletions

View File

@ -1,31 +0,0 @@
From e8d52bf13bc4529172632c49c84a80e315741862 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Fri, 19 Aug 2016 16:19:55 +0200
Subject: 69-dm-lvm-metad.rules: Do not process rules for multipath devices
When the device is a multipath device lvm metad should not process
it; doing so will reset the 'SYSTEMD_READY' flag and the multipath
setup will not work correctly.
References: bsc#990538, bsc#986734
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
udev/69-dm-lvm-metad.rules.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
index f0bfc1e..793a53d 100644
--- a/udev/69-dm-lvm-metad.rules.in
+++ b/udev/69-dm-lvm-metad.rules.in
@@ -17,6 +17,7 @@
SUBSYSTEM!="block", GOTO="lvm_end"
(LVM_EXEC_RULE)
+ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="lvm_end"
# If the PV label got lost, inform lvmetad immediately.
--
2.6.6

View File

@ -1,44 +0,0 @@
From 41c91bba5f696c6b6571218fcbf8bef8b41aa9d9 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
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 <hare@suse.de>
---
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}"

View File

@ -1,192 +0,0 @@
From 74cfa0a04f51f0629093ac11fafb9c8aba881eee Mon Sep 17 00:00:00 2001
From: Eric Ren <zren@suse.com>
Date: Tue, 11 Apr 2017 10:58:56 +0800
Subject: [PATCH] DM: add dmsetup export
bsc#479104
Patch-refreshed-by: Eric Ren <zren@suse.com>
---
man/dmsetup.8_main | 16 ++++++-
tools/dmsetup.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 139 insertions(+), 1 deletion(-)
diff --git a/man/dmsetup.8_main b/man/dmsetup.8_main
index 4421882..5a31f76 100644
--- a/man/dmsetup.8_main
+++ b/man/dmsetup.8_main
@@ -97,7 +97,15 @@ dmsetup \(em low level logical volume management
..
.CMD_LOAD
.
-.HP
+. HP
+.B dmsetup
+.de CMD_EXPORT
+. BR export
+. RI [device_name]
+..
+.CMD_EXPORT
+.
+. HP
.B dmsetup
.de CMD_LS
. ad l
@@ -564,6 +572,12 @@ Specify a one-line table directly on the command line.
See below for more information on the table format.
.
.HP
+.BR --export
+.IR export
+.br
+Outputs information in key/value format to be imported by other programs.
+.
+.HP
.BR --udevcookie
.IR cookie
.br
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 5c5c14c..2b0aed6 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -2231,6 +2231,129 @@ static int _status(CMD_ARGS)
return r;
}
+static int _export(CMD_ARGS)
+{
+ int r = 0;
+ struct dm_task *dmt = NULL;
+ void *next = NULL;
+ uint64_t start, length;
+ char *target_type = NULL;
+ char *params;
+ const char *name = NULL;
+ const char *old_name = NULL;
+ const char *uuid = NULL;
+ struct dm_info info;
+ struct dm_deps *deps;
+
+ if (names)
+ name = names->name;
+ else if (argc == 2)
+ name = argv[1];
+ old_name = name;
+
+ if (!(dmt = dm_task_create(DM_DEVICE_STATUS)))
+ goto out;
+
+ if (!_set_task_device(dmt, name, 0))
+ goto out;
+
+ if (!dm_task_run(dmt))
+ goto out;
+
+ if (!dm_task_get_info(dmt, &info) || !info.exists)
+ goto out;
+
+ if (!name)
+ name = dm_task_get_name(dmt);
+
+ uuid = dm_task_get_uuid(dmt);
+ printf("DM_NAME=%s\n", name);
+
+ if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
+ printf("DM_UUID=%s\n", uuid);
+
+ if (!info.exists) {
+ printf("DM_STATE=NOTPRESENT\n");
+ goto out;
+ }
+
+ if (!name)
+ name = dm_task_get_name(dmt);
+
+ uuid = dm_task_get_uuid(dmt);
+ printf("DM_NAME=%s\n", name);
+
+ if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
+ printf("DM_UUID=%s\n", uuid);
+
+ if (!info.exists) {
+ printf("DM_STATE=NOTPRESENT\n");
+ goto out;
+ }
+
+ printf("DM_STATE=%s\n",
+ info.suspended ? "SUSPENDED" :
+ (info.read_only ? "READONLY" : "ACTIVE"));
+
+ if (!info.live_table && !info.inactive_table)
+ printf("DM_TABLE_STATE=NONE\n");
+ else
+ printf("DM_TABLE_STATE=%s%s%s\n",
+ info.live_table ? "LIVE" : "",
+ info.live_table && info.inactive_table ? "/" : "",
+ info.inactive_table ? "INACTIVE" : "");
+
+ if (info.open_count != -1)
+ printf("DM_OPENCOUNT=%d\n", info.open_count);
+
+ printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
+
+ printf("DM_MAJOR=%d\n", info.major);
+ printf("DM_MINOR=%d\n", info.minor);
+
+ if (info.target_count != -1)
+ printf("DM_TARGET_COUNT=%d\n", info.target_count);
+
+ /* export all table types */
+ next = dm_get_next_target(dmt, next, &start, &length,
+ &target_type, &params);
+ if (target_type) {
+ printf("DM_TARGET_TYPES=%s", target_type);
+ while (next) {
+ next = dm_get_next_target(dmt, next, &start, &length,
+ &target_type, &params);
+ if (target_type)
+ printf(",%s", target_type);
+ }
+ printf("\n");
+ }
+
+ dm_task_destroy(dmt);
+
+ // bnc#707614, revert to the original name
+
+ if (!(dmt = dm_task_create(DM_DEVICE_DEPS)))
+ goto out;
+
+ name = old_name;
+ if (!_set_task_device(dmt, name, 0))
+ goto out;
+
+ if (!dm_task_run(dmt))
+ goto out;
+
+ if (!(deps = dm_task_get_deps(dmt)))
+ goto out;
+
+ printf("DM_DEPS=%d\n", deps->count);
+
+ r = 1;
+ out:
+ if (dmt)
+ dm_task_destroy(dmt);
+ return r;
+}
+
/* Show target names and their version numbers */
static int _targets(CMD_ARGS)
{
@@ -5903,6 +6026,7 @@ static struct command _dmsetup_commands[] = {
{"deps", "[-o <options>] [<device>...]", 0, -1, 1, 0, _deps},
{"stats", "<command> [<options>] [<device>...]", 1, -1, 1, 1, _stats},
{"status", "[<device>...] [--noflush] [--target <target_type>]", 0, -1, 1, 0, _status},
+ {"export", "[<device>]", 0, -1, 1, 0, _export},
{"table", "[<device>...] [--target <target_type>] [--showkeys]", 0, -1, 1, 0, _status},
{"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, 0, _wait},
{"mknodes", "[<device>...]", 0, -1, 1, 0, _mknodes},
--
2.10.2

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Aug 18 09:53:39 UTC 2017 - mwilck@suse.com
- Dropped udev rule patches (bsc#1054363)
* dropped udev_rules-update.diff
* dropped device-mapper-dmsetup-export.patch
* dropped udev-Check-for-DM_NR_VALID_PATHS.patch
* dropped Import-ID_FS_XXX-variables-bnc909358.patch
* dropped 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch
-------------------------------------------------------------------
Tue Aug 1 05:59:29 UTC 2017 - zren@suse.com

View File

@ -71,16 +71,6 @@ Patch1010: dmeventd-fix-dso-name-wrong-compare.patch
Patch1011: lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch
#SUSE patches 2000+ for device mapper, udev rules
#bsc#479104,bnc#707253
Patch2001: device-mapper-dmsetup-export.patch
#bnc#78902,bnc#789019,bnc#789020
Patch2002: udev_rules-update.diff
#bnc#875233
Patch2003: udev-Check-for-DM_NR_VALID_PATHS.patch
#bnc909358
Patch2004: Import-ID_FS_XXX-variables-bnc909358.patch
#bnc#990538,bnc#986734
Patch2005: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch
#bsc#1012973
Patch2006: simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
### COMMON-PATCH-END ###
@ -102,11 +92,6 @@ Programs and man pages for configuring and using the device mapper.
%patch1009 -p1
%patch1010 -p1
%patch1011 -p1
%patch2001 -p1
%patch2002 -p1
%patch2003 -p1
%patch2004 -p1
%patch2005 -p1
%patch2006 -p1
### COMMON-PREP-END ###

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Aug 18 09:53:39 UTC 2017 - mwilck@suse.com
- Dropped udev rule patches (bsc#1054363)
* dropped udev_rules-update.diff
* dropped device-mapper-dmsetup-export.patch
* dropped udev-Check-for-DM_NR_VALID_PATHS.patch
* dropped Import-ID_FS_XXX-variables-bnc909358.patch
* dropped 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch
-------------------------------------------------------------------
Tue Aug 1 05:59:29 UTC 2017 - zren@suse.com

View File

@ -74,16 +74,6 @@ Patch1010: dmeventd-fix-dso-name-wrong-compare.patch
Patch1011: lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch
#SUSE patches 2000+ for device mapper, udev rules
#bsc#479104,bnc#707253
Patch2001: device-mapper-dmsetup-export.patch
#bnc#78902,bnc#789019,bnc#789020
Patch2002: udev_rules-update.diff
#bnc#875233
Patch2003: udev-Check-for-DM_NR_VALID_PATHS.patch
#bnc909358
Patch2004: Import-ID_FS_XXX-variables-bnc909358.patch
#bnc#990538,bnc#986734
Patch2005: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch
#bsc#1012973
Patch2006: simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
### COMMON-PATCH-END ###
@ -106,11 +96,6 @@ A daemon for using LVM2 Logival Volumes in a clustered environment.
%patch1009 -p1
%patch1010 -p1
%patch1011 -p1
%patch2001 -p1
%patch2002 -p1
%patch2003 -p1
%patch2004 -p1
%patch2005 -p1
%patch2006 -p1
### COMMON-PREP-END ###

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Fri Aug 18 09:53:39 UTC 2017 - mwilck@suse.com
- Dropped udev rule patches (bsc#1054363)
* dropped udev_rules-update.diff
* dropped device-mapper-dmsetup-export.patch
* dropped udev-Check-for-DM_NR_VALID_PATHS.patch
* dropped Import-ID_FS_XXX-variables-bnc909358.patch
* dropped 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch
-------------------------------------------------------------------
Tue Aug 1 05:59:29 UTC 2017 - zren@suse.com

View File

@ -82,16 +82,6 @@ Patch1010: dmeventd-fix-dso-name-wrong-compare.patch
Patch1011: lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch
#SUSE patches 2000+ for device mapper, udev rules
#bsc#479104,bnc#707253
Patch2001: device-mapper-dmsetup-export.patch
#bnc#78902,bnc#789019,bnc#789020
Patch2002: udev_rules-update.diff
#bnc#875233
Patch2003: udev-Check-for-DM_NR_VALID_PATHS.patch
#bnc909358
Patch2004: Import-ID_FS_XXX-variables-bnc909358.patch
#bnc#990538,bnc#986734
Patch2005: 69-dm-lvm-metad.rules-Do-not-process-rules-for-multi.patch
#bsc#1012973
Patch2006: simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
### COMMON-PATCH-END ###
@ -123,11 +113,6 @@ Volume Manager.
%patch1009 -p1
%patch1010 -p1
%patch1011 -p1
%patch2001 -p1
%patch2002 -p1
%patch2003 -p1
%patch2004 -p1
%patch2005 -p1
%patch2006 -p1
### COMMON-PREP-END ###

View File

@ -1,49 +0,0 @@
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(-)
Index: LVM2.2.02.152/udev/13-dm-disk.rules.in
===================================================================
--- LVM2.2.02.152.orig/udev/13-dm-disk.rules.in
+++ LVM2.2.02.152/udev/13-dm-disk.rules.in
@@ -18,10 +18,12 @@ SYMLINK+="disk/by-id/dm-name-$env{DM_NAM
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_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"
ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS+="link_priority=-100"
OPTIONS+="watch"
ENV{DM_TARGET_TYPES}=="*snapshot-origin*", OPTIONS+="link_priority=-90"
Index: LVM2.2.02.152/udev/69-dm-lvm-metad.rules.in
===================================================================
--- LVM2.2.02.152.orig/udev/69-dm-lvm-metad.rules.in
+++ LVM2.2.02.152/udev/69-dm-lvm-metad.rules.in
@@ -47,6 +47,7 @@ ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="dis
# DM device:
KERNEL!="dm-[0-9]*", GOTO="next"
+KERNEL=="dm-[0-9]*", ENV{DM_NR_VALID_PATHS}=="0", GOTO="lvm_end"
ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan"
GOTO="lvm_end"

View File

@ -1,56 +0,0 @@
From 68b91b24d8743129b971b047e1189d6f6e772b15 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 25 Jul 2017 22:19:10 +0800
Subject: [PATCH] update lvm udev rules
References: bnc#78902 bnc#789019 bnc#789020
Refrshed-by: Eric Ren <zren@suse.com>
---
udev/10-dm.rules.in | 4 ++++
udev/13-dm-disk.rules.in | 9 ++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index b4fa52a..166dd3d 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -115,6 +115,10 @@ TEST=="dm", ENV{DM_NAME}="$attr{dm/name}", ENV{DM_UUID}="$attr{dm/uuid}", ENV{DM
TEST!="dm", IMPORT{program}="(DM_EXEC)/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o name,uuid,suspended"
ENV{DM_SUSPENDED}!="?*", IMPORT{program}="(DM_EXEC)/dmsetup info -j %M -m %m -c --nameprefixes --noheadings --rows -o suspended"
+# dmsetup export is a SUSE extension to dmsetup
+# it is required by some other udev rules in SUSE distro.
+IMPORT{program}="(DM_EXEC)/dmsetup export -j %M -m %m"
+
# dmsetup tool provides suspended state information in textual
# form with values "Suspended"/"Active". We translate it to
# 0/1 respectively to be consistent with sysfs values.
diff --git a/udev/13-dm-disk.rules.in b/udev/13-dm-disk.rules.in
index 5355810..0e97e59 100644
--- a/udev/13-dm-disk.rules.in
+++ b/udev/13-dm-disk.rules.in
@@ -14,14 +14,17 @@ ACTION!="add|change", GOTO="dm_end"
ENV{DM_UDEV_RULES_VSN}!="?*", GOTO="dm_end"
ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end"
-SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}"
-ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}"
+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_NOSCAN}=="1", GOTO="dm_watch"
+ENV{DM_TARGET_TYPES}=="|*error*", GOTO="dm_end"
(BLKID_RULE)
-ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100"
+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}"
ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
--
2.10.2