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

lvconvert: Preserve mirror region size with --repair.

This commit is contained in:
Alasdair G Kergon 2016-08-02 19:50:04 +01:00
parent 415c5fd5d8
commit a234cebbed
2 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.163 - Version 2.02.163 -
================================= =================================
Preserve existing mirror region size when using --repair.
Forbid stripe parameters with lvconvert --repair. Forbid stripe parameters with lvconvert --repair.
Unify stripe size validation into get_stripe_params to catch missing cases. Unify stripe size validation into get_stripe_params to catch missing cases.
Further lvconvert validation logic refactoring. Further lvconvert validation logic refactoring.

View File

@ -1365,7 +1365,7 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
uint32_t new_log_count) uint32_t new_log_count)
{ {
uint32_t region_size; uint32_t region_size;
struct lv_segment *seg; struct lv_segment *seg = first_seg(lv);
struct logical_volume *layer_lv; struct logical_volume *layer_lv;
uint32_t old_mimage_count = lv_mirror_count(lv); uint32_t old_mimage_count = lv_mirror_count(lv);
uint32_t old_log_count = _get_log_count(lv); uint32_t old_log_count = _get_log_count(lv);
@ -1378,14 +1378,12 @@ static int _lvconvert_mirrors_aux(struct cmd_context *cmd,
region_size = adjusted_mirror_region_size(lv->vg->extent_size, region_size = adjusted_mirror_region_size(lv->vg->extent_size,
lv->le_count, lv->le_count,
lp->region_size, 0, lp->region_size ? : seg->region_size, 0,
vg_is_clustered(lv->vg)); vg_is_clustered(lv->vg));
if (!operable_pvs) if (!operable_pvs)
operable_pvs = lp->pvh; operable_pvs = lp->pvh;
seg = first_seg(lv);
/* /*
* Up-convert from linear to mirror * Up-convert from linear to mirror
*/ */
@ -1605,6 +1603,10 @@ static int _lvconvert_mirrors_repair(struct cmd_context *cmd,
failed_mimages = _failed_mirrors_count(lv); failed_mimages = _failed_mirrors_count(lv);
failed_logs = _failed_logs_count(lv); failed_logs = _failed_logs_count(lv);
/* Retain existing region size in case we need it later */
if (!lp->region_size)
lp->region_size = first_seg(lv)->region_size;
if (!mirror_remove_missing(cmd, lv, 0)) if (!mirror_remove_missing(cmd, lv, 0))
return_0; return_0;