summaryrefslogtreecommitdiffstats
path: root/lib/metadata/mirror.c
diff options
context:
space:
mode:
authorJonathan Earl Brassow <jbrassow@redhat.com>2011-09-13 14:37:48 +0000
committerJonathan Earl Brassow <jbrassow@redhat.com>2011-09-13 14:37:48 +0000
commitcc9dc919e6fe3d005cfdd2ba46edf4aba62a7ac3 (patch)
treea53952ba4f4ca7404515528c9edf771e4beffd51 /lib/metadata/mirror.c
parent6d0aa801a00ec2591a1c3167255a8ace7333a672 (diff)
downloadlvm2-cc9dc919e6fe3d005cfdd2ba46edf4aba62a7ac3.tar.gz
lvm2-cc9dc919e6fe3d005cfdd2ba46edf4aba62a7ac3.tar.xz
lvm2-cc9dc919e6fe3d005cfdd2ba46edf4aba62a7ac3.zip
Fix for bug 737125 - unable to create mirror on 1K extent size VG
_alloc_init calculates the number of necessary log extents via 'mirror_log_extents'. 'mirror_log_extents' takes 3 arguments: region_size, pe_size, and size of the mirror LV. Unfortunately, _alloc_init is guessing at the mirror size by using 'ah->new_extents / ah->area_multiple' - the number of extents that the mirror images have. However, this is /always/ wrong when allocating the log separately. Further, the log is always allocated separately unless we are up-converting the mirror at the same time. It was by luck alone that a default value of '1' reflects what we want in most cases. In order to get a decent value computed, we need to pass in the 'lv' argument to allocate_extents. This would normally imply a desire for cling/contiguous allocation to the given LV, but since we are not allocating any parallel extents and only log extents, it works fine.
Diffstat (limited to 'lib/metadata/mirror.c')
-rw-r--r--lib/metadata/mirror.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c
index ef8b76d6..fd863df4 100644
--- a/lib/metadata/mirror.c
+++ b/lib/metadata/mirror.c
@@ -1966,7 +1966,7 @@ int add_mirror_log(struct cmd_context *cmd, struct logical_volume *lv,
}
/* allocate destination extents */
- ah = allocate_extents(lv->vg, NULL, segtype,
+ ah = allocate_extents(lv->vg, lv, segtype,
0, 0, log_count - old_log_count, region_size, 0,
allocatable_pvs, alloc, parallel_areas);
if (!ah) {