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-09 16:32:38 -0600
commiteb88721cbab3da78e1b5c67bfc47db1ce2965171 (patch)
treeff5d8491dbcc796aa689c65cb7ef3cd407da0dd1
parentf0651dc64403326d97147346a1de57edc0b32555 (diff)
downloadlvm2-dev-dct-cmd-defs57.tar.gz
lvconvert: fix unused code removaldev-dct-cmd-defs57
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 552439f0a..c3ceea6e3 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -3398,6 +3398,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.)