From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23153 invoked by alias); 11 Jan 2010 17:13:46 -0000 Received: (qmail 23134 invoked by uid 9478); 11 Jan 2010 17:13:46 -0000 Date: Mon, 11 Jan 2010 17:13:00 -0000 Message-ID: <20100111171346.23132.qmail@sourceware.org> From: jbrassow@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/tools lvconvert.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: 2010-01/txt/msg00048.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-01-11 17:13:46 Modified files: tools : lvconvert.c Log message: Found 2 problems with my previous check-in: date: 2010/01/07 20:42:55; author: jbrassow; state: Exp; lines: +11 -0 The patch fixes some lvconvert issues (WRT mirror <-> mirror). 1) 'exisiting_mirrors' and 'lp->mirrors' where taken to be in 'n-1' notation (i.e a 2-way mirror is '1' and a linear is '0'), but the variables were in 'n' notation. 2) After adding the redundant mirror log support, I was calculating log_count by looking at the mirror log LV, but didn't take into account the fact that there could be no mirror log! Signed-off-by: Jonathan Brassow Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.106&r2=1.107 --- LVM2/tools/lvconvert.c 2010/01/08 22:32:35 1.106 +++ LVM2/tools/lvconvert.c 2010/01/11 17:13:45 1.107 @@ -668,10 +668,11 @@ * the type of log wasn't specified, then let's keep the log type * the same. */ - if (existing_mirrors && lp->mirrors && - (lp->mirrors != existing_mirrors) && + if ((existing_mirrors > 1) && (lp->mirrors > 1) && + (lp->mirrors != existing_mirrors) && !(lv->status & CONVERTING) && !arg_count(cmd, mirrorlog_ARG) && !arg_count(cmd, corelog_ARG)) { - log_count = lv_mirror_count(first_seg(lv)->log_lv); + log_count = (first_seg(lv)->log_lv) ? + lv_mirror_count(first_seg(lv)->log_lv) : 0; } if (repair) {