1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-11 20:58:50 +03:00

lvconvert: fix unused code removal

which removed handling splitmirrors on a cache lv
This commit is contained in:
David Teigland 2016-12-09 16:32:38 -06:00
parent f0651dc644
commit eb88721cba

View File

@ -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.)