1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

lvconvert: Allow --repair and --splitmirrors on reserved-name LVs.

This commit is contained in:
Petr Rockai 2014-10-07 08:55:09 +02:00
parent 86dad329be
commit b66f16fd63
2 changed files with 18 additions and 0 deletions

View File

@ -99,6 +99,22 @@ lvconvert --splitmirrors 1 --name split $vg/corigin $dev1
lvremove -f $vg
lvcreate -n cpool_meta -m 1 --type raid1 -l 10 $vg
lvcreate -n cpool -m 1 --type raid1 -l 10 $vg
lvconvert --yes --type cache-pool --poolmetadata $vg/cpool_meta $vg/cpool
lvcreate -n corigin --type cache --cachepool $vg/cpool -l 10
lvconvert --repair -y $vg/cpool_cmeta
lvconvert --repair -y $vg/cpool_cdata
# do not allow reserved names for *new* LVs
not lvconvert --splitmirrors 1 --name split_cmeta $vg/cpool_cmeta $dev1
not lvconvert --splitmirrors 1 --name split_cdata $vg/cpool_cdata $dev1
# but allow manipulating existing LVs with reserved names
lvconvert --splitmirrors 1 --name split_meta $vg/cpool_cmeta $dev1
lvconvert --splitmirrors 1 --name split_data $vg/cpool_cdata $dev1
#######################
# Invalid conversions #
#######################

View File

@ -160,6 +160,8 @@ static int _lvconvert_name_params(struct lvconvert_params *lp,
lp->lv_name = lp->lv_name_full;
if (!lp->merge_mirror &&
!arg_count(cmd, repair_ARG) &&
!arg_count(cmd, splitmirrors_ARG) &&
!strstr(lp->lv_name, "_tdata") &&
!strstr(lp->lv_name, "_tmeta") &&
!apply_lvname_restrictions(lp->lv_name))