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

Disallow the addition of mirror images while a mirror up-convert

is already occurring.  The addition of new legs can be retried
once the current conversion is complete.
This commit is contained in:
Jonathan Earl Brassow 2010-04-21 14:04:24 +00:00
parent 66f79d05eb
commit 3c76d9abaf
3 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.64 -
=================================
Disallow the addition of mirror images while a conversion is happening.
Disallow primary mirror image removal when mirror is not in-sync.
Remove obsolete --name parameter from vgcfgrestore.
Add -S command to clvmd to restart the daemon preserving exclusive locks.

View File

@ -155,11 +155,14 @@ check_and_cleanup_lvs_
# add 1 mirror
prepare_lvs_
lvs -a -o+devices $vg
lvcreate -l2 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0
lvcreate -l5 -m1 -n $lv1 $vg $dev1 $dev2 $dev3:0
lvs -a -o+devices $vg
check_mirror_count_ $vg/$lv1 2
check_mirror_log_ $vg/$lv1
lvconvert -m+1 -i1 $vg/$lv1 $dev4
lvconvert -m+1 -i 20 -b $vg/$lv1 $dev4
# Next convert should fail b/c we can't have 2 at once
not lvconvert -m+1 -b $vg/$lv1 $dev5
wait_conversion_ $vg/$lv1
lvs -a -o+devices $vg
check_no_tmplvs_ $vg/$lv1
check_mirror_count_ $vg/$lv1 3

View File

@ -994,6 +994,16 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
return 0;
}
/*
* Is there already a convert in progress? We do not
* currently allow more than one.
*/
if (find_temporary_mirror(lv) || (lv->status & CONVERTING)) {
log_error("%s is already being converted. Unable to start another conversion.",
lv->name);
return 0;
}
/*
* Log addition/removal should be done before the layer
* insertion to make the end result consistent with