summaryrefslogtreecommitdiff
path: root/tools/lvconvert.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lvconvert.c')
-rw-r--r--tools/lvconvert.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index f22c84ba8..5758c9125 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3310,13 +3310,27 @@ static int _lvconvert_single(struct cmd_context *cmd, struct logical_volume *lv,
return_ECMD_FAILED;
}
}
+
if (lp->merge) {
if ((lv_is_thin_volume(lv) && !_lvconvert_merge_thin_snapshot(cmd, lv, lp)) ||
(!lv_is_thin_volume(lv) && !_lvconvert_merge_old_snapshot(cmd, lv, lp))) {
log_print_unless_silent("Unable to merge LV \"%s\" into its origin.", lv->name);
return ECMD_FAILED;
}
- } else if (lp->snapshot) {
+ return ECMD_PROCESSED;
+ }
+
+ /*
+ * Converting to a new type.
+ */
+
+ if (vg_is_clustered(lv->vg) && !segtype_allowed_in_cluster_vg(lp->segtype)) {
+ log_error("LV segtype %s is not allowed in a cluster VG.",
+ lp->segtype->name);
+ return ECMD_FAILED;
+ }
+
+ if (lp->snapshot) {
if (!_lvconvert_snapshot(cmd, lv, lp))
return_ECMD_FAILED;
} else if (segtype_is_pool(lp->segtype) || lp->thin || lp->cache) {