From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18755 invoked by alias); 14 Sep 2011 04:10:30 -0000 Received: (qmail 18735 invoked by uid 9478); 14 Sep 2011 04:10:27 -0000 Date: Wed, 14 Sep 2011 04:10:00 -0000 Message-ID: <20110914041027.18733.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/msg00051.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2011-09-14 04:10:27 Modified files: lib/metadata : mirror.c Log message: Additional fixes for lv_mirror_count. Changing lv_mirror_count to only count the AREA_LVs made the function stop working for PVMOVE mirrors. A conditional has been added to fix that problem. Additionally, when counting the images in a mirror stack, we don't need to subtract 1 from the count we get back from the lv_mirror_count call on the temporary mirror layer. (This is because we are no falsely counting the top layer of the temporary mirror.) Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.167&r2=1.168 --- LVM2/lib/metadata/mirror.c 2011/09/14 02:45:37 1.167 +++ LVM2/lib/metadata/mirror.c 2011/09/14 04:10:26 1.168 @@ -114,13 +114,17 @@ return 1; seg = first_seg(lv); + + if (lv->status & PVMOVE) + return seg->area_count; + mirrors = 0; for (s = 0; s < seg->area_count; s++) { if (seg_type(seg, s) != AREA_LV) continue; if (is_temporary_mirror_layer(seg_lv(seg, s))) - mirrors += lv_mirror_count(seg_lv(seg, s)) - 1; + mirrors += lv_mirror_count(seg_lv(seg, s)); else mirrors++; }