diff options
author | David Teigland <teigland@redhat.com> | 2016-12-09 16:32:38 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2016-12-09 16:32:38 -0600 |
commit | eb88721cbab3da78e1b5c67bfc47db1ce2965171 (patch) | |
tree | ff5d8491dbcc796aa689c65cb7ef3cd407da0dd1 | |
parent | f0651dc64403326d97147346a1de57edc0b32555 (diff) | |
download | lvm2-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.c | 14 |
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.) |