diff --git a/WHATS_NEW b/WHATS_NEW index 8050db864..dce8241a5 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.98 - ================================= + Enhance insert_layer_for_lv() with recursive rename for _tdata LVs. Skip building dm tree for thin pool when called with origin_only flag. Add internal lv_rename_update() to rename LV without updating mda. Ensure descriptors 0,1,2 are always available. diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index eb5794cdf..4f86d1489 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -3795,6 +3795,7 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd, struct logical_volume *layer_lv; struct segment_type *segtype; struct lv_segment *mapseg; + struct lv_names lv_names; unsigned exclusive = 0; /* create an empty layer LV */ @@ -3891,6 +3892,18 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd, lv_where->le_count = layer_lv->le_count; lv_where->size = (uint64_t) lv_where->le_count * lv_where->vg->extent_size; + /* + * recuresively rename sub LVs + * currently supported only for thin data layer + * FIXME: without strcmp it breaks mirrors.... + */ + if (strcmp(layer_suffix, "_tdata") == 0) { + lv_names.old = lv_where->name; + lv_names.new = layer_lv->name; + if (!for_each_sub_lv(cmd, layer_lv, _rename_cb, (void *) &lv_names)) + return 0; + } + return layer_lv; }