From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10290 invoked by alias); 7 Jan 2010 20:42:57 -0000 Received: (qmail 10274 invoked by uid 9478); 7 Jan 2010 20:42:56 -0000 Date: Thu, 07 Jan 2010 20:42:00 -0000 Message-ID: <20100107204256.10272.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/msg00031.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2010-01-07 20:42:56 Modified files: tools : lvconvert.c Log message: The patch fixes some lvconvert issues (WRT mirror <-> mirror). The default log option for a mirror is 'disk'. If the log type is not explicitly stated on the command line when converting from an X-way mirror to a Y-way mirror, 'disk' is chosen. So, if you have a 'core' log mirror and you convert, your result will contain a 'disk' log. This patch remembers what the old log type was. If the user is merely trying to switch the number of mirror images, the log type is now kept the same. There is one historical behaviour I left in place... If you have a 2-way, core-log mirror and you use lvconvert to specify you want a 2-way mirror - without specifying the log type - you will get a 2-way, disk-log mirror. Signed-off-by: Jonathan Brassow Informal-IRC-ACK-by: agk Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.101&r2=1.102 --- LVM2/tools/lvconvert.c 2010/01/06 13:27:07 1.101 +++ LVM2/tools/lvconvert.c 2010/01/07 20:42:55 1.102 @@ -628,6 +628,17 @@ return 0; } + /* + * If we are converting from one type of mirror to another, and + * 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) && + !arg_count(cmd, mirrorlog_ARG) && !arg_count(cmd, corelog_ARG)) { + corelog = first_seg(lv)->log_lv ? 0 : 1; + } + if (repair) { cmd->handles_missing_pvs = 1; cmd->partial_activation = 1;