main - Revert "handle duplicate vgids"
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7502f78678db7c7701e543a0a7267e050850ba53 Commit: 7502f78678db7c7701e543a0a7267e050850ba53 Parent: bd2baeaaa67da3885df9f06700565dc201c82861 Author: David Teigland <[email protected]> AuthorDate: Tue Jan 11 16:03:07 2022 -0600 Committer: David Teigland <[email protected]> CommitterDate: Tue Jan 11 16:04:51 2022 -0600
Revert "handle duplicate vgids"
This reverts commit bd2baeaaa67da3885df9f06700565dc201c82861.
This commit broke vgrename because vgrename relies on old bugs in lvmcache_update_vg_from_write and lvmcache_update_vgname which need to be fixed first.
--- lib/cache/lvmcache.c | 20 ++++------------- test/shell/duplicate-vgid.sh | 52 -------------------------------------------- 2 files changed, 4 insertions(+), 68 deletions(-)
lib/cache/lvmcache.c +4 -16
@@ -354,11 +354,9 @@ static struct lvmcache_vginfo *_vginfo_lookup(const char *vgname, const char *vgif (vgid_arg) {if ((vginfo =dm_hash_lookup (_vgid_hash, vgid))) {if (vgname &&strcmp (vginfo->vgname, vgname)) { -log_warn ("WARNING: lookup found duplicate VGID %s for VGs %s and %s." , vgid, vginfo->vgname, vgname); -if ((vginfo =dm_hash_lookup (_vgname_hash, vgname))) { -if (!memcmp (vginfo->vgid, vgid,ID_LEN )) -return vginfo; - } +/* should never happen */ +log_error (INTERNAL_ERROR "vginfo_lookup vgid %s has two names %s %s" , + vgid, vginfo->vgname, vgname);return NULL ; }return vginfo;
@@ -1886,17 +1884,7 @@ static int _lvmcache_update_vgname(struct cmd_context *cmd,_drop_vginfo (info, info->vginfo); - vginfo =lvmcache_vginfo_from_vgid (vgid); -if (vginfo &&strcmp (vginfo->vgname, vgname)) { -log_warn ("WARNING: fix duplicate VGID %s for VGs %s and %s (see vgchange -u)." , vgid_dashed, vgname, vginfo->vgname); - vginfo =lvmcache_vginfo_from_vgname (vgname,NULL ); -if (vginfo &&memcmp (vginfo->vgid, vgid,ID_LEN )) { -log_error ("Ignoring %s with conflicting VG info %s %s." ,dev_name (info->dev), vgid_dashed, vgname); - return_0; - } - } - -if (!vginfo) { +if (!(vginfo =lvmcache_vginfo_from_vgid (vgid))) {/* * Create a vginfo struct for this VG and put the vginfo * into the hash table.
test/shell/duplicate-vgid.sh deleted +0 -52
52 lines not on this page · raw message