diff options
author | David Teigland <teigland@redhat.com> | 2016-12-09 16:32:38 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2016-12-13 10:20:22 -0600 |
commit | 0fa39f42e3500f05a978772b8bd3ab3de8bf94f8 (patch) | |
tree | 9e203578655642e9818d30f7915e1a3de7fb4e63 | |
parent | a82ea1f1fd447403dc458346a5b9f1772cc0503b (diff) | |
download | lvm2-0fa39f42e3500f05a978772b8bd3ab3de8bf94f8.tar.gz |
lvconvert: fix unused code removal
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 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.) |