mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-28 05:57:49 +03:00
Suppress 'duplicate PV' message when it's only a cache update not a real
duplicate.
This commit is contained in:
parent
29c8c75492
commit
1303c93139
9
lib/cache/lvmcache.c
vendored
9
lib/cache/lvmcache.c
vendored
@ -713,9 +713,8 @@ static int _lvmcache_update_pvid(struct lvmcache_info *info, const char *pvid)
|
||||
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 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid,
|
||||
//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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user