Hide Forgot
Description of problem: When vgreduce is executed with 'vg' which could not be read, tool takes a lock for such vg, but since it fails already internally during vg_read, lock is unlocked inside error path already. However vgreduce runs it's own unlock in error path as well, giving out error message: # vgreduce nvg /dev/loop1 Volume group "nvg" not found Internal error: Attempt to unlock unlocked VG nvg. Patch needs to test for success of vg_read and only in case of success it may unlock vg later. Version-Release number of selected component (if applicable): 2.02.95 How reproducible: Steps to Reproduce: 1. vgreduce some-non-existant-vg /dev/loop0 2. 3. Actual results: Expected results: Additional info:
Addressed by: https://www.redhat.com/archives/lvm-devel/2012-March/msg00191.html
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Previously, the vgreduce command failed with an internal error "Attempt to unlock unlocked VG" when it was executed with a non-existent VG. This was caused by improperly trying to unlock the VG at command exit which was not locked at that time since locking resources were cleaned up before during handling the error scenario itself. The fix provides a proper check so only locked VGs are unlocked at vgreduce command exit.
Fix verified. [root@hayes-01 ~]# vgreduce fake /dev/etherd/e1.1p1 Volume group "fake" not found [root@hayes-01 ~]# 2.6.32-269.el6.x86_64 lvm2-2.02.95-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012 lvm2-libs-2.02.95-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012 lvm2-cluster-2.02.95-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012 udev-147-2.40.el6 BUILT: Fri Sep 23 07:51:13 CDT 2011 device-mapper-1.02.74-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012 device-mapper-libs-1.02.74-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012 device-mapper-event-1.02.74-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012 device-mapper-event-libs-1.02.74-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012 cmirror-2.02.95-7.el6 BUILT: Wed May 2 05:14:03 CDT 2012
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-2012-0962.html