Bug 807441 - vgreduce tries to unlock nonexistant vgs
Summary: vgreduce tries to unlock nonexistant vgs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-27 19:29 UTC by Zdenek Kabelac
Modified: 2012-06-20 15:03 UTC (History)
11 users (show)

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.
Clone Of:
Environment:
Last Closed: 2012-06-20 15:03:18 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0962 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2012-06-19 21:12:11 UTC

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


Note You need to log in before you can comment on or make changes to this bug.