summaryrefslogtreecommitdiff
path: root/tools/lvconvert.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lvconvert.c')
-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.)