Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=2f4c2a43d49d90875ea31…
Commit: 2f4c2a43d49d90875ea31b1507cd0dfcdb049e88
Parent: b76c6951aa5c41b19fc34342ea2e946d7e0a3d24
Author: Marian Csontos <mcsontos(a)redhat.com>
AuthorDate: Tue Dec 12 12:14:15 2017 +0100
Committer: Marian Csontos <mcsontos(a)redhat.com>
CommitterDate: Tue Dec 12 13:17:07 2017 +0100
test: lvmdbusd is used for process name
lvmdbusd was started, but the process was not recognized by pgrep.
- configure does not make the script executable - set the flag
explicitly when running make check,
- process name changed to lvmdbusd. The previous python3 value
originated from the use of /usr/bin/env.
---
test/lib/aux.sh | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index de63167..a436f84 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -318,7 +318,7 @@ prepare_lvmdbusd() {
# FIXME: This is not correct! Daemon is auto started.
echo -n "## checking lvmdbusd is NOT running..."
- if pgrep -f -l lvmdbusd | grep python3 ; then
+ if pgrep -f -l lvmdbusd | grep python3 || pgrep -x -l lvmdbusd ; then
skip "Cannot run lvmdbusd while existing lvmdbusd process exists"
fi
echo ok
@@ -327,6 +327,10 @@ prepare_lvmdbusd() {
if test -z "${installed_testsuite+varset}"; then
# NOTE: this is always present - additional checks are needed:
daemon="$abs_top_builddir/daemons/lvmdbusd/lvmdbusd"
+ if ! test -x "$daemon" && chmod ugo+x "$daemon"; then
+ echo "Failed to make '$daemon' executable">&2
+ return 1
+ fi
# Setup the python path so we can run
export PYTHONPATH="$abs_top_builddir/daemons"
else
@@ -351,12 +355,9 @@ prepare_lvmdbusd() {
sleep 1
echo -n "## checking lvmdbusd IS running..."
- if ! pgrep -f -l lvmdbusd | grep python3; then
- echo "Failed to start lvmdbusd daemon"
- return 1
- fi
+ comm=
# TODO: Is there a better check than wait 1 second and check pid?
- if ! ps -p $pid -o comm= >/dev/null || [[ $(ps -p $pid -o comm=) != python3 ]]; then
+ if ! comm=$(ps -p $pid -o comm=) >/dev/null || [[ $comm != lvmdbusd ]]; then
echo "Failed to start lvmdbusd daemon"
return 1
fi
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=053d35de473aafe641f59…
Commit: 053d35de473aafe641f595b1182626ea39fc0ab0
Parent: 2db67a8ea09a6f1073583e135bfb7b66228d3526
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Mon Dec 11 17:14:38 2017 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Mon Dec 11 17:14:38 2017 +0000
format_text: Use absolute alignment to calculate metadata usage
Currently both start and offset should always be divisible by alignment,
so this should have no effect, but a later patch will increase alignment
so these variables can no longer be optimised out.
---
lib/format_text/format-text.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 881fd4d..c226131 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -1292,7 +1292,7 @@ int vgname_from_mda(const struct format_type *fmt,
(char *)&vgsummary->vgid);
if (mda_free_sectors) {
- current_usage = ALIGN_ABSOLUTE(rlocn->size, 0, MDA_ORIGINAL_ALIGNMENT);
+ current_usage = ALIGN_ABSOLUTE(rlocn->size, dev_area->start + rlocn->offset, MDA_ORIGINAL_ALIGNMENT);
buffer_size = mdah->size - MDA_HEADER_SIZE;
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=82ae02bc6a6788aabb10a…
Commit: 82ae02bc6a6788aabb10ac8a95287feea37ab88c
Parent: 297d5915c3c927cba3a63bc9d6d1747271d06641
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 7 20:28:03 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Dec 7 21:00:39 2017 +0100
libdm: use delay_resume_if_extended
Update the logic towards more explicit logic.
Preload tree normally does not want to resume, only
in certain cases of extension or new loaded nodes can be
resumed. So introduce new internal variable delay_resume_if_extended
controlable by target.
Patch itself is not changing current existing behaviour,
and rather documents existing problem in more readable way.
lvm2 needs to introduce explicit mechanism how to support more
fain-grained (and safe) logic to i.e. resize thin-pool which
can be sitting on cached raid volume.
---
libdm/libdm-deptree.c | 55 ++++++++++++++++++++++++++++--------------------
1 files changed, 32 insertions(+), 23 deletions(-)
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index f463eab..745fec3 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -233,6 +233,19 @@ struct load_properties {
unsigned delay_resume_if_new;
/*
+ * Preload tree normally only loads and not resume, but there is
+ * automatic resume when target is extended, as it's believed
+ * there can be no i/o flying to this 'new' extedend space
+ * from any device above. Reason is that preloaded target above
+ * may actually need to see its bigger subdevice before it
+ * gets suspended. As long as devices are simple linears
+ * there is no problem to resume bigger device in preload (before commit).
+ * However complex targets like thin-pool (raid,cache...)
+ * they shall not be resumed before their commit.
+ */
+ unsigned delay_resume_if_extended;
+
+ /*
* Call node_send_messages(), set to 2 if there are messages
* When != 0, it validates matching transaction id, thus thin-pools
* where transation_id is passed as 0 are never validated, this
@@ -2745,6 +2758,18 @@ static int _load_node(struct dm_tree_node *dnode)
PRIu64 " for %s.%s", existing_table_size,
seg_start, _node_name(dnode),
dnode->props.size_changed ? "" : " (Ignoring.)");
+
+ /*
+ * FIXME: code here has known design problem.
+ * LVM2 does NOT resize thin-pool on top of other LV in 2 steps -
+ * where raid would be resized with 1st. transaction
+ * followed by 2nd. thin-pool resize - RHBZ #1285063
+ */
+ if (existing_table_size && dnode->props.delay_resume_if_extended) {
+ log_debug_activation("Resume of table of extended device %s delayed.",
+ _node_name(dnode));
+ dnode->props.size_changed = 0;
+ }
}
}
@@ -2791,7 +2816,6 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
struct dm_tree_node *child;
struct dm_info newinfo;
int update_devs_flag = 0;
- struct load_segment *seg;
/* Preload children first */
while ((child = dm_tree_next_child(&handle, dnode, 0))) {
@@ -2816,6 +2840,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
if (!child->info.exists && !(node_created = _create_node(child)))
return_0;
+ /* Propagate delayed resume from exteded child node */
+ if (child->props.delay_resume_if_extended)
+ dnode->props.delay_resume_if_extended = 1;
+
if (!child->info.inactive_table &&
child->props.segment_count &&
!_load_node(child)) {
@@ -2833,32 +2861,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode,
return_0;
}
- /* Propagate device size change change */
- if (child->props.size_changed > 0 && !dnode->props.size_changed)
- dnode->props.size_changed = 1;
- else if (child->props.size_changed < 0)
- dnode->props.size_changed = -1;
-
/* No resume for a device without parents or with unchanged or smaller size */
if (!dm_tree_node_num_children(child, 1) || (child->props.size_changed <= 0))
continue;
- if (!node_created && (dm_list_size(&child->props.segs) == 1)) {
- /* If thin-pool child nodes were preloaded WITH changed size
- * skip device resume, as this is likely resize of data or
- * metadata device and so thin pool needs suspend before
- * resume operation.
- * Note: child->props.segment_count is already 0 here
- */
- seg = dm_list_item(dm_list_last(&child->props.segs),
- struct load_segment);
- if (seg->type == SEG_THIN_POOL) {
- log_debug_activation("Skipping resume of thin-pool %s.",
- child->name);
- continue;
- }
- }
-
if (!child->info.inactive_table && !child->info.suspended)
continue;
@@ -3527,6 +3533,9 @@ int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node,
seg->metadata->props.delay_resume_if_new = 0;
seg->pool->props.delay_resume_if_new = 0;
+ /* Preload must not resume extended running thin-pool before it's committed */
+ node->props.delay_resume_if_extended = 1;
+
/* Validate only transaction_id > 0 when activating thin-pool */
node->props.send_messages = transaction_id ? 1 : 0;
seg->transaction_id = transaction_id;
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=297d5915c3c927cba3a63…
Commit: 297d5915c3c927cba3a63bc9d6d1747271d06641
Parent: 4a4ea47f709287444f3b0d8e0581ce17e730ef4c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Dec 7 17:52:01 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Dec 7 21:00:36 2017 +0100
libdm: avoid checking status on activation
Variable props.send_messages has 3 states and was not used properly
here. Activation in this moment does not need to verify thin-pool status
as that has been already checked on preload.
So only if there are some real messages (value 2) call function
for sending them.
---
WHATS_NEW_DM | 1 +
libdm/libdm-deptree.c | 2 +-
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index dfa5a97..d9503c2 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
Version 1.02.146 -
====================================
+ Activation tree of thin pool skips duplicated check of pool status.
Remove code supporting replicator target.
Do not ignore failure of _info_by_dev().
Propagate delayed resume for pvmove subvolumes.
diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c
index ef5da59..f463eab 100644
--- a/libdm/libdm-deptree.c
+++ b/libdm/libdm-deptree.c
@@ -1920,7 +1920,7 @@ int dm_tree_activate_children(struct dm_tree_node *dnode,
* resume should continue further, just whole command
* has to report failure.
*/
- if (r && dnode->props.send_messages &&
+ if (r && (dnode->props.send_messages > 1) &&
!(r = _node_send_messages(dnode, uuid_prefix, uuid_prefix_len, 1)))
stack;