diff mbox

[13/18] Replicator: do not remove of replicators' LVs

Message ID 1257171622-8380-14-git-send-email-zkabelac@redhat.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Zdenek Kabelac Nov. 2, 2009, 2:20 p.m. UTC
None
diff mbox

Patch

diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index f3e6511..816c5b6 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -2084,6 +2084,15 @@  int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv,
 		return 0;
 	}
 
+	if (lv_is_replicator_dev(lv) ||
+	    lv_is_rimage(lv) ||
+	    lv_is_rlog(lv) ||
+	    lv_is_slog(lv)) {
+		log_error("Can't remove logical volume %s used by a replicator",
+			  lv->name);
+		return 0;
+	}
+
 	if (lv->status & LOCKED) {
 		log_error("Can't remove locked LV %s", lv->name);
 		return 0;