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.
When using pvscan --cache -aay either within the udev rule automatically to autoactivate VGs/LVs (69-dm-lvm-metad.rules) or directly on the command line, we need to add an extra sync_local_dev_names call for the pvscan --cache to properly synchronize with udev. Otherwise, we end up unsynchronized and with *dangling udev_sync cookies* (sempahores) in the system as the activation code called within the pvscan sets up cookies and expects the synchronization to be called later.
The bug was caused by the fact that pvscan --cache uses VG_GLOBAL lock and it does not lock each VG separately. But the code responsible for calling the udev synchronization is used only for real VGs and VG_GLOBAL is not a real VG:
define unlock_vg(cmd, vol)
do { \
if (is_real_vg(vol)) \
sync_dev_names(cmd); \
(void) lock_vol(cmd, vol, LCK_VG_UNLOCK); \
} while (0)
Therefore, in this particular case with pvscan --cache, we need to explicitly add the extra sync_dev_names call to synchronize with udev properly.
LVM would hang once the limit for semaphores is reached - this could be a root cause of other unresolved issues. It is a "Must have" if lvmetad is going to be used.
Have not seen any dangling cookies since the patch was applied.
To QA:
To test this issue, you can use this sequence:
[root@rhel6-a ~]# pvcreate /dev/sda
Physical volume "/dev/sda" successfully created
[root@rhel6-a ~]# vgcreate vg /dev/sda
Volume group "vg" successfully created
[root@rhel6-a ~]# lvcreate -l1 vg
Logical volume "lvol0" created
[root@rhel6-a ~]# vgchange -an vg
0 logical volume(s) in volume group "vg" now active
[root@rhel6-a ~]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lvol0 vg -wi------ 4.00m
[root@rhel6-a ~]# dmsetup udevcookies
Cookie Semid Value Last semop time Last change time
[root@rhel6-a ~]# pvscan --cache -aay /dev/sda
1 logical volume(s) in volume group "vg" now active
[root@rhel6-a ~]# lvs
LV VG Attr LSize Pool Origin Data% Move Log Cpy%Sync Convert
lvol0 vg -wi-a---- 4.00m
[root@rhel6-a ~]# dmsetup udevcookies
Cookie Semid Value Last semop time Last change time
0xd4df189 229378 1 Thu Jan 3 15:00:37 2013 Thu Jan 3 15:00:37 2013
The last one is incorrect! There should not be any cookie left after the pvscan --cache -aay command called before.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
http://rhn.redhat.com/errata/RHBA-2013-0501.html
When using pvscan --cache -aay either within the udev rule automatically to autoactivate VGs/LVs (69-dm-lvm-metad.rules) or directly on the command line, we need to add an extra sync_local_dev_names call for the pvscan --cache to properly synchronize with udev. Otherwise, we end up unsynchronized and with *dangling udev_sync cookies* (sempahores) in the system as the activation code called within the pvscan sets up cookies and expects the synchronization to be called later. The bug was caused by the fact that pvscan --cache uses VG_GLOBAL lock and it does not lock each VG separately. But the code responsible for calling the udev synchronization is used only for real VGs and VG_GLOBAL is not a real VG: define unlock_vg(cmd, vol) do { \ if (is_real_vg(vol)) \ sync_dev_names(cmd); \ (void) lock_vol(cmd, vol, LCK_VG_UNLOCK); \ } while (0) Therefore, in this particular case with pvscan --cache, we need to explicitly add the extra sync_dev_names call to synchronize with udev properly.