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.
Bug 733400 - Mirror down conversion when specifying the secondary leg is broke
Summary: Mirror down conversion when specifying the secondary leg is broke
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.1
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks: 743047
TreeView+ depends on / blocked
 
Reported: 2011-08-25 16:00 UTC by Corey Marthaler
Modified: 2011-12-06 17:02 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.87-3.el6
Doc Type: Bug Fix
Doc Text:
Do not document.
Clone Of:
Environment:
Last Closed: 2011-12-06 17:02:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1522 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2011-12-06 00:50:10 UTC

Description Corey Marthaler 2011-08-25 16:00:26 UTC
Description of problem:
When converting a 2-way mirror down to a linear, and specifying the secondary leg to remove, the lvconvert will now fail.

# Secondary leg down conversion (w/ corelog)
[root@taft-01 ~]# lvs -a -o +devices
 LV                VG      Attr   LSize   Log Copy%  Devices                              
 mirror            taft    mwi-a- 700.00m     100.00 mirror_mimage_0(0),mirror_mimage_1(0)
 [mirror_mimage_0] taft    iwi-ao 700.00m            /dev/sdb1(0)                         
 [mirror_mimage_1] taft    iwi-ao 700.00m            /dev/sdb2(0)                         

[root@taft-01 ~]# lvconvert --mirrorlog core -m 0 taft/mirror /dev/sdb2
 LV taft/mirror_mimage_1 in use: not deactivating

[root@taft-01 ~]# lvs -a -o +devices
 LV              VG      Attr   LSize   Log Copy%  Devices         
 mirror          taft    -wi-a- 700.00m            /dev/sdb1(0)    
 mirror_mimage_0 taft    vwi-a- 700.00m                                                       
 mirror_mimage_1 taft    -wi-a- 700.00m            /dev/sdb2(0)    


# Secondary leg down conversion (w/ disklog)
[root@taft-01 ~]# lvs -a -o +devices
 LV                VG     Attr   LSize   Log         Copy%  Devices                              
 mirror            taft   mwi-a- 700.00m mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
 [mirror_mimage_0] taft   iwi-ao 700.00m                    /dev/sdb1(0)                         
 [mirror_mimage_1] taft   iwi-ao 700.00m                    /dev/sdb2(0)                         
 [mirror_mlog]     taft   lwi-ao   4.00m                    /dev/sdh2(0)                         

[root@taft-01 ~]# lvconvert -m 0 taft/mirror /dev/sdb2
 LV taft/mirror_mimage_1 in use: not deactivating

[root@taft-01 ~]# lvs -a -o +devices
 LV              VG     Attr   LSize   Log Copy%  Devices         
 mirror          taft   -wi-a- 700.00m            /dev/sdb1(0)    
 mirror_mimage_0 taft   vwi-a- 700.00m                            
 mirror_mimage_1 taft   -wi-a- 700.00m            /dev/sdb2(0)    
 mirror_mlog     taft   -wi-a-   4.00m            /dev/sdh2(0)    
[cmarthal@silver ~]$ 


Version-Release number of selected component (if applicable):
2.6.32-191.el6.x86_64

lvm2-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
lvm2-libs-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
lvm2-cluster-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
udev-147-2.37.el6    BUILT: Wed Aug 10 07:48:15 CDT 2011
device-mapper-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-libs-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-event-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
device-mapper-event-libs-1.02.66-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011
cmirror-2.02.87-1.el6    BUILT: Fri Aug 12 06:11:57 CDT 2011


How reproducible:
Everytime

Comment 1 Jonathan Earl Brassow 2011-09-13 20:23:40 UTC
I don't see any of this:

[root@bp-01 lvm2]# lvcreate -m1 --corelog -L 100M -n lv vg
  Logical volume "lv" created
[root@bp-01 lvm2]# devices vg
  LV            Copy%  Devices                      
  lv            100.00 lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0]        /dev/sdb1(0)                 
  [lv_mimage_1]        /dev/sdc1(0)                 
[root@bp-01 lvm2]# lvconvert --mirrorlog core -m 0 vg/lv /dev/sdc1
  Logical volume lv converted.
[root@bp-01 lvm2]# devices vg
  LV   Copy%  Devices     
  lv          /dev/sdb1(0)


[root@bp-01 lvm2]# lvremove -ff vg; dmsetup remove_all
  Logical volume "lv" successfully removed


[root@bp-01 lvm2]# lvcreate -m1 -L 100M -n lv vg
  Logical volume "lv" created
[root@bp-01 lvm2]# devices vg
  LV            Copy%  Devices                      
  lv            100.00 lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0]        /dev/sdb1(0)                 
  [lv_mimage_1]        /dev/sdc1(0)                 
  [lv_mlog]            /dev/sdi1(0)                 
[root@bp-01 lvm2]# lvconvert -m 0 vg/lv /dev/sdc1
  Logical volume lv converted.
[root@bp-01 lvm2]# devices vg
  LV   Copy%  Devices     
  lv          /dev/sdb1(0)

Comment 2 Jonathan Earl Brassow 2011-09-13 21:14:18 UTC
The solution is to call sync_local_dev_names() to poke udev before calling deactivate_lv on the error target sub-lv that results from removing the mirror layer.

Solution checked in upstream in Version 2.02.89.

BEFORE FIX:
[root@taft-01 LVM2]# lvcreate -m1 --corelog -L 700M -n lv vg
  Logical volume "lv" created
[root@taft-01 LVM2]# lvs -a -o name,devices vg
  LV            Devices                      
  lv            lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0] /dev/sdc1(0)                 
  [lv_mimage_1] /dev/sdd1(0)                 
[root@taft-01 LVM2]# lvconvert --mirrorlog core -m 0 vg/lv /dev/sdd1 
  LV vg/lv_mimage_1 in use: not deactivating

AFTER FIX:
[root@taft-01 LVM2]# lvcreate -m1 --corelog -L 700M -n lv vg
  Logical volume "lv" created
[root@taft-01 LVM2]# lvs -a -o name,devices vg
  LV            Devices                      
  lv            lv_mimage_0(0),lv_mimage_1(0)
  [lv_mimage_0] /dev/sdc1(0)                 
  [lv_mimage_1] /dev/sdd1(0)                 
[root@taft-01 LVM2]# lvconvert --mirrorlog core -m 0 vg/lv /dev/sdd1 
  Logical volume lv converted.
[root@taft-01 LVM2]# lvs -a -o name,devices vg
  LV   Devices     
  lv   /dev/sdc1(0)

Comment 3 Jonathan Earl Brassow 2011-09-13 21:46:46 UTC
git commit ID:
eb0af241f163c6a3cc179534836aa2c15dbd2b21

Comment 4 Corey Marthaler 2011-09-14 17:11:43 UTC
I was unable to reproduce this issue with the latest scratch built rpms.

2.6.32-195.el6.x86_64

lvm2-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-libs-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
lvm2-cluster-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
udev-147-2.38.el6    BUILT: Fri Sep  9 16:25:50 CDT 2011
device-mapper-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
device-mapper-event-libs-1.02.66-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011
cmirror-2.02.87-2.1.el6    BUILT: Wed Sep 14 09:44:16 CDT 2011



 [root@taft-01 ~]# lvcreate -m 1 --mirrorlog core -L 700M -n mirror taft
  Logical volume "mirror" created
[root@taft-01 ~]# lvs -a -o +devices
  LV                VG     Attr   LSize   Log Copy%  Devices                              
  mirror            taft   mwi-a- 700.00m     100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft   iwi-ao 700.00m            /dev/sdb1(0)                         
  [mirror_mimage_1] taft   iwi-ao 700.00m            /dev/sdc1(0)                         
[root@taft-01 ~]# lvconvert --mirrorlog core -m 0 taft/mirror /dev/sdc1
  Logical volume mirror converted.
[root@taft-01 ~]# lvs -a -o +devices
  LV      VG        Attr   LSize   Log Copy%  Convert Devices         
  mirror  taft      -wi-a- 700.00m                    /dev/sdb1(0)    


[root@taft-01 ~]# lvcreate -m 1 -L 700M -n mirror taft
  Logical volume "mirror" created
[root@taft-01 ~]# lvs -a -o +devices
  LV                VG     Attr   LSize   Log         Copy%  Devices                              
  mirror            taft   mwi-a- 700.00m mirror_mlog 100.00 mirror_mimage_0(0),mirror_mimage_1(0)
  [mirror_mimage_0] taft   iwi-ao 700.00m                    /dev/sdb1(0)                         
  [mirror_mimage_1] taft   iwi-ao 700.00m                    /dev/sdc1(0)                         
  [mirror_mlog]     taft   lwi-ao   4.00m                    /dev/sdh1(0)                         
[root@taft-01 ~]# lvconvert -m 0 taft/mirror /dev/sdc1
  Logical volume mirror converted.

Comment 6 Corey Marthaler 2011-09-26 22:43:40 UTC
Fix verified in the latest official rpms.

2.6.32-198.el6.x86_64

lvm2-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-libs-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
lvm2-cluster-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
udev-147-2.38.el6    BUILT: Fri Sep  9 16:25:50 CDT 2011
device-mapper-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
device-mapper-event-libs-1.02.66-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011
cmirror-2.02.87-3.el6    BUILT: Wed Sep 21 09:54:55 CDT 2011

Comment 7 Peter Rajnoha 2011-10-26 12:44:40 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:
Do not document.

Comment 8 errata-xmlrpc 2011-12-06 17:02:46 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-2011-1522.html


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