From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8094 invoked by alias); 13 Sep 2011 18:11:39 -0000 Received: (qmail 8075 invoked by uid 9478); 13 Sep 2011 18:11:39 -0000 Date: Tue, 13 Sep 2011 18:11:00 -0000 Message-ID: <20110913181139.8073.qmail@sourceware.org> From: jbrassow@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/metadata mirror.c Mailing-List: contact lvm2-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: lvm2-cvs-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00047.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2011-09-13 18:11:38 Modified files: lib/metadata : mirror.c Log message: Better fix for bug 737125 - unable to create mirror on 1K extent size VG WHATS_NEW entry: Fix log size calculation when only a log is being added to a mirror. The original fix pass the mirror LV to allocate_extents (rather than passing NULL) so that _alloc_init could correctly determine the necessary size of the mirror log. In the previous check-in, I noted: 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. However, passing in the LV did have unintended consequences on the placement of the log. The better solution is to pass in the number of extext that are in the mirror LV instead of the LV itself. This will not cause the allocator to reserve that number of extents, because 'stripes' and 'mirrors' are specified as 0. Thus, 'extents' is used to calculate the size of the log, but won't affect how much is allocated. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.164&r2=1.165 --- LVM2/lib/metadata/mirror.c 2011/09/13 14:37:49 1.164 +++ LVM2/lib/metadata/mirror.c 2011/09/13 18:11:38 1.165 @@ -1966,9 +1966,10 @@ } /* allocate destination extents */ - ah = allocate_extents(lv->vg, lv, segtype, - 0, 0, log_count - old_log_count, region_size, 0, - allocatable_pvs, alloc, parallel_areas); + ah = allocate_extents(lv->vg, NULL, segtype, + 0, 0, log_count - old_log_count, region_size, + lv->le_count, allocatable_pvs, + alloc, parallel_areas); if (!ah) { log_error("Unable to allocate extents for mirror log."); return 0;