WHATS_NEW | 1 + tools/lvconvert.c | 4 ++-- tools/lvconvert_poll.c | 13 +++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 9ddecbc..5260321 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.131 - ===================================== + Swapping of LV identifiers handles more complex LVs. Fix VG metadata comparison failure while scanning the VG for lvmetad. Ignore persistent cache if configuration changed. (2.02.127) diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 2bffb07..919537a 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -2489,14 +2489,14 @@ deactivate_pmslv: if (!detach_pool_metadata_lv(first_seg(pool_lv), &mlv)) return_0; + /* Swap _pmspare and _tmeta name */ if (!swap_lv_identifiers(cmd, mlv, pmslv)) return_0; - /* Used _pmspare will become _tmeta */ if (!attach_pool_metadata_lv(first_seg(pool_lv), pmslv)) return_0; - /* Used _tmeta will become visible _meta%d */ + /* Used _tmeta (now _pmspare) becomes _meta%d */ if (!lv_rename_update(cmd, mlv, pms_path, 0)) return_0; diff --git a/tools/lvconvert_poll.c b/tools/lvconvert_poll.c index e3a3709..1b230bc 100644 --- a/tools/lvconvert_poll.c +++ b/tools/lvconvert_poll.c @@ -44,15 +44,20 @@ int swap_lv_identifiers(struct cmd_context *cmd, struct logical_volume *a, struct logical_volume *b) { union lvid lvid; - const char *name; + const char *aname = a->name, *bname = b->name; lvid = a->lvid; a->lvid = b->lvid; b->lvid = lvid; - name = a->name; - a->name = b->name; - if (!lv_rename_update(cmd, b, name, 0)) + /* rename temporarily to 'unused' name */ + if (!lv_rename_update(cmd, a, "pmove_tmeta", 0)) + return_0; + /* name rename 'b' to unused name of 'a' */ + if (!lv_rename_update(cmd, b, aname, 0)) + return_0; + /* finish name swapping */ + if (!lv_rename_update(cmd, a, bname, 0)) return_0; return 1;