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

lvconvert: preserve UUID for swapped metadata

When swapping metadata LV for a pool volume, preserve UUID for metadata
LV during the swap - this allows to better utilise locks with lvmlockd.
This commit is contained in:
Zdenek Kabelac 2023-08-14 15:43:48 +02:00
parent 2928891bd0
commit ac36153e99

View File

@ -2955,19 +2955,7 @@ static int _lvconvert_swap_pool_metadata(struct cmd_context *cmd,
if (!detach_pool_metadata_lv(seg, &prev_metadata_lv))
return_0;
swap_name = metadata_lv->name;
if (!lv_rename_update(cmd, metadata_lv, "pvmove_tmeta", 0))
return_0;
/* Give the previous metadata LV the name of the LV replacing it. */
if (!lv_rename_update(cmd, prev_metadata_lv, swap_name, 0))
return_0;
/* Rename deactivated metadata LV to have _tmeta suffix */
if (!lv_rename_update(cmd, metadata_lv, meta_name, 0))
if (!swap_lv_identifiers(cmd, metadata_lv, prev_metadata_lv))
return_0;
if (!attach_pool_metadata_lv(seg, metadata_lv))