Skip to contentSkip to conversation

stable-2.02 - pvmove: check if participating LV is already exlcusively active

PATCH Zdenek Kabelac 1 participant 1 message Sep 18, 2019

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1349b61bb72d3a42636053ede0d6fa71cd4f2d93
Commit:        1349b61bb72d3a42636053ede0d6fa71cd4f2d93
Parent:        2e51535b18f3a05428f087f3916ebce5c08d58d1
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Wed Sep 18 12:42:50 2019 +0200
Committer:     Zdenek Kabelac <[email protected]>
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(-)
WHATS_NEW +1 -0
index eee10ce..0a5bda3 100644
@@ -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.
tools/pvmove.c +2 -1
index 754bd58..3a447c4 100644
@@ -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;
 		}