]> sourceware.org Git - lvm2.git/commitdiff
Fix for bug 737125 - unable to create mirror on 1K extent size VG
authorJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 13 Sep 2011 14:37:48 +0000 (14:37 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 13 Sep 2011 14:37:48 +0000 (14:37 +0000)
_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.

WHATS_NEW
lib/metadata/mirror.c

index 43e621e106f7338bb0323352af5b443e2e14d8dc..77de51f7caef26754814c8da26e2b53b799ac2da 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix log size calculation when only a log is being added to a mirror.
   Work around resume_lv causing error LV scanning during splitmirror operation.
   Add 7th lv_attr char to show the related kernel target.
   Terminate pv_attr field correctly. (2.02.86)
index ef8b76d66cea0562d21fbf4a2d83558f885b5019..fd863df4f6bcfe5502dc007c51cf33b256172afb 100644 (file)
@@ -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) {
This page took 0.039166 seconds and 5 git commands to generate.