1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

metadata: honour 'nohistory' switch when removing thin LVs

When --nohistory switch is used with lvremove, the LV that is removed is
not recorded in metadata as 'historical LV'.
This commit is contained in:
Peter Rajnoha 2016-03-01 15:25:28 +01:00
parent 9a34de9cb9
commit f545dd5952

View File

@ -215,10 +215,17 @@ static int _set_up_historical_lv(struct lv_segment *seg_to_remove,
{
struct generic_logical_volume *glv = NULL;
if (seg_to_remove->origin || seg_to_remove->indirect_origin ||
dm_list_size(&seg_to_remove->lv->segs_using_this_lv) ||
dm_list_size(&seg_to_remove->lv->indirect_glvs)) {
if (!(glv = _create_historical_glv(seg_to_remove)))
if (seg_to_remove->lv->vg->cmd->record_historical_lvs) {
if (seg_to_remove->origin || seg_to_remove->indirect_origin ||
dm_list_size(&seg_to_remove->lv->segs_using_this_lv) ||
dm_list_size(&seg_to_remove->lv->indirect_glvs)) {
if (!(glv = _create_historical_glv(seg_to_remove)))
return_0;
}
} else {
if (seg_to_remove->indirect_origin &&
!remove_glv_from_indirect_glvs(seg_to_remove->indirect_origin,
seg_to_remove->lv->this_glv))
return_0;
}