summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-12-09 16:32:38 -0600
committerDavid Teigland <teigland@redhat.com>2016-12-13 10:20:22 -0600
commit0fa39f42e3500f05a978772b8bd3ab3de8bf94f8 (patch)
tree9e203578655642e9818d30f7915e1a3de7fb4e63
parenta82ea1f1fd447403dc458346a5b9f1772cc0503b (diff)
downloadlvm2-0fa39f42e3500f05a978772b8bd3ab3de8bf94f8.tar.gz
lvconvert: fix unused code removal
which removed handling splitmirrors on a cache lv
-rw-r--r--tools/lvconvert.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index 9d865e47f..41a4d24a3 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3401,6 +3401,20 @@ static int _lvconvert(struct cmd_context *cmd, struct logical_volume *lv,
lp->stripes = 0;
}
+ if (arg_is_set(cmd, splitmirrors_ARG) && lv_is_cache(lv)) {
+ struct logical_volume *sublv;
+ sublv = seg_lv(first_seg(lv), 0);
+ if (lv_is_raid(sublv))
+ return _lvconvert_raid(sublv, lp);
+ else if (lv_is_mirror(sublv))
+ return _lvconvert_mirrors(cmd, lv, lp);
+ else {
+ log_error("Sub LV %s must be raid or mirror.", display_lvname(sublv));
+ ret = 0;
+ goto out;
+ }
+ }
+
/*
* Each LV type that can be converted.
* (The existing type of the LV, not a requested type.)