[lvm-devel] stable-2.02 - pvmove: check if participating LV is already exlcusively active

Zdenek Kabelac zkabelac at sourceware.org
Wed Sep 18 10:47:24 UTC 2019


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1349b61bb72d3a42636053ede0d6fa71cd4f2d93
Commit:        1349b61bb72d3a42636053ede0d6fa71cd4f2d93
Parent:        2e51535b18f3a05428f087f3916ebce5c08d58d1
Author:        Zdenek Kabelac <zkabelac at redhat.com>
AuthorDate:    Wed Sep 18 12:42:50 2019 +0200
Committer:     Zdenek Kabelac <zkabelac at redhat.com>
CommitterDate: Wed Sep 18 12:46:22 2019 +0200

pvmove: check if participating LV is already exlcusively active

When running pvmove, we need to decide whether pvmove has to be doing
exlusive or non-exclusive activations for LV.

Whenever LV that requires exlusive activation is present, it makes
pvmove exlusive. But when there is already activate i.e. linear LV
in exclusive mode it also needs to switch pvmove into 'exlusively
activating' pvmove.
---
 WHATS_NEW      |    1 +
 tools/pvmove.c |    3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/WHATS_NEW b/WHATS_NEW
index eee10ce..0a5bda3 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.187 - 
 ===================================
+  Pvmove runs in exlusively activating mode for exclusively active LVs.
   Activate thin-pool layered volume as 'read-only' device.
   Ignore crypto devices with UUID signature CRYPT-SUBDEV.
   Enhance validation for thin and cache pool conversion and swapping.
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 754bd58..3a447c4 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -674,7 +674,8 @@ static int _pvmove_setup_single(struct cmd_context *cmd,
 		dm_list_iterate_items(lvl, lvs_changed) {
 			lvh = lv_lock_holder(lvl->lv);
 			/* Exclusive LV decides whether pvmove must be also exclusive */
-			if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh)))
+			if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh)) ||
+			    lv_is_active_exclusive(lvh))
 				exclusive = 1;
 		}
 




More information about the lvm-devel mailing list