Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
If you have a machine with multipath and Physical/Logical Volumes on the disk, it'll have multiple entries in lvm. The way lvm deals with this (as far as I can tell) is to use a hash table based on the lvname, and then use a linked list for duplicates, as you'll have if you're using MP.
The problem is in _free_vginfo, if vginfo is the fourth node or later, it won't be examined because the traversal stops on the 2nd node, and inspects the 3rd node.
static int _free_vginfo(struct lvmcache_vginfo *vginfo)
{
struct lvmcache_vginfo *primary_vginfo, *vginfo2;
int r = 1;
_free_cached_vgmetadata(vginfo);
vginfo2 = primary_vginfo = vginfo_from_vgname(vginfo->vgname, NULL);
if (vginfo == primary_vginfo) {
dm_hash_remove(_vgname_hash, vginfo->vgname);
if (vginfo->next && !dm_hash_insert(_vgname_hash, vginfo->vgname,
vginfo->next)) {
log_error("_vgname_hash re-insertion for %s failed",
vginfo->vgname);
r = 0;
}
} else do
if (vginfo2->next == vginfo) {
vginfo2->next = vginfo->next;
break;
}
while ((vginfo2 = primary_vginfo->next));
Here is a hastily written patch
diff -c /home/james/rpmbuild/lvm2/2.02.72-8.fc14.4/work/LVM2.2.02.72/lib/cache/lvmcache.c /tmp/buffer-content-2482n5q
--- /home/james/rpmbuild/lvm2/2.02.72-8.fc14.4/work/LVM2.2.02.72/lib/cache/lvmcache.c 2010-07-09 11:34:42.000000000 -0400
+++ /tmp/buffer-content-2482n5q 2011-03-09 20:42:39.946008936 -0500
@@ -819,7 +819,7 @@
vginfo2->next = vginfo->next;
break;
}
- while ((vginfo2 = primary_vginfo->next));
+ while ((vginfo2 = vginfo2->next));
if (vginfo->vgname)
dm_free(vginfo->vgname);
Version-Release number of selected component (if applicable):
2.02.72-8.el6.4
At first glance, it looks like you need 4 distinct VGs with the same name to get this condition. I've applied the patch upstream, but not attempted to reproduce it.
(In reply to comment #4)
> At first glance, it looks like you need 4 distinct VGs with the same name to
> get this condition. I've applied the patch upstream, but not attempted to
> reproduce it.
Yes, which seems a bit weird. I brought this up in the meeting today, they said they had 2 paths to each host, but it isn't clear that they make sure every array has a unique pv/vgname.
Hopefully we'll get a core soon so we can verify this for certain.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.
http://rhn.redhat.com/errata/RHBA-2011-0772.html
Description of problem: If you have a machine with multipath and Physical/Logical Volumes on the disk, it'll have multiple entries in lvm. The way lvm deals with this (as far as I can tell) is to use a hash table based on the lvname, and then use a linked list for duplicates, as you'll have if you're using MP. The problem is in _free_vginfo, if vginfo is the fourth node or later, it won't be examined because the traversal stops on the 2nd node, and inspects the 3rd node. static int _free_vginfo(struct lvmcache_vginfo *vginfo) { struct lvmcache_vginfo *primary_vginfo, *vginfo2; int r = 1; _free_cached_vgmetadata(vginfo); vginfo2 = primary_vginfo = vginfo_from_vgname(vginfo->vgname, NULL); if (vginfo == primary_vginfo) { dm_hash_remove(_vgname_hash, vginfo->vgname); if (vginfo->next && !dm_hash_insert(_vgname_hash, vginfo->vgname, vginfo->next)) { log_error("_vgname_hash re-insertion for %s failed", vginfo->vgname); r = 0; } } else do if (vginfo2->next == vginfo) { vginfo2->next = vginfo->next; break; } while ((vginfo2 = primary_vginfo->next)); Here is a hastily written patch diff -c /home/james/rpmbuild/lvm2/2.02.72-8.fc14.4/work/LVM2.2.02.72/lib/cache/lvmcache.c /tmp/buffer-content-2482n5q --- /home/james/rpmbuild/lvm2/2.02.72-8.fc14.4/work/LVM2.2.02.72/lib/cache/lvmcache.c 2010-07-09 11:34:42.000000000 -0400 +++ /tmp/buffer-content-2482n5q 2011-03-09 20:42:39.946008936 -0500 @@ -819,7 +819,7 @@ vginfo2->next = vginfo->next; break; } - while ((vginfo2 = primary_vginfo->next)); + while ((vginfo2 = vginfo2->next)); if (vginfo->vgname) dm_free(vginfo->vgname); Version-Release number of selected component (if applicable): 2.02.72-8.el6.4