Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7e794b7748a84d2e8f480…
Commit: 7e794b7748a84d2e8f48012b6c31ba50992c8ac1
Parent: e4db42e4769823aceb59698cef9811c11e330b7b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Nov 30 13:26:44 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Dec 1 12:19:09 2017 +0100
activation: avoid rechecking pvmove node
Use new 3rd. state of trace_pvmove_deps == 2.
In this state we know, we have already seen the node and can skip futher
testing. Remainging value 1 signals we want to track, and value 0
is for ignoring tracking, but node is still checking in this case.
Reduces large amount of duplicate ioctl queries.
---
lib/activate/dev_manager.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 429f4f6..9f19912 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -2059,6 +2059,9 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
const char *uuid;
const struct logical_volume *plv;
+ if (lv_is_pvmove(lv) && (dm->track_pvmove_deps == 2))
+ return 1; /* Avoid rechecking of already seen pvmove LV */
+
if (lv_is_cache_pool(lv)) {
if (!dm_list_empty(&lv->segs_using_this_lv)) {
if (!_add_lv_to_dtree(dm, dtree, seg_lv(first_seg(lv), 0), 0))
@@ -2178,8 +2181,8 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
return_0;
/* Add any LVs referencing a PVMOVE LV unless told not to. */
- if (dm->track_pvmove_deps && lv_is_pvmove(lv)) {
- dm->track_pvmove_deps = 0;
+ if ((dm->track_pvmove_deps == 1) && lv_is_pvmove(lv)) {
+ dm->track_pvmove_deps = 2; /* Mark as already seen */
dm_list_iterate_items(sl, &lv->segs_using_this_lv) {
/* If LV is snapshot COW - whole snapshot needs reload */
plv = lv_is_cow(sl->seg->lv) ? origin_from_cow(sl->seg->lv) : sl->seg->lv;
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c489dd2e1764216de07be…
Commit: c489dd2e1764216de07be80d36b1025fb4f6fc85
Parent: fbd8b456dbc963bbc306e5b3c643d0f67d3a2d6c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Nov 29 22:19:46 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Dec 1 12:19:09 2017 +0100
pvmove: add missing segment merging
When pvmove is finished and metadata are updated, the code missed
to merge possible mergable segments - so add explicit merging
call after pvmoved volumes are unlocked.
This avoids weird results where i.e. lvs could have been reporting
non-matching segments as lvs upon metadata read is doing silent segment
merging while dm table left after pvmove was still preserving
non-merged segments.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 2 ++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 32ed3c9..093fc95 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.177 -
====================================
+ Merge segments when pvmove is finished.
Remove label_verify that has never been used.
Ensure very large numbers used as arguments are not casted to lower values.
Enhance reading and validation of options stripes and stripes_size.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index d4a4b8b..fb152ac 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6637,6 +6637,8 @@ int remove_layers_for_segments_all(struct cmd_context *cmd,
dm_list_iterate_items(lvl, lvs_changed) {
/* FIXME Assumes only one pvmove at a time! */
lvl->lv->status &= ~LOCKED;
+ if (!lv_merge_segments(lvl->lv))
+ return_0;
}
return 1;