From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25625 invoked by alias); 5 Jan 2011 20:02:47 -0000 Received: (qmail 25603 invoked by uid 9478); 5 Jan 2011 20:02:46 -0000 Date: Wed, 05 Jan 2011 20:02:00 -0000 Message-ID: <20110105200246.25601.qmail@sourceware.org> From: jbrassow@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW 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: 2011-01/txt/msg00022.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: jbrassow@sourceware.org 2011-01-05 20:02:45 Modified files: . : WHATS_NEW tools : lvconvert.c Log message: Prevent the user from simultaneously adding a mirror log while removing a mirror image (or removing a log while adding a mirror). Advise the user to use two separate commands instead. This issue become especially problematic when PVs are specified, as they tend to mean different things when adding vs removing. In a command that mixes adding and removing, it is impossible to decern exactly what the user wants. This change prevents bug 603912. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1860&r2=1.1861 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.152&r2=1.153 --- LVM2/WHATS_NEW 2011/01/05 14:03:36 1.1860 +++ LVM2/WHATS_NEW 2011/01/05 20:02:45 1.1861 @@ -1,5 +1,6 @@ Version 2.02.80 - ==================================== + Prevent adding/removing mirror log while removing/adding an image. Add missing tests in _setup_task(). Fail poll daemon creation when lvmcache_init() fails. Return defined value for errors in _copy_percent() and _snap_percent(). --- LVM2/tools/lvconvert.c 2010/12/08 20:50:51 1.152 +++ LVM2/tools/lvconvert.c 2011/01/05 20:02:45 1.153 @@ -927,6 +927,25 @@ } /* + * Disallow adding logs while removing images or + * adding images while removing logs + */ + if ((*old_log_count < *new_log_count) && + (*old_mimage_count > *new_mimage_count)) { + log_error("Mirror logs cannot be added while images are" + " being removed."); + log_error("Try two separate commands."); + return 0; + } + if ((*old_log_count > *new_log_count) && + (*old_mimage_count < *new_mimage_count)) { + log_error("Mirror images cannot be added while logs are" + " being removed."); + log_error("Try two separate commands."); + return 0; + } + + /* * No mirrored logs for cluster mirrors until * log daemon is multi-threaded. */