Bug 1438457

Summary: Lvconvert is not validating acceptable LV type at correct level
Product: Red Hat Enterprise Linux 7 Reporter: Zdenek Kabelac <zkabelac>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Mirroring and RAID QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, prockai, teigland, zkabelac
Version: 7.4   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.170-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 21:52:19 UTC Type: Bug
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 2017-04-03 13:05:43 UTC
Description of problem:

It seems ATM lvm2 169 is not properly rejecting this command:

lvconvert --thinpool vg/LV1_rimage_0


It should prohibit LV with _rimage_0 suffix at cmd line level.
But since this check has been lost - we let conversion running for rimage leg.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Corey Marthaler 2017-05-23 19:58:17 UTC
Fix verified with the latest rpms.

3.10.0-666.el7.x86_64
lvm2-2.02.171-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
lvm2-libs-2.02.171-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
lvm2-cluster-2.02.171-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-libs-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-event-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-event-libs-1.02.140-1.el7    BUILT: Wed May  3 07:05:13 CDT 2017
device-mapper-persistent-data-0.7.0-0.1.rc6.el7    BUILT: Mon Mar 27 10:15:46 CDT 2017


Attempted the following invalid meta convert combinations:
[root@host-126 ~]# lvs -a -o +devices
  LV                 VG            Attr       LSize   Pool Origin Data%  Meta% Cpy%Sync Devices
  invalid            snapper_thinp rwi-a-r--- 100.00m                          100.00   invalid_rimage_0(0),invalid_rimage_1(0)
  [invalid_rimage_0] snapper_thinp iwi-aor--- 100.00m                                   /dev/sdb1(26)
  [invalid_rimage_1] snapper_thinp iwi-aor--- 100.00m                                   /dev/sda1(1)
  [invalid_rmeta_0]  snapper_thinp ewi-aor---   4.00m                                   /dev/sdb1(25)
  [invalid_rmeta_1]  snapper_thinp ewi-aor---   4.00m                                   /dev/sda1(0)
  valid              snapper_thinp -wi-a----- 100.00m                                   /dev/sdb1(0)

[root@host-126 ~]#  lvconvert --yes --thinpool snapper_thinp/invalid_rimage_0
  Command on LV snapper_thinp/invalid_rimage_0 requires LV with properties: lv_is_visible .
  Command not permitted on LV snapper_thinp/invalid_rimage_0.

[root@host-126 ~]# lvconvert --yes --thinpool snapper_thinp/invalid_rimage_1 --poolmetadata valid
  Command on LV snapper_thinp/invalid_rimage_1 requires LV with properties: lv_is_visible .
  Command not permitted on LV snapper_thinp/invalid_rimage_1.

[root@host-126 ~]# lvconvert --yes --thinpool snapper_thinp/invalid_rmeta_1 --poolmetadata snapper_thinp/valid
  Command on LV snapper_thinp/invalid_rmeta_1 requires LV with properties: lv_is_visible .
  Command not permitted on LV snapper_thinp/invalid_rmeta_1.

[root@host-126 ~]# lvconvert --yes --thinpool snapper_thinp/valid --poolmetadata snapper_thinp/invalid_rimage_0
  Can't convert internal LV snapper_thinp/invalid_rimage_0.

[root@host-126 ~]# lvconvert --yes --thinpool snapper_thinp/valid --poolmetadata snapper_thinp/invalid_rmeta_0
  Can't convert internal LV snapper_thinp/invalid_rmeta_0.

Comment 5 errata-xmlrpc 2017-08-01 21:52:19 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.

https://access.redhat.com/errata/RHBA-2017:2222