From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26239 invoked by alias); 28 Nov 2008 15:51:41 -0000 Received: (qmail 26225 invoked by uid 9447); 28 Nov 2008 15:51:40 -0000 Date: Fri, 28 Nov 2008 15:51:00 -0000 Message-ID: <20081128155140.26223.qmail@sourceware.org> From: agk@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib/cache lvmcache.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: 2008-11/txt/msg00055.txt.bz2 CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2008-11-28 15:51:40 Modified files: lib/cache : lvmcache.c Log message: Suppress 'duplicate PV' message when it's only a cache update not a real duplicate. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63 --- LVM2/lib/cache/lvmcache.c 2008/11/27 18:13:51 1.62 +++ LVM2/lib/cache/lvmcache.c 2008/11/28 15:51:40 1.63 @@ -713,9 +713,8 @@ if (((dm_hash_lookup(_pvid_hash, pvid)) == info) && !strcmp(info->dev->pvid, pvid)) return 1; - if (*info->dev->pvid) { + if (*info->dev->pvid) dm_hash_remove(_pvid_hash, info->dev->pvid); - } strncpy(info->dev->pvid, pvid, sizeof(info->dev->pvid)); if (!dm_hash_insert(_pvid_hash, pvid, info)) { log_error("_lvmcache_update: pvid insertion failed: %s", pvid); @@ -1140,11 +1139,15 @@ //else if (dm_is_dm_major(MAJOR(existing->dev->dev)) && //dm_is_dm_major(MAJOR(dev->dev))) // - else + else if (!strcmp(pvid_s, existing->dev->pvid)) log_error("Found duplicate PV %s: using %s not " "%s", pvid, dev_name(dev), dev_name(existing->dev)); } + if (strcmp(pvid_s, existing->dev->pvid)) + log_debug("Updating pvid cache to %s (%s) from %s (%s)", + pvid_s, dev_name(dev), + existing->dev->pvid, dev_name(existing->dev)); /* Switch over to new preferred device */ existing->dev = dev; info = existing;