Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fe30658a4d5fe4e4…
Commit: fe30658a4d5fe4e4e6bb346c9c9ee7142a98f49d
Parent: c26d81d6e6939906729d91fae83cd8bbdd743bb7
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Mon Apr 13 16:29:15 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Mon Apr 13 20:52:32 2015 +0200
toollib: close connection to lvmetad after fork
sharing connection between parent command and background
processes spawned from parent could lead to occasional failures
due to unexpected corruption in daemon responses sent to either child
or a parent.
lvmetad issued warning about duplicate config values in request.
LVM commands occasionaly failed w/ internal error after receving
corrupted response.
lvmetad connection is renewed when needed after explicit disconnect
in child
---
tools/toollib.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/tools/toollib.c b/tools/toollib.c
index 4856f02..26810b2 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -97,6 +97,8 @@ int become_daemon(struct cmd_context *cmd, int skip_lvm)
strncpy(*cmd->argv, "(lvm2)", strlen(*cmd->argv));
+ lvmetad_disconnect();
+
if (!skip_lvm) {
reset_locking();
lvmcache_destroy(cmd, 1, 1);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c26d81d6e6939906…
Commit: c26d81d6e6939906729d91fae83cd8bbdd743bb7
Parent: 59c417379e067f85cd962c2024f7a042f04a41fd
Author: Ondrej Kozina <okozina(a)redhat.com>
AuthorDate: Wed Apr 8 12:05:14 2015 +0200
Committer: Ondrej Kozina <okozina(a)redhat.com>
CommitterDate: Mon Apr 13 20:52:22 2015 +0200
toollib: do not spawn polling in lv_change_activate
spawning a background polling from within the lv_change_activate
fn went to two problems:
1) vgchange should not spawn any background polling until after
the whole activation process for a VG is finished. Otherwise
it could lead to a duplicite request for spawning background
polling. This statement was alredy true with one exception of
mirror up-conversion polling (fixed by this commit).
2) due to current conditions in lv_change_activate lvchange cmd
couldn't start background polling for pvmove LVs if such LV was
about to get activated by the command in the same time.
This commit however doesn't alter the lvchange cmd so that it works same as
vgchange with regard to not to spawn duplicate background pollings per
unique LV.
---
tools/lvchange.c | 13 +++++++++++++
tools/toollib.c | 5 -----
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index 096aae4..e790ea0 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -212,6 +212,19 @@ static int _lvchange_activate(struct cmd_context *cmd, struct logical_volume *lv
if (!lv_change_activate(cmd, lv, activate))
return_0;
+ /*
+ * FIXME: lvchange should defer background polling in a similar
+ * way as vgchange does. First activate all relevant LVs
+ * initate background polling later (for all actually
+ * activated LVs). So we can avoid duplicate background
+ * polling for pvmove (2 or more locked LVs on single pvmove
+ * LV)
+ */
+ if (background_polling() && is_change_activating(activate) &&
+ (lv_is_pvmove(lv) || lv_is_locked(lv) || lv_is_converting(lv) ||
+ lv_is_merging(lv)))
+ lv_spawn_background_polling(cmd, lv);
+
return 1;
}
diff --git a/tools/toollib.c b/tools/toollib.c
index 142ff33..4856f02 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -843,11 +843,6 @@ int lv_change_activate(struct cmd_context *cmd, struct logical_volume *lv,
if (!lv_active_change(cmd, lv, activate, 0))
return_0;
- if (background_polling() &&
- is_change_activating(activate) &&
- (lv_is_pvmove(lv) || lv_is_converting(lv) || lv_is_merging(lv)))
- lv_spawn_background_polling(cmd, lv);
-
return r;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=29220a181ac3ad0f…
Commit: 29220a181ac3ad0faf63681e465f0a9ba9e625dd
Parent: e4261ba03784f122759670cc2022a2dcb5f5a3ef
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Apr 13 13:39:30 2015 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Apr 13 13:40:11 2015 -0500
config: update descriptions
- filter, preferred_names
---
lib/config/config_settings.h | 41 ++++++++++++++++++++++++-----------------
1 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index ecdf368..84c81c6 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -159,10 +159,11 @@ cfg(devices_external_device_info_source_CFG, "external_device_info_source", devi
"only if LVM is compiled with udev support.\n")
cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 2, 19),
- "If several entries in the scanned directories correspond to the\n"
- "same block device and the tools need to display a name for the device,\n"
- "all the path names are matched against each item in this list of\n"
- "regular expressions. The first match is used.\n"
+ "Select which path name to display for a block device.\n"
+ "If multiple path names exist for a block device,\n"
+ "and LVM needs to display a name for the device,\n"
+ "the path names are matched against each item in\n"
+ "this list of regular expressions. The first match is used.\n"
"Try to avoid using undescriptive /dev/dm-N names, if present.\n"
"If no preferred name matches, or if preferred_names are not\n"
"defined, built-in rules are used until one produces a preference.\n"
@@ -175,33 +176,39 @@ cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, C
"preferred_names = [ \"^/dev/mpath/\", \"^/dev/mapper/mpath\", \"^/dev/[hs]d\" ]\n")
cfg_array(devices_filter_CFG, "filter", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(1, 0, 0),
- "Patterns used to accept or reject devices found by a scan.\n"
- "Patterns are regular expressions delimited by any character\n"
- "and preceded by 'a' for accept or 'r' for reject.\n"
- "The list is traversed in order, and the first regex that matches\n"
- "determines if the device is accepted or rejected (ignored).\n"
- "Devices that don't match any patterns are accepted.\n"
- "If there are several names for the same device, e.g. from symlinks,\n"
- "the first pattern matching any of the names determines if the\n"
- "device is accepted or rejected (depending on whether the first\n"
- "matching pattern is 'a' or 'r'.)\n"
+ "Limit the block devices that are used by LVM.\n"
+ "This is a list of regular expressions used to accept or\n"
+ "reject block device path names. Each regex is delimited\n"
+ "by a vertical bar '|' (or any character) and is preceded\n"
+ "by 'a' to accept the path, or by 'r' to reject the path.\n"
+ "The first regex in the list to match the path is used,\n"
+ "producing the 'a' or 'r' result for the device.\n"
+ "When multiple path names exist for a block device, if any\n"
+ "path name matches an 'a' pattern before an 'r' pattern,\n"
+ "then the device is accepted. If all the path names match\n"
+ "an 'r' pattern first, then the device is rejected.\n"
+ "Unmatching path names do not affect the accept or reject\n"
+ "decision. If no path names for a device match a pattern,\n"
+ "then the device is accepted.\n"
+ "Be careful mixing 'a' and 'r' patterns, as the combination\n"
+ "might produce unexpected results (test any changes.)\n"
"Run vgscan after changing the filter to regenerate the cache.\n"
"See the use_lvmetad comment for a special case regarding filters.\n"
"Example:\n"
"Accept every block device.\n"
- "filter = [ \"a/.*/\" ]\n"
+ "filter = [ \"a|.*/|" ]\n"
"Example:\n"
"Reject the cdrom drive.\n"
"filter = [ \"r|/dev/cdrom|\" ]\n"
"Example:\n"
"Work with just loopback devices, e.g. for testing.\n"
- "filter = [ \"a/loop/\", \"r/.*/\" ]\n"
+ "filter = [ \"a|loop|\", \"r|.*|\" ]\n"
"Example:\n"
"Accept all loop devices and ide drives except hdc.\n"
"filter =[ \"a|loop|\", \"r|/dev/hdc|\", \"a|/dev/ide|\", \"r|.*|\" ]\n"
"Example:\n"
"Use anchors to be very specific.\n"
- "filter = [ \"a|^/dev/hda8$|\", \"r/.*/\" ]\n")
+ "filter = [ \"a|^/dev/hda8$|\", \"r|.*/|" ]\n")
cfg_array(devices_global_filter_CFG, "global_filter", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 98),
"Since filter is often overridden from the command line,\n"