1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-17 06:04:23 +03:00

raid_manip: pay attention to PVs listed on command line when allocating MetaLVs

Adding MetaLVs to given DataLVs (e.g. raid0 -> raid0_meta takeover) wasn't
paying attention to any PVs listed on the lvconvert command line.
This commit is contained in:
Heinz Mauelshagen 2016-08-13 00:20:01 +02:00
parent 6d52b17dfc
commit 9c9b9b276a

View File

@ -1604,10 +1604,21 @@ static int _alloc_rmeta_devs_for_rimage_devs(struct logical_volume *lv,
dm_list_iterate_items(lvl, new_data_lvs) { dm_list_iterate_items(lvl, new_data_lvs) {
log_debug_metadata("Allocating new metadata LV for %s", lvl->lv->name); log_debug_metadata("Allocating new metadata LV for %s", lvl->lv->name);
if (!_alloc_rmeta_for_lv(lvl->lv, &lvl_array[a].lv, allocate_pvs)) { /*
log_error("Failed to allocate metadata LV for %s in %s", * Try to collocate with DataLV first and
lvl->lv->name, lv->vg->name); * if that fails allocate on different PV.
return 0; */
if (!_alloc_rmeta_for_lv(lvl->lv, &lvl_array[a].lv,
allocate_pvs != &lv->vg->pvs ? allocate_pvs : NULL)) {
dm_list_iterate_items(lvl1, new_meta_lvs)
if (!_avoid_pvs_with_other_images_of_lv(lvl1->lv, allocate_pvs))
return_0;
if (!_alloc_rmeta_for_lv(lvl->lv, &lvl_array[a].lv, allocate_pvs)) {
log_error("Failed to allocate metadata LV for %s in %s",
lvl->lv->name, lv->vg->name);
return 0;
}
} }
dm_list_add(new_meta_lvs, &lvl_array[a++].list); dm_list_add(new_meta_lvs, &lvl_array[a++].list);