diff --git a/WHATS_NEW b/WHATS_NEW index 11fa6e1f2..213cc3132 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.115 - ===================================== + Correctly rename active split LV with -splitmirrors for raid1. Add report/compact_output to lvm.conf to enable/disable compact report output. Still restrict mirror region size to power of 2 when VG extent size is not. diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index 5eab5516b..59d3adb88 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -1164,6 +1164,22 @@ int lv_raid_split(struct logical_volume *lv, const char *split_name, if (!activate_lv_excl_local(cmd, lvl->lv)) return_0; + /* + * Since newly split LV is typically already active - we need to call + * suspend() and resume() to also rename it. + * + * TODO: activate should recognize it and avoid these 2 calls + */ + if (!suspend_lv(cmd, lvl->lv)) { + log_error("Failed to suspend %s.", lvl->lv->name); + return 0; + } + + if (!resume_lv(cmd, lvl->lv)) { + log_error("Failed to reactivate %s.", lvl->lv->name); + return 0; + } + dm_list_iterate_items(lvl, &removal_list) if (!activate_lv_excl_local(cmd, lvl->lv)) return_0; diff --git a/test/shell/lvconvert-raid.sh b/test/shell/lvconvert-raid.sh index bcf3874c6..8621311a3 100644 --- a/test/shell/lvconvert-raid.sh +++ b/test/shell/lvconvert-raid.sh @@ -107,6 +107,7 @@ aux wait_for_sync $vg $lv1 lvconvert --splitmirrors 1 -n $lv2 $vg/$lv1 check lv_exists $vg $lv1 check linear $vg $lv2 +check active $vg $lv2 # FIXME: ensure no residual devices lvremove -ff $vg @@ -116,6 +117,7 @@ aux wait_for_sync $vg $lv1 lvconvert --splitmirrors 1 -n $lv2 $vg/$lv1 check linear $vg $lv1 check linear $vg $lv2 +check active $vg $lv2 # FIXME: ensure no residual devices lvremove -ff $vg