master - libdm: report: implement DM_REPORT_GROUP_SINGLE for a group containing single report only
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a9fe57db1c285e...
Commit: a9fe57db1c285ef7052a1054891f5eb7dbbb01b2
Parent: 9c8f912ea79d9b836c814b3d12cc331de634617e
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 16 11:23:56 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 10:42:18 2016 +0200
libdm: report: implement DM_REPORT_GROUP_SINGLE for a group containing single report only
There's no change in output for this report group type - with this type,
we only make sure there's always only one report in a group at a time,
not more.
---
WHATS_NEW_DM | 1 +
libdm/libdm-report.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index c16f0c1..fdae74b 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.128 -
=================================
+ Introduce DM_REPORT_GROUP_SINGLE for report group having single report only.
Add dm_report_group_{create,push,pop,destroy} to support report grouping.
Version 1.02.127 - 11th June 2016
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index ab87ba7..7ea5ebf 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -4485,6 +4485,11 @@ out:
return r;
}
+static int _report_group_create_single(struct dm_report_group *group)
+{
+ return 1;
+}
+
struct dm_report_group *dm_report_group_create(dm_report_group_type_t type, void *data)
{
struct dm_report_group *group;
@@ -4513,6 +4518,10 @@ struct dm_report_group *dm_report_group_create(dm_report_group_type_t type, void
dm_list_add_h(&group->items, &item->list);
switch (type) {
+ case DM_REPORT_GROUP_SINGLE:
+ if (!_report_group_create_single(group))
+ goto_bad;
+ break;
default:
goto_bad;
}
@@ -4523,6 +4532,25 @@ bad:
return NULL;
}
+static int _report_group_push_single(struct report_group_item *item, void *data)
+{
+ struct report_group_item *item_iter;
+ unsigned count = 0;
+
+ dm_list_iterate_items(item_iter, &item->group->items) {
+ if (item_iter->report)
+ count++;
+ }
+
+ if (count > 1) {
+ log_error("dm_report: unable to add more than one report "
+ "to current report group");
+ return 0;
+ }
+
+ return 1;
+}
+
int dm_report_group_push(struct dm_report_group *group, struct dm_report *report, void *data)
{
struct report_group_item *item, *tmp_item;
@@ -4552,6 +4580,10 @@ int dm_report_group_push(struct dm_report_group *group, struct dm_report *report
dm_list_add_h(&group->items, &item->list);
switch (group->type) {
+ case DM_REPORT_GROUP_SINGLE:
+ if (!_report_group_push_single(item, data))
+ goto_bad;
+ break;
default:
goto_bad;
}
@@ -4563,6 +4595,11 @@ bad:
return 0;
}
+static int _report_group_pop_single(struct report_group_item *item)
+{
+ return 1;
+}
+
int dm_report_group_pop(struct dm_report_group *group)
{
struct report_group_item *item;
@@ -4576,6 +4613,10 @@ int dm_report_group_pop(struct dm_report_group *group)
}
switch (group->type) {
+ case DM_REPORT_GROUP_SINGLE:
+ if (!_report_group_pop_single(item))
+ return_0;
+ break;
default:
return 0;
}
@@ -4594,6 +4635,11 @@ int dm_report_group_pop(struct dm_report_group *group)
return 1;
}
+static int _report_group_destroy_single(void)
+{
+ return 1;
+}
+
int dm_report_group_destroy(struct dm_report_group *group)
{
struct report_group_item *item, *tmp_item;
@@ -4610,6 +4656,10 @@ int dm_report_group_destroy(struct dm_report_group *group)
}
switch (group->type) {
+ case DM_REPORT_GROUP_SINGLE:
+ if (!_report_group_destroy_single())
+ goto_out;
+ break;
default:
goto_out;
}
7 years, 10 months
master - libdm: report: introduce dm_report_group
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9c8f912ea79d9b...
Commit: 9c8f912ea79d9b836c814b3d12cc331de634617e
Parent: 029f51e1a853297ca7246b75ac80cde9de23a2a4
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Mon May 2 14:21:05 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Mon Jun 20 09:26:51 2016 +0200
libdm: report: introduce dm_report_group
This patch introduces DM report group (represented by dm_report_group
structure) that is used to group several reports to make a whole. As a
whole, all the reports in the group follow the same settings and/or
formatting used on output and it controls that the output is properly
ordered (e.g. the output from different reports is not interleaved
which would break readability and/or syntax of target output format
used for the whole group).
To support this feature, there are 4 new functions:
- dm_report_group_create
- dm_report_group_push
- dm_report_group_pop
- dm_report_group_destroy
>From the naming used (dm_report_group_push/pop), it's clear the reports
are pushed onto a stack. The rule then is that only the report on top
of the stack can be reported (that means calling dm_report_output).
This way we make sure that the output is not interleaved and provides
determinism and control over the output.
Different formats may allow or disallow some of the existing report
flags controlling output itself (DM_REPORT_OUTPUT_*) to be set or not so
once the report is pushed to a group, the grouping code makes sure that
all the reports have compatible flags set and then these flags are
restored once each report is popped from the report group stack.
We also allow to push/pop non-report item in which case such an item
creates a structure (e.g. to put several reports together with any
opening and/or closing lines needed on output which pose as extra
formatting structure besides formatting the reports).
The dm_report_group_push function accepts an argument to pass any
format-specific data needed (e.g. handle, name, structures passed
along while working with reports...).
We can call dm_report_output directly anytime we need (with the only
restriction that we can call dm_report_output only for the report that
is currently on top of the group's stack). Or we don't need to call
dm_report_output explicitly in which case all the reports in a stack are
reported on output automatically once we call dm_report_group_destroy.
---
WHATS_NEW_DM | 1 +
libdm/.exported_symbols.DM_1_02_128 | 4 +
libdm/libdevmapper.h | 14 +++
libdm/libdm-report.c | 188 ++++++++++++++++++++++++++++++++++-
4 files changed, 203 insertions(+), 4 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 6fb1745..c16f0c1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.128 -
=================================
+ Add dm_report_group_{create,push,pop,destroy} to support report grouping.
Version 1.02.127 - 11th June 2016
=================================
diff --git a/libdm/.exported_symbols.DM_1_02_128 b/libdm/.exported_symbols.DM_1_02_128
new file mode 100644
index 0000000..6e365d5
--- /dev/null
+++ b/libdm/.exported_symbols.DM_1_02_128
@@ -0,0 +1,4 @@
+dm_report_group_create
+dm_report_group_push
+dm_report_group_pop
+dm_report_group_destroy
diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h
index d2f40c9..c99ebe8 100644
--- a/libdm/libdevmapper.h
+++ b/libdm/libdevmapper.h
@@ -2704,6 +2704,20 @@ void dm_report_field_set_value(struct dm_report_field *field, const void *value,
const void *sortvalue);
/*
+ * Report group support.
+ */
+struct dm_report_group;
+
+typedef enum {
+ DM_REPORT_GROUP_SINGLE,
+} dm_report_group_type_t;
+
+struct dm_report_group *dm_report_group_create(dm_report_group_type_t type, void *data);
+int dm_report_group_push(struct dm_report_group *group, struct dm_report *report, void *data);
+int dm_report_group_pop(struct dm_report_group *group);
+int dm_report_group_destroy(struct dm_report_group *group);
+
+/*
* Stats counter access methods
*
* Each method returns the corresponding stats counter value from the
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c
index 3896b3c..ab87ba7 100644
--- a/libdm/libdm-report.c
+++ b/libdm/libdm-report.c
@@ -32,6 +32,8 @@ struct selection {
struct selection_node *selection_root;
};
+struct report_group_item;
+
struct dm_report {
struct dm_pool *mem;
@@ -71,6 +73,29 @@ struct dm_report {
/* Null-terminated array of reserved values */
const struct dm_report_reserved_value *reserved_values;
struct dm_hash_table *value_cache;
+
+ struct report_group_item *group_item;
+};
+
+struct dm_report_group {
+ dm_report_group_type_t type;
+ struct dm_pool *mem;
+ struct dm_list items;
+ int indent;
+};
+
+struct report_group_item {
+ struct dm_list list;
+ struct dm_report_group *group;
+ struct dm_report *report;
+ union {
+ uint32_t orig_report_flags;
+ uint32_t finished_count;
+ } store;
+ struct report_group_item *parent;
+ int output_done:1;
+ int needs_closing:1;
+ void *data;
};
/*
@@ -4426,16 +4451,171 @@ int dm_report_is_empty(struct dm_report *rh)
return dm_list_empty(&rh->rows) ? 1 : 0;
}
+static struct report_group_item *_get_topmost_report_group_item(struct dm_report_group *group)
+{
+ struct report_group_item *item;
+
+ if (group && !dm_list_empty(&group->items))
+ item = dm_list_item(dm_list_first(&group->items), struct report_group_item);
+ else
+ item = NULL;
+
+ return item;
+}
+
int dm_report_output(struct dm_report *rh)
{
- if (dm_list_empty(&rh->rows))
- return 1;
+ int r;
+
+ if (dm_list_empty(&rh->rows)) {
+ r = 1;
+ goto out;
+ }
if ((rh->flags & RH_SORT_REQUIRED))
_sort_rows(rh);
if ((rh->flags & DM_REPORT_OUTPUT_COLUMNS_AS_ROWS))
- return _output_as_rows(rh);
+ r = _output_as_rows(rh);
else
- return _output_as_columns(rh);
+ r = _output_as_columns(rh);
+out:
+ if (r && rh && rh->group_item)
+ rh->group_item->output_done = 1;
+ return r;
+}
+
+struct dm_report_group *dm_report_group_create(dm_report_group_type_t type, void *data)
+{
+ struct dm_report_group *group;
+ struct dm_pool *mem;
+ struct report_group_item *item;
+
+ if (!(mem = dm_pool_create("report_group", 1024))) {
+ log_error("dm_report: dm_report_init_group: failed to allocate mem pool");
+ return NULL;
+ }
+
+ if (!(group = dm_pool_zalloc(mem, sizeof(*group)))) {
+ log_error("dm_report: failed to allocate report group structure");
+ goto bad;
+ }
+
+ group->mem = mem;
+ group->type = type;
+ dm_list_init(&group->items);
+
+ if (!(item = dm_pool_zalloc(mem, sizeof(*item)))) {
+ log_error("dm_report: faile to allocate root report group item");
+ goto bad;
+ }
+
+ dm_list_add_h(&group->items, &item->list);
+
+ switch (type) {
+ default:
+ goto_bad;
+ }
+
+ return group;
+bad:
+ dm_pool_destroy(mem);
+ return NULL;
+}
+
+int dm_report_group_push(struct dm_report_group *group, struct dm_report *report, void *data)
+{
+ struct report_group_item *item, *tmp_item;
+
+ if (!group)
+ return 1;
+
+ if (!(item = dm_pool_zalloc(group->mem, sizeof(*item)))) {
+ log_error("dm_report: dm_report_group_push: group item allocation failed");
+ return 0;
+ }
+
+ if ((item->report = report)) {
+ item->store.orig_report_flags = report->flags;
+ report->group_item = item;
+ }
+ item->group = group;
+ item->data = data;
+
+ dm_list_iterate_items(tmp_item, &group->items) {
+ if (!tmp_item->report) {
+ item->parent = tmp_item;
+ break;
+ }
+ }
+
+ dm_list_add_h(&group->items, &item->list);
+
+ switch (group->type) {
+ default:
+ goto_bad;
+ }
+
+ return 1;
+bad:
+ dm_list_del(&item->list);
+ dm_pool_free(group->mem, item);
+ return 0;
+}
+
+int dm_report_group_pop(struct dm_report_group *group)
+{
+ struct report_group_item *item;
+
+ if (!group)
+ return 1;
+
+ if (!(item = _get_topmost_report_group_item(group))) {
+ log_error("dm_report: dm_report_group_pop: group has no items");
+ return 0;
+ }
+
+ switch (group->type) {
+ default:
+ return 0;
+ }
+
+ dm_list_del(&item->list);
+
+ if (item->report) {
+ item->report->flags = item->store.orig_report_flags;
+ item->report->group_item = NULL;
+ }
+
+ if (item->parent)
+ item->parent->store.finished_count++;
+
+ dm_pool_free(group->mem, item);
+ return 1;
+}
+
+int dm_report_group_destroy(struct dm_report_group *group)
+{
+ struct report_group_item *item, *tmp_item;
+ int r = 0;
+
+ if (!group)
+ return 1;
+
+ dm_list_iterate_items_safe(item, tmp_item, &group->items) {
+ if (item->report && !dm_report_output(item->report))
+ goto_out;
+ if (!dm_report_group_pop(group))
+ goto_out;
+ }
+
+ switch (group->type) {
+ default:
+ goto_out;
+ }
+
+ r = 1;
+out:
+ dm_pool_destroy(group->mem);
+ return r;
}
7 years, 10 months
master - vgreduce: fix location of lvmlockd global lock
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=029f51e1a85329...
Commit: 029f51e1a853297ca7246b75ac80cde9de23a2a4
Parent: 899a4ca275543425ca60fe361bc13fbc5c90e741
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 17 12:10:43 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 17 12:22:58 2016 -0500
vgreduce: fix location of lvmlockd global lock
The lvmlockd global lock was missing the non-repair case,
which caused the new orphan PV created by vgreduce to
not be seen by other hosts.
---
tools/vgreduce.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/tools/vgreduce.c b/tools/vgreduce.c
index 19a0bb0..3176a0e 100644
--- a/tools/vgreduce.c
+++ b/tools/vgreduce.c
@@ -217,6 +217,11 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
argv++;
argc--;
+ /* Needed to change the set of orphan PVs. */
+ if (!lockd_gl(cmd, "ex", 0))
+ return_ECMD_FAILED;
+ cmd->lockd_gl_disable = 1;
+
if (!(handle = init_processing_handle(cmd))) {
log_error("Failed to initialize processing handle.");
return ECMD_FAILED;
@@ -236,13 +241,6 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
vp.force = arg_count(cmd, force_ARG);
- /* Needed to change the set of orphan PVs. */
- if (!lockd_gl(cmd, "ex", 0)) {
- ret = ECMD_FAILED;
- goto_out;
- }
- cmd->lockd_gl_disable = 1;
-
cmd->handles_missing_pvs = 1;
init_ignore_suspended_devices(1);
7 years, 10 months
master - lvmlockd: fix dropping PVs in rescanning VG
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=899a4ca2755434...
Commit: 899a4ca275543425ca60fe361bc13fbc5c90e741
Parent: ab7ade40957812b948a63527d1023747f8336e56
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Jun 17 11:45:08 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Jun 17 12:21:09 2016 -0500
lvmlockd: fix dropping PVs in rescanning VG
This fixes a problem in commit ae0a8740c. The problem
in that commit was that all existing PVs are initially
dropped from lvmetad. This works if the VG is updated
at the end, which replaces the dropped PVs, but if the
rescan finds that the VG seqno is unchanged, it leaves
the cached VG in place. So, we should only drop the
existing PVs in lvmetad when the VG is going to be updated.
---
lib/cache/lvmetad.c | 48 ++++++++++++++++++++++++++++++------------------
1 files changed, 30 insertions(+), 18 deletions(-)
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index 0f1f269..0508291 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1675,8 +1675,9 @@ static struct volume_group *lvmetad_pvscan_vg(struct cmd_context *cmd, struct vo
struct dm_config_tree *vgmeta_ret = NULL;
struct dm_config_tree *vgmeta;
struct pv_list *pvl, *pvl_new;
- struct device_list *devl, *devl_new;
+ struct device_list *devl, *devl_new, *devlsafe;
struct dm_list pvs_scan;
+ struct dm_list pvs_drop;
struct dm_list pvs_new;
struct lvmcache_info *info;
struct format_instance *fid;
@@ -1689,6 +1690,7 @@ static struct volume_group *lvmetad_pvscan_vg(struct cmd_context *cmd, struct vo
int found;
dm_list_init(&pvs_scan);
+ dm_list_init(&pvs_drop);
dm_list_init(&pvs_new);
log_debug_lvmetad("Rescanning VG %s (seqno %u).", vg->name, vg->seqno);
@@ -1713,23 +1715,12 @@ static struct volume_group *lvmetad_pvscan_vg(struct cmd_context *cmd, struct vo
dm_list_add(&pvs_scan, &devl->list);
}
- /*
- * Drop stale info from lvmetad.
- */
- dm_list_iterate_items(devl, &pvs_scan) {
- if (!devl->dev)
- continue;
- log_debug_lvmetad("Rescan VG %s dropping %s.", vg->name, dev_name(devl->dev));
- if (!lvmetad_pv_gone_by_dev(devl->dev))
- return_NULL;
- }
-
scan_more:
/*
* Run the equivalent of lvmetad_pvscan_single on each dev in the VG.
*/
- dm_list_iterate_items(devl, &pvs_scan) {
+ dm_list_iterate_items_safe(devl, devlsafe, &pvs_scan) {
if (!devl->dev)
continue;
@@ -1742,6 +1733,7 @@ scan_more:
if ((info = lvmcache_info_from_pvid(devl->dev->pvid, NULL, 0)))
lvmcache_del(info);
+ dm_list_move(&pvs_drop, &devl->list);
continue;
}
@@ -1755,6 +1747,7 @@ scan_more:
if (baton.fid->fmt->features & FMT_OBSOLETE) {
log_debug_lvmetad("Ignoring obsolete format on PV %s in VG %s.", dev_name(devl->dev), vg->name);
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
+ dm_list_move(&pvs_drop, &devl->list);
continue;
}
@@ -1770,8 +1763,7 @@ scan_more:
if (!baton.vg) {
log_debug_lvmetad("Rescan VG %s did not find %s.", vg->name, dev_name(devl->dev));
lvmcache_fmt(info)->ops->destroy_instance(baton.fid);
- lvmetad_pv_found(cmd, (const struct id *) &devl->dev->pvid, devl->dev,
- lvmcache_fmt(info), label->sector, NULL, NULL, NULL);
+ dm_list_move(&pvs_drop, &devl->list);
continue;
}
@@ -1783,8 +1775,7 @@ scan_more:
log_debug_lvmetad("Rescan VG %s found different VG %s on PV %s.",
vg->name, baton.vg->name, dev_name(devl->dev));
release_vg(baton.vg);
- lvmetad_pv_found(cmd, (const struct id *) &devl->dev->pvid, devl->dev,
- lvmcache_fmt(info), label->sector, NULL, NULL, NULL);
+ dm_list_move(&pvs_drop, &devl->list);
continue;
}
@@ -1873,9 +1864,19 @@ scan_more:
}
/*
- * Change the metadata into a vg struct to return.
+ * Remove pvs_drop entries from lvmetad.
*/
+ dm_list_iterate_items(devl, &pvs_drop) {
+ if (!devl->dev)
+ continue;
+ log_debug_lvmetad("Rescan VG %s dropping %s.", vg->name, dev_name(devl->dev));
+ if (!lvmetad_pv_gone_by_dev(devl->dev))
+ return_NULL;
+ }
+ /*
+ * Update the VG in lvmetad.
+ */
if (vgmeta_ret) {
fid = lvmcache_fmt(info)->ops->create_instance(lvmcache_fmt(info), &fic);
if (!(vg_ret = import_vg_from_config_tree(vgmeta_ret, fid))) {
@@ -1889,10 +1890,21 @@ scan_more:
* The "precommitted" name is a misnomer in this case,
* but that is the field which lvmetad_vg_update() uses
* to send the metadata cft to lvmetad.
+ *
+ * When the seqno is unchanged the cached VG can be left.
*/
if (save_seqno != vg->seqno) {
+ dm_list_iterate_items(devl, &pvs_scan) {
+ if (!devl->dev)
+ continue;
+ log_debug_lvmetad("Rescan VG %s dropping to replace %s.", vg->name, dev_name(devl->dev));
+ if (!lvmetad_pv_gone_by_dev(devl->dev))
+ return_NULL;
+ }
+
log_debug_lvmetad("Rescan VG %s updating lvmetad from seqno %u to seqno %u.",
vg->name, vg->seqno, save_seqno);
+
vg_ret->cft_precommitted = vgmeta_ret;
if (!lvmetad_vg_update(vg_ret))
log_error("Failed to update lvmetad with new VG meta");
7 years, 10 months
v2_02_157 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3fbdd8be03f229...
Commit: 3fbdd8be03f229121b6c2245721617a26b152618
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-06-17 13:12 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-06-17 13:12 +0000
annotated tag: v2_02_157 has been created
at 3fbdd8be03f229121b6c2245721617a26b152618 (tag)
tagging 38cc03605ceff43a8a7733b72ed9da94f9598e00 (commit)
replaces v2_02_156
Release 2.02.157.
Just one change this week, so the boot isn't broken
if lvmetad is expected to be running but isn't
available.
7 files changed, 184 insertions(+), 36 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAldj918ACgkQIoGRwVZ+LBf5UACff1NWccZca44LPgtcUq0dhtTt
3Z0An0yzTCL/o00tnL4wEg+OfiGBdwWJ
=/2Yg
-----END PGP SIGNATURE-----
Alasdair G Kergon (2):
post-release
pre-release
David Teigland (4):
lvmlockd: fix rescanning VG
pvscan: do activation when lvmetad is not running
pvscan: fix lvmlockd global lock
pvscan: don't activate LVs when use_lvmetad=0
Peter Rajnoha (1):
tools: add missing destroy_processing_handle in pvscan and vgreduce code
7 years, 10 months
master - post-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=ab7ade40957812...
Commit: ab7ade40957812b948a63527d1023747f8336e56
Parent: 38cc03605ceff43a8a7733b72ed9da94f9598e00
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jun 17 13:57:33 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jun 17 14:10:20 2016 +0100
post-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 +++
WHATS_NEW_DM | 3 +++
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/VERSION b/VERSION
index e066ad7..34e00b1 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.157(2)-git (2016-06-17)
+2.02.158(2)-git (2016-06-17)
diff --git a/VERSION_DM b/VERSION_DM
index 82641c6..dd57819 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.127-git (2016-06-17)
+1.02.128-git (2016-06-17)
diff --git a/WHATS_NEW b/WHATS_NEW
index 4880a0e..c91e28d 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,6 @@
+Version 2.02.158 -
+=================================
+
Version 2.02.157 - 17th June 2016
=================================
Change pvscan --cache -aay to scan locally if lvmetad fails.
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index 1135a62..6fb1745 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,3 +1,6 @@
+Version 1.02.128 -
+=================================
+
Version 1.02.127 - 11th June 2016
=================================
Fix blkdeactivate regression causing skipping of dm + md devices. (1.02.126)
7 years, 10 months
master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=38cc03605ceff4...
Commit: 38cc03605ceff43a8a7733b72ed9da94f9598e00
Parent: a23655ab3bea4dfe9409c8c6b238787da9b457e1
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Fri Jun 17 13:48:39 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Fri Jun 17 14:10:20 2016 +0100
pre-release
---
VERSION | 2 +-
VERSION_DM | 2 +-
WHATS_NEW | 3 ++-
WHATS_NEW_DM | 3 ---
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/VERSION b/VERSION
index a7628a4..e066ad7 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.02.157(2)-git (2016-06-11)
+2.02.157(2)-git (2016-06-17)
diff --git a/VERSION_DM b/VERSION_DM
index a1416c0..82641c6 100644
--- a/VERSION_DM
+++ b/VERSION_DM
@@ -1 +1 @@
-1.02.128-git (2016-06-11)
+1.02.127-git (2016-06-17)
diff --git a/WHATS_NEW b/WHATS_NEW
index 61b58b4..4880a0e 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
-Version 2.02.157 -
+Version 2.02.157 - 17th June 2016
=================================
+ Change pvscan --cache -aay to scan locally if lvmetad fails.
Version 2.02.156 - 11th June 2016
=================================
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index bd17f1b..1135a62 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,6 +1,3 @@
-Version 1.02.128 -
-=================================
-
Version 1.02.127 - 11th June 2016
=================================
Fix blkdeactivate regression causing skipping of dm + md devices. (1.02.126)
7 years, 10 months
master - tools: add missing destroy_processing_handle in pvscan and vgreduce code
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a23655ab3bea4d...
Commit: a23655ab3bea4dfe9409c8c6b238787da9b457e1
Parent: f77fe436afb76ddb798d236d34daf50413a184f6
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jun 17 13:29:33 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jun 17 13:29:33 2016 +0200
tools: add missing destroy_processing_handle in pvscan and vgreduce code
---
tools/pvscan.c | 1 +
tools/vgreduce.c | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 73a97be..9b50374 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -655,6 +655,7 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv)
out:
unlock_vg(cmd, VG_GLOBAL);
+ destroy_processing_handle(cmd, handle);
return ret;
}
diff --git a/tools/vgreduce.c b/tools/vgreduce.c
index a10e12c..19a0bb0 100644
--- a/tools/vgreduce.c
+++ b/tools/vgreduce.c
@@ -237,8 +237,10 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
vp.force = arg_count(cmd, force_ARG);
/* Needed to change the set of orphan PVs. */
- if (!lockd_gl(cmd, "ex", 0))
- return_ECMD_FAILED;
+ if (!lockd_gl(cmd, "ex", 0)) {
+ ret = ECMD_FAILED;
+ goto_out;
+ }
cmd->lockd_gl_disable = 1;
cmd->handles_missing_pvs = 1;
@@ -259,6 +261,7 @@ int vgreduce(struct cmd_context *cmd, int argc, char **argv)
ret = ECMD_FAILED;
out:
init_ignore_suspended_devices(saved_ignore_suspended_devices);
+ destroy_processing_handle(cmd, handle);
return ret;
}
7 years, 10 months
master - pvscan: don't activate LVs when use_lvmetad=0
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f77fe436afb76d...
Commit: f77fe436afb76ddb798d236d34daf50413a184f6
Parent: 944ae4d2df0f15afb29ac0a68d0dd012d9df9acf
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Jun 16 12:04:05 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Jun 16 12:04:05 2016 -0500
pvscan: don't activate LVs when use_lvmetad=0
commit 15da467b was meant to address the case where
use_lvmetad=1 in lvm.conf, and lvmetad is not available,
in which case, pvscan --cache -aay should activate LVs.
But the commit unintentionally also changed the case
where use_lvmetad=0 in lvm.conf, in which case
pvscan --cache -aay should not activate LVs, so fix
that here.
---
tools/pvscan.c | 31 ++++++++++++++++++++-----------
1 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 78dad82..73a97be 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -306,7 +306,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
int devno_args = 0;
struct arg_value_group_list *current_group;
dev_t devno;
- int do_activate = 0;
+ int do_activate;
int all_vgs = 0;
int remove_errors = 0;
int add_errors = 0;
@@ -315,17 +315,21 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
dm_list_init(&found_vgnames);
dm_list_init(&pp.changed_vgnames);
- if (!lvmetad_used() && !arg_is_set(cmd, activate_ARG)) {
- log_verbose("Ignoring pvscan --cache command because lvmetad is not in use.");
+ do_activate = arg_is_set(cmd, activate_ARG);
+
+ if (!lvmetad_used() && !do_activate) {
+ log_verbose("Ignoring pvscan --cache because lvmetad is not in use.");
return ret;
}
- if (arg_is_set(cmd, activate_ARG)) {
- if (arg_uint_value(cmd, activate_ARG, CHANGE_AAY) != CHANGE_AAY) {
- log_error("Only --activate ay allowed with pvscan.");
- return 0;
- }
- do_activate = 1;
+ if (do_activate && (arg_uint_value(cmd, activate_ARG, CHANGE_AAY) != CHANGE_AAY)) {
+ log_error("Only --activate ay allowed with pvscan.");
+ return 0;
+ }
+
+ if (!lvmetad_used() && do_activate && !find_config_tree_bool(cmd, global_use_lvmetad_CFG, NULL)) {
+ log_verbose("Ignoring pvscan --cache -aay because lvmetad is not in use.");
+ return ret;
}
if (arg_count(cmd, major_ARG) + arg_count(cmd, minor_ARG))
@@ -341,8 +345,13 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
- if (!lvmetad_used() && do_activate) {
- log_verbose("Activating all VGs without lvmetad running.");
+ /*
+ * This a special case where use_lvmetad=1 in lvm.conf but pvscan
+ * cannot use lvmetad for some reason. In this case pvscan should
+ * still activate LVs even though it's not updating the cache.
+ */
+ if (do_activate && !lvmetad_used()) {
+ log_verbose("Activating all VGs without lvmetad.");
all_vgs = 1;
devno_args = 0;
goto activate;
7 years, 10 months
master - pvscan: fix lvmlockd global lock
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=944ae4d2df0f15...
Commit: 944ae4d2df0f15afb29ac0a68d0dd012d9df9acf
Parent: 15da467b52465076a8d587b94cc638bab8a0a95c
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Jun 15 16:51:36 2016 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Jun 15 16:51:36 2016 -0500
pvscan: fix lvmlockd global lock
This should have been removed when pvscan was
recently converted to use process_each_pv which
does the lvmlockd locking.
---
tools/pvscan.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 5987e8b..78dad82 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -624,10 +624,6 @@ int pvscan(struct cmd_context *cmd, int argc, char **argv)
return ECMD_FAILED;
}
- /* Needed for a current listing of the global VG namespace. */
- if (!lockd_gl(cmd, "sh", 0))
- return_ECMD_FAILED;
-
if (!(handle = init_processing_handle(cmd))) {
log_error("Failed to initialize processing handle.");
ret = ECMD_FAILED;
7 years, 10 months