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 1806068 - erroneous lvol created when attempting to use already in use writecache pool internal volume as a dm-cache pool
Summary: erroneous lvol created when attempting to use already in use writecache pool ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.2
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: rc
: 8.0
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-21 22:32 UTC by Corey Marthaler
Modified: 2021-09-07 11:55 UTC (History)
8 users (show)

Fixed In Version: lvm2-2.03.09-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 02:00:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4546 0 None None None 2020-11-04 02:00:42 UTC

Description Corey Marthaler 2020-02-21 22:32:09 UTC
Description of problem:
This is similar to earlier bug 1806063, but instead of attempting to use the in-use internal cvol for another writecache volume, it's attempted to be used as a dm-cache pool.

[root@host-092 ~]# lvcreate --wipesignatures y  -L 1G -n origin_1 writecache_sanity @slow
  Logical volume "origin_1" created.
[root@host-092 ~]# lvcreate --wipesignatures y  -L 1G -n origin_2 writecache_sanity @slow
  Logical volume "origin_2" created.
[root@host-092 ~]# lvcreate  -L 1G -n multiple_origins writecache_sanity @fast
  Logical volume "multiple_origins" created.

[root@host-092 ~]# lvs -a -o +devices
  LV               VG                Attr       LSize   Pool   Origin  Devices        
  multiple_origins writecache_sanity -wi-a-----   1.00g                /dev/sdd1(0)   
  origin_1         writecache_sanity -wi-a-----   1.00g                /dev/sdc1(0)   
  origin_2         writecache_sanity -wi-a-----   1.00g                /dev/sdc1(256) 

[root@host-092 ~]# lvchange -an writecache_sanity
[root@host-092 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/multiple_origins writecache_sanity/origin_1
  Logical volume writecache_sanity/origin_1 now has write cache.

[root@host-092 ~]# lvs -a -o +devices,segtype
  LV                      VG                Attr       LSize   Pool                    Origin             Devices            Type      
  [multiple_origins_cvol] writecache_sanity Cwi---C---   1.00g                                            /dev/sdd1(0)       linear    
  origin_1                writecache_sanity Cwi---C---   1.00g [multiple_origins_cvol] [origin_1_wcorig]  origin_1_wcorig(0) writecache
  [origin_1_wcorig]       writecache_sanity owi---C---   1.00g                                            /dev/sdc1(0)       linear    
  origin_2                writecache_sanity -wi-------   1.00g                                            /dev/sdc1(256)     linear    

# Attempt to create dm-cache using same in-use internal volume (writecache_sanity/multiple_origins) and origin_2
[root@host-092 ~]# lvconvert --yes --type cache --cachepool writecache_sanity/multiple_origins_cvol writecache_sanity/origin_2
  WARNING: Converting writecache_sanity/multiple_origins_cvol to cache pool's data volume with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Cannot rename internal LV "multiple_origins_cvol".
  LV writecache_sanity/multiple_origins_cvol could not be converted to a cache pool.

# This results in erroneous lvols
[root@host-092 ~]# lvs -a -o +devices
  LV                      VG                Attr       LSize   Pool                    Origin             Devices           
  lvol0                   writecache_sanity -wi-------   8.00m                                            /dev/sdb1(0)      
  [multiple_origins_cvol] writecache_sanity Cwi---C---   1.00g                                            /dev/sdd1(0)      
  origin_1                writecache_sanity Cwi---C---   1.00g [multiple_origins_cvol] [origin_1_wcorig]  origin_1_wcorig(0)
  [origin_1_wcorig]       writecache_sanity owi---C---   1.00g                                            /dev/sdc1(0)      
  origin_2                writecache_sanity -wi-------   1.00g                                            /dev/sdc1(256)    

[root@host-092 ~]# lvconvert --yes --type cache --cachepool writecache_sanity/multiple_origins_cvol writecache_sanity/origin_2
  WARNING: Converting writecache_sanity/multiple_origins_cvol to cache pool's data volume with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Cannot rename internal LV "multiple_origins_cvol".
  LV writecache_sanity/multiple_origins_cvol could not be converted to a cache pool.

[root@host-092 ~]# lvconvert --yes --type cache --cachepool writecache_sanity/multiple_origins_cvol writecache_sanity/origin_2
  WARNING: Converting writecache_sanity/multiple_origins_cvol to cache pool's data volume with metadata wiping.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Cannot rename internal LV "multiple_origins_cvol".
  LV writecache_sanity/multiple_origins_cvol could not be converted to a cache pool.

[root@host-092 ~]# lvs -a -o +devices
  LV                      VG                Attr       LSize   Pool                    Origin             Devices           
  lvol0                   writecache_sanity -wi-------   8.00m                                            /dev/sdb1(0)      
  lvol1                   writecache_sanity -wi-------   8.00m                                            /dev/sdb1(2)      
  lvol2                   writecache_sanity -wi-------   8.00m                                            /dev/sdb1(4)      
  [multiple_origins_cvol] writecache_sanity Cwi---C---   1.00g                                            /dev/sdd1(0)      
  origin_1                writecache_sanity Cwi---C---   1.00g [multiple_origins_cvol] [origin_1_wcorig]  origin_1_wcorig(0)
  [origin_1_wcorig]       writecache_sanity owi---C---   1.00g                                            /dev/sdc1(0)      
  origin_2                writecache_sanity -wi-------   1.00g                                            /dev/sdc1(256)    


Version-Release number of selected component (if applicable):
kernel-4.18.0-179.el8    BUILT: Fri Feb 14 17:03:01 CST 2020
lvm2-2.03.08-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
lvm2-libs-2.03.08-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
lvm2-dbusd-2.03.08-1.el8    BUILT: Tue Feb 11 07:42:51 CST 2020
lvm2-lockd-2.03.08-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
boom-boot-1.0-1.el8    BUILT: Fri Nov 29 05:18:30 CST 2019
device-mapper-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
device-mapper-libs-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
device-mapper-event-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
device-mapper-event-libs-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020


How reproducible:
Everytime

Comment 1 David Teigland 2020-05-22 19:13:42 UTC
fix in master:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=74a211cfd30e93d9388de5ac1ee22e630c840e94

[root@null-01 lvm.git]# lvs -a test
  LV                VG   Attr       LSize  Pool              Origin        
  main              test Cwi---C--- 64.00m [main_cache_cvol] [main_wcorig]
  main2             test -wi------- 32.00m                                
  [main_cache_cvol] test Cwi---C--- 40.00m                                
  [main_wcorig]     test owi---C--- 64.00m           

[root@null-01 lvm.git]# lvconvert --type writecache --cachevol test/main_cache_cvol test/main2 
  LV test/main_cache_cvol is already used as a cachevol.

[root@null-01 lvm.git]# lvconvert --type cache --cachepool test/main_cache_cvol test/main2 
  LV test/main_cache_cvol is already used as a cachevol.

[root@null-01 lvm.git]# lvconvert --type cache --cachevol test/main_cache_cvol test/main2 
  LV test/main_cache_cvol is already used as a cachevol.

Comment 5 Corey Marthaler 2020-06-15 22:49:05 UTC
Fix verified in the latest rpms.

kernel-4.18.0-208.el8    BUILT: Thu May 28 09:44:03 CDT 2020
lvm2-2.03.09-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
lvm2-libs-2.03.09-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
lvm2-dbusd-2.03.09-2.el8    BUILT: Fri May 29 11:32:49 CDT 2020
lvm2-lockd-2.03.09-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
boom-boot-1.1-2.el8    BUILT: Tue May 26 08:45:48 CDT 2020
device-mapper-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
device-mapper-libs-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
device-mapper-event-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
device-mapper-event-libs-1.02.171-2.el8    BUILT: Fri May 29 11:29:58 CDT 2020
device-mapper-persistent-data-0.8.5-3.el8    BUILT: Wed Nov 27 07:05:21 CST 2019


[root@hayes-03 ~]# lvs -a -o +devices
  LV                      VG                Attr       LSize Pool                    Origin            Data%  Meta%  Move Log Cpy%Sync Convert Devices           
  [multiple_origins_cvol] writecache_sanity Cwi---C--- 1.00g                                                                                   /dev/sdh1(0)      
  origin_1                writecache_sanity Cwi---C--- 1.00g [multiple_origins_cvol] [origin_1_wcorig]                                         origin_1_wcorig(0)
  [origin_1_wcorig]       writecache_sanity owi---C--- 1.00g                                                                                   /dev/sdf1(0)      
  origin_2                writecache_sanity -wi------- 1.00g                                                                                   /dev/sdf1(256)    
  origin_3                writecache_sanity -wi------- 1.00g                                                                                   /dev/sdf1(512)    
[root@hayes-03 ~]# 
[root@hayes-03 ~]# lvconvert --yes --type cache --cachepool writecache_sanity/multiple_origins_cvol writecache_sanity/origin_2
  LV writecache_sanity/multiple_origins_cvol is already used as a cachevol.
[root@hayes-03 ~]# lvs -a -o +devices,segtype
  LV                      VG                Attr       LSize Pool                    Origin            Data%  Meta%  Move Log Cpy%Sync Convert Devices            Type      
  [multiple_origins_cvol] writecache_sanity Cwi---C--- 1.00g                                                                                   /dev/sdh1(0)       linear    
  origin_1                writecache_sanity Cwi---C--- 1.00g [multiple_origins_cvol] [origin_1_wcorig]                                         origin_1_wcorig(0) writecache
  [origin_1_wcorig]       writecache_sanity owi---C--- 1.00g                                                                                   /dev/sdf1(0)       linear    
  origin_2                writecache_sanity -wi------- 1.00g                                                                                   /dev/sdf1(256)     linear    
  origin_3                writecache_sanity -wi------- 1.00g                                                                                   /dev/sdf1(512)     linear

Comment 8 errata-xmlrpc 2020-11-04 02:00:25 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 (lvm2 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4546


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