diff --git a/WHATS_NEW b/WHATS_NEW index b80d18978..c96b5be2b 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,6 +1,6 @@ Version 2.02.162 - ================================= - Improve lvconvert --trackchanges validation to require --splitmirrors. + Improve lvconvert --trackchanges validation to require --splitmirrors 1. Add note about lastlog built-in command to lvm man page. Fix unrecognised segtype flag message. lvconvert reuse cachepool metadade now ONLY with -Zn and clear otherwise. diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 91765d636..c0838d18c 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -1894,6 +1894,13 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l lp->keep_mimages ? "split" : "reduce"); return 0; } + + /* --trackchanges requires --splitmirrors which always has SIGN_MINUS */ + if (lp->track_changes && lp->mirrors != 1) { + log_error("Exactly one image must be split off from %s when tracking changes.", + display_lvname(lv)); + return 0; + } } if (lp->merge_mirror) @@ -1903,8 +1910,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l return lv_raid_split_and_track(lv, lp->pvh); if (lp->keep_mimages) - return lv_raid_split(lv, lp->lv_split_name, - image_count, lp->pvh); + return lv_raid_split(lv, lp->lv_split_name, image_count, lp->pvh); if (lp->mirrors_supplied) return lv_raid_change_image_count(lv, image_count, lp->pvh);