mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

Blame SOURCES/lvm2-2_02_187-pvmove-check-if-participating-LV-is-already-exlcusiv.patch

2b52f6
From 36265f58ae0def19b2bbe55443d77a10bad8eeca Mon Sep 17 00:00:00 2001
2b52f6
From: Zdenek Kabelac <zkabelac@redhat.com>
2b52f6
Date: Wed, 18 Sep 2019 12:42:50 +0200
2b52f6
Subject: [PATCH 4/6] pvmove: check if participating LV is already exlcusively
2b52f6
 active
2b52f6
2b52f6
When running pvmove, we need to decide whether pvmove has to be doing
2b52f6
exlusive or non-exclusive activations for LV.
2b52f6
2b52f6
Whenever LV that requires exlusive activation is present, it makes
2b52f6
pvmove exlusive. But when there is already activate i.e. linear LV
2b52f6
in exclusive mode it also needs to switch pvmove into 'exlusively
2b52f6
activating' pvmove.
2b52f6
2b52f6
(cherry picked from commit 1349b61bb72d3a42636053ede0d6fa71cd4f2d93)
2b52f6
2b52f6
Conflicts:
2b52f6
	WHATS_NEW
2b52f6
---
2b52f6
 WHATS_NEW      | 1 +
2b52f6
 tools/pvmove.c | 3 ++-
2b52f6
 2 files changed, 3 insertions(+), 1 deletion(-)
2b52f6
2b52f6
diff --git a/WHATS_NEW b/WHATS_NEW
2b52f6
index d99f183..399864d 100644
2b52f6
--- a/WHATS_NEW
2b52f6
+++ b/WHATS_NEW
2b52f6
@@ -1,6 +1,7 @@
2b52f6
 Version 2.02.187 - 
2b52f6
 ===================================
2b52f6
   Prevent creating VGs with PVs with different logical block sizes.
2b52f6
+  Pvmove runs in exlusively activating mode for exclusively active LVs.
2b52f6
 
2b52f6
 Version 2.02.186 - 27th August 2019
2b52f6
 ===================================
2b52f6
diff --git a/tools/pvmove.c b/tools/pvmove.c
2b52f6
index 754bd58..3a447c4 100644
2b52f6
--- a/tools/pvmove.c
2b52f6
+++ b/tools/pvmove.c
2b52f6
@@ -674,7 +674,8 @@ static int _pvmove_setup_single(struct cmd_context *cmd,
2b52f6
 		dm_list_iterate_items(lvl, lvs_changed) {
2b52f6
 			lvh = lv_lock_holder(lvl->lv);
2b52f6
 			/* Exclusive LV decides whether pvmove must be also exclusive */
2b52f6
-			if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh)))
2b52f6
+			if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh)) ||
2b52f6
+			    lv_is_active_exclusive(lvh))
2b52f6
 				exclusive = 1;
2b52f6
 		}
2b52f6
 
2b52f6
-- 
2b52f6
1.8.3.1
2b52f6