Bug 807441

Summary: vgreduce tries to unlock nonexistant vgs
Product: Red Hat Enterprise Linux 6 Reporter: Zdenek Kabelac <zkabelac>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: agk, cmarthal, dwysocha, heinzm, jbrassow, mbroz, msnitzer, prajnoha, prockai, thornber, zkabelac
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.95-6.el6 Doc Type: Bug Fix
Doc Text:
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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 15:03:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zdenek Kabelac 2012-03-27 19:29:15 UTC
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:

Comment 2 Zdenek Kabelac 2012-04-11 13:08:34 UTC
Addressed by:

https://www.redhat.com/archives/lvm-devel/2012-March/msg00191.html

Comment 4 Peter Rajnoha 2012-04-26 12:11:33 UTC
    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.

Comment 5 Corey Marthaler 2012-05-04 20:40:34 UTC
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

Comment 7 errata-xmlrpc 2012-06-20 15:03:18 UTC
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