diff options
author | Petr Rockai <prockai@redhat.com> | 2014-10-07 08:55:09 +0200 |
---|---|---|
committer | Petr Rockai <prockai@redhat.com> | 2014-10-07 08:58:24 +0200 |
commit | b66f16fd63014c958d65ab37df4b72f1566176d3 (patch) | |
tree | a3a701ef34f24068cbd21c3746cd4f9b478e130c | |
parent | 86dad329be2fa20a528066776aab77f26a29790c (diff) | |
download | lvm2-b66f16fd63014c958d65ab37df4b72f1566176d3.tar.gz |
lvconvert: Allow --repair and --splitmirrors on reserved-name LVs.
-rw-r--r-- | test/shell/lvconvert-cache.sh | 16 | ||||
-rw-r--r-- | tools/lvconvert.c | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/shell/lvconvert-cache.sh b/test/shell/lvconvert-cache.sh index c108008d2..1c6230986 100644 --- a/test/shell/lvconvert-cache.sh +++ b/test/shell/lvconvert-cache.sh @@ -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 # ####################### diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 8f2556128..fc228236d 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -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)) |