Accepting request 140942 from home:seife:branches:Base:System

fix bnc#789019,bnc#789020,bnc#789021

OBS-URL: https://build.opensuse.org/request/show/140942
OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=51
This commit is contained in:
Stefan Seyfried 2012-11-12 12:23:48 +00:00 committed by Git OBS Bridge
parent 97b3689a1e
commit b693392ea6
4 changed files with 64 additions and 17 deletions

View File

@ -2,17 +2,25 @@
tools/dmsetup.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
Index: LVM2.2.02.98/tools/dmsetup.c
===================================================================
--- LVM2.2.02.98.orig/tools/dmsetup.c
+++ LVM2.2.02.98/tools/dmsetup.c
@@ -1720,6 +1720,7 @@ static int _export(int argc, char **argv
@@ -1717,10 +1717,11 @@ static int _export(CMD_ARGS)
char *target_type = NULL;
char *params;
const char *name = NULL;
const char *uuid = NULL;
struct dm_info info;
+ struct dm_deps *deps;
if (data)
if (names)
name = names->name;
@@ -1789,6 +1790,28 @@ static int _export(int argc, char **argv
else if (argc == 2)
name = argv[1];
@@ -1786,10 +1787,32 @@ static int _export(CMD_ARGS)
printf(",%s", target_type);
}
printf("\n");
}
@ -22,9 +30,9 @@
+ goto out;
+
+ name = NULL;
+ if (data)
+ if (names)
+ name = names->name;
+ else if (argc == 2)
+ else if (argc == 2)
+ name = argv[1];
+
+ if (!_set_task_device(dmt, name, 0))
@ -41,3 +49,5 @@
r = 1;
out:
if (dmt)
dm_task_destroy(dmt);
return r;

View File

@ -1,11 +1,15 @@
---
man/dmsetup.8.in | 7 ++++
tools/dmsetup.c | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+)
tools/dmsetup.c | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 95 insertions(+)
Index: LVM2.2.02.98/man/dmsetup.8.in
===================================================================
--- LVM2.2.02.98.orig/man/dmsetup.8.in
+++ LVM2.2.02.98/man/dmsetup.8.in
@@ -19,6 +19,9 @@ dmsetup \- low level logical volume mana
@@ -17,10 +17,13 @@ dmsetup \- low level logical volume mana
.RB [{ \-\-addnodeoncreate | \-\-addnodeonresume }]
.RB [ \-\-readahead
.RI [ \+ ]< sectors >| auto | none ]
.RE
.br
@ -15,7 +19,11 @@
.B dmsetup deps
.RB [ \-o
.IR options ]
@@ -285,6 +288,10 @@ device_name in subsequent dmsetup comman
.RI [ device_name ]
.br
@@ -283,10 +286,14 @@ Otherwise a table is read from standard
The optional uuid can be used in place of
device_name in subsequent dmsetup commands.
If successful a device will appear as
/dev/mapper/<device-name>.
See below for information on the table format.
@ -26,13 +34,19 @@
.br
.TP
.B deps
.RB [ \-o
.IR options ]
Index: LVM2.2.02.98/tools/dmsetup.c
===================================================================
--- LVM2.2.02.98.orig/tools/dmsetup.c
+++ LVM2.2.02.98/tools/dmsetup.c
@@ -1708,6 +1708,94 @@ static int _status(CMD_ARGS)
@@ -1706,10 +1706,97 @@ static int _status(CMD_ARGS)
out:
dm_task_destroy(dmt);
return r;
}
+static int _export(int argc, char **argv, void *data)
+static int _export(CMD_ARGS)
+{
+ int r = 0;
+ struct dm_task *dmt = NULL;
@ -40,12 +54,11 @@
+ uint64_t start, length;
+ char *target_type = NULL;
+ char *params;
+ struct dm_names *names = (struct dm_names *) data;
+ const char *name = NULL;
+ const char *uuid = NULL;
+ struct dm_info info;
+
+ if (data)
+ if (names)
+ name = names->name;
+ else if (argc == 2)
+ name = argv[1];
@ -123,7 +136,11 @@
/* Show target names and their version numbers */
static int _targets(CMD_ARGS)
{
@@ -3058,6 +3146,7 @@ static struct command _commands[] = {
int r = 0;
struct dm_task *dmt;
@@ -3056,10 +3143,11 @@ static struct command _commands[] = {
{"message", "<device> <sector> <message>", 2, -1, 0, _message},
{"ls", "[--target <target_type>] [--exec <command>] [-o options] [--tree]", 0, 0, 0, _ls},
{"info", "[<device>]", 0, -1, 1, _info},
{"deps", "[-o options] [<device>]", 0, -1, 1, _deps},
{"status", "[<device>] [--noflush] [--target <target_type>]", 0, -1, 1, _status},
@ -131,3 +148,5 @@
{"table", "[<device>] [--target <target_type>] [--showkeys]", 0, -1, 1, _status},
{"wait", "<device> [<event_nr>] [--noflush]", 0, 2, 0, _wait},
{"mknodes", "[<device>]", 0, -1, 1, _mknodes},
{"mangle", "[<device>]", 0, -1, 1, _mangle},
{"udevcreatecookie", "", 0, 0, 0, _udevcreatecookie},

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Nov 12 10:41:45 UTC 2012 - seife+obs@b1-systems.com
- fix 10-dm.rules (bnc#789021)
- port dmsetup export patch to new LVM code (bnc#789019,bnc#789020)
-------------------------------------------------------------------
Mon Nov 5 21:10:28 UTC 2012 - hrvoje.senjan@gmail.com

View File

@ -3,22 +3,32 @@
udev/13-dm-disk.rules.in | 9 ++++++---
2 files changed, 10 insertions(+), 3 deletions(-)
Index: LVM2.2.02.98/udev/10-dm.rules.in
===================================================================
--- LVM2.2.02.98.orig/udev/10-dm.rules.in
+++ LVM2.2.02.98/udev/10-dm.rules.in
@@ -90,6 +90,10 @@ TEST=="dm", ENV{DM_NAME}="$attr{dm/name}
@@ -88,10 +88,14 @@ ACTION=="add", ENV{DM_UDEV_RULES_VSN}!="
# is in between these releases.
TEST=="dm", ENV{DM_NAME}="$attr{dm/name}", ENV{DM_UUID}="$attr{dm/uuid}", ENV{DM_SUSPENDED}="$attr{dm/suspended}"
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}="$env{DM_SBIN_PATH}/dmsetup export -j %M -m %m"
+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.
ENV{DM_SUSPENDED}=="Active", ENV{DM_SUSPENDED}="0"
ENV{DM_SUSPENDED}=="Suspended", ENV{DM_SUSPENDED}="1"
Index: LVM2.2.02.98/udev/13-dm-disk.rules.in
===================================================================
--- LVM2.2.02.98.orig/udev/13-dm-disk.rules.in
+++ LVM2.2.02.98/udev/13-dm-disk.rules.in
@@ -14,13 +14,16 @@ ACTION!="add|change", GOTO="dm_end"
@@ -12,17 +12,20 @@
# "add" event is processed on coldplug only!
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"
@ -38,3 +48,5 @@
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}"
# Add inotify watch to track changes on this device.
# Using the watch rule is not optimal - it generates a lot of spurious