Skip to contentSkip to conversation

dev-lvmguy-raid-takeover-reshape-resize - lv_raid_split: add clustered vg check

PATCH Heinz Mauelshagen 1 participant 1 message Jan 31, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=86c0cd36df46cba666cc5b191f3d8c0f71f1ef2c
Commit:        86c0cd36df46cba666cc5b191f3d8c0f71f1ef2c
Parent:        291486655d75f5c1f92364a43b11f41b0faeb38f
Author:        Heinz Mauelshagen <[email protected]>
AuthorDate:    Wed Jan 28 14:22:35 2015 +0100
Committer:     Heinz Mauelshagen <[email protected]>
CommitterDate: Wed Jan 28 14:22:35 2015 +0100

lv_raid_split: add clustered vg check

---
 lib/metadata/raid_manip.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
lib/metadata/raid_manip.c +6 -0
index d60c708..3327935 100644
@@ -1453,6 +1453,12 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name,
 		return 0;
 	}
 
+	if (vg_is_clustered(lv->vg) && !lv_is_active_exclusive_locally(lv)) {
+		log_error("%s/%s must be active exclusive locally to"
+			  " perform this operation.", lv->vg->name, lv->name);
+		return 0;
+	}
+
 	if (find_lv_in_vg(lv->vg, split_name)) {
 		log_error("Logical Volume \"%s\" already exists in %s",
 			  split_name, lv->vg->name);