Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=a8bcdef4fd172b705572e…
Commit: a8bcdef4fd172b705572e3c0b277e6941be642f4
Parent: f41935909fec9eb8d64bc04530be2f38866f0b8e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jan 15 16:26:00 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jan 17 14:45:47 2018 +0100
activation: guard exclusive activation
Add protectional internall error whenever we spot activation
of 'exclusive' only segments in 'non-exclusive' mode.
TODO: possibly the activation locking could be enhanced to handle
this fully behind the scene - as for now this works purely for
lvchange/vgchange activation.
---
WHATS_NEW | 1 +
lib/activate/activate.c | 10 ++++++++++
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 00334b5..bc73cd7 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.178 -
=====================================
+ Avoid non-exclusive activation of exclusive segment types.
Fix trimming sibling PVs when doing a pvmove of raid subLVs.
Preserve exclusive activation during thin snaphost merge.
Suppress some repeated reads of the same disk data at the device layer.
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 4c69af7..b23400a 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -2568,6 +2568,16 @@ static int _lv_activate(struct cmd_context *cmd, const char *lvid_s,
struct lvinfo info;
int r = 0;
+ if (!laopts->exclusive &&
+ (lv_is_origin(lv) ||
+ lv_is_pvmove(lv) ||
+ seg_only_exclusive(first_seg(lv)))) {
+ log_error(INTERNAL_ERROR "Trying non-exlusive activation of %s with "
+ "a volume type %s requiring exclusive activation.",
+ display_lvname(lv), lvseg_name(first_seg(lv)));
+ return 0;
+ }
+
if (!activation())
return 1;
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=02621cffb0d5ff72adb87…
Commit: 02621cffb0d5ff72adb8770e26c1b4adb95bd0d9
Parent: 5a961d3411c8c11312d2998378277efc8988fc7f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 11 16:15:16 2018 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Jan 17 14:44:33 2018 +0100
pvmove: drop misleading pvmove restriction for cluster
pvmove handles properly locked LVs in cluster and this extra check
actually cause misbehavior as some LVs were silently skipped from
operation scope.
---
tools/pvmove.c | 10 ----------
1 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 9bbe12b..c5d7e52 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -371,16 +371,6 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
if (lv_name && strcmp(lv->name, top_level_lv_name(vg, lv_name)))
continue;
- /*
- * RAID, thin and snapshot-related LVs are not
- * processed in a cluster, so we don't have to
- * worry about avoiding certain PVs in that context.
- *
- * Allow clustered mirror, but not raid mirror.
- */
- if (vg_is_clustered(vg) && !lv_is_mirror_type(lv))
- continue;
-
if (!lv_is_on_pvs(lv, source_pvl))
continue;