From da6fca6e1a584e57b341d9bfb0824fe3a224faeb Mon Sep 17 00:00:00 2001 From: David Teigland Date: Mon, 20 Apr 2015 14:13:50 -0500 Subject: Improve duplicate PV handling Make the processing of duplicate PVs the same with and without lvmetad. --- lib/cache/lvmcache.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/cache/lvmcache.c') diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 6f8c95085..c5f78c864 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -1610,10 +1610,13 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid, //dm_is_dm_major(MAJOR(dev->dev))) // 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)); + log_error("Found duplicate PV %s: using %s not %s", + pvid_s, + dev_name(existing->dev), + dev_name(dev)); + strncpy(dev->pvid, pvid_s, sizeof(dev->pvid)); _found_duplicate_pvs = 1; + return NULL; } } if (strcmp(pvid_s, existing->dev->pvid)) -- cgit v1.2.1