mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +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:
parent
9a34de9cb9
commit
f545dd5952
@ -215,10 +215,17 @@ static int _set_up_historical_lv(struct lv_segment *seg_to_remove,
|
|||||||
{
|
{
|
||||||
struct generic_logical_volume *glv = NULL;
|
struct generic_logical_volume *glv = NULL;
|
||||||
|
|
||||||
if (seg_to_remove->origin || seg_to_remove->indirect_origin ||
|
if (seg_to_remove->lv->vg->cmd->record_historical_lvs) {
|
||||||
dm_list_size(&seg_to_remove->lv->segs_using_this_lv) ||
|
if (seg_to_remove->origin || seg_to_remove->indirect_origin ||
|
||||||
dm_list_size(&seg_to_remove->lv->indirect_glvs)) {
|
dm_list_size(&seg_to_remove->lv->segs_using_this_lv) ||
|
||||||
if (!(glv = _create_historical_glv(seg_to_remove)))
|
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;
|
return_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user