Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2108239

Summary: vdo_block_map_era_length needs to report "out of range" when change option is invalid
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: VDO QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: agk, awalsh, heinzm, jbrassow, mcsontos, prajnoha, zkabelac
Version: 8.7Keywords: Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.03.14-9.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-16 09:11:54 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 Corey Marthaler 2022-07-18 16:27:54 UTC
Description of problem:
[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 16381' vdo_sanity/vdo_pool
  Logical volume vdo_sanity/vdo_pool changed.
  LV vdo_sanity/vdo_pool, segment 1 invalid: sets unsupported VDO block map era length for vdo-pool segment.
  Internal error: LV segments corrupted in vdo_pool.


[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 14381' vdo_sanity/vdo_pool
  Logical volume vdo_sanity/vdo_pool changed.

[root@hayes-01 ~]# lvs  -o vdo_block_map_era_length vdo_sanity/vdo_lv
  VDOBlockMapEraLength
                 14381


Version-Release number of selected component (if applicable):
lvm2-2.03.14-4.el8    BUILT: Wed Jun 15 17:14:34 CDT 2022
lvm2-libs-2.03.14-4.el8    BUILT: Wed Jun 15 17:14:34 CDT 2022

Comment 1 Zdenek Kabelac 2022-08-26 14:19:20 UTC
Enhanced range check on input parameters including this --vdosettings (but also applies to --config and metadata profiles)

https://listman.redhat.com/archives/lvm-devel/2022-July/024232.html

Comment 4 Corey Marthaler 2022-12-14 19:21:02 UTC
Marking Verified:Tested in the latest 8.8 rpms.

kernel-4.18.0-442.el8.v2    BUILT: Mon Dec  5 14:06:21 CST 2022
lvm2-2.03.14-9.el8    BUILT: Thu Dec  8 10:40:55 CST 2022
lvm2-libs-2.03.14-9.el8    BUILT: Thu Dec  8 10:40:55 CST 2022


[root@hayes-01 ~]# lvs -a -o +devices
  LV             VG         Attr       LSize  Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices        
  vdo_lv         vdo_sanity vwi-a-v---  2.00t vpool0        0.00                                    vpool0(0)      
  vpool0         vdo_sanity dwi------- 25.00g               12.06                                   vpool0_vdata(0)
  [vpool0_vdata] vdo_sanity Dwi-ao---- 25.00g                                                       /dev/sdh1(0)   

[root@hayes-01 ~]# lvs  -o vdo_block_map_era_length vdo_sanity/vdo_lv
  VDOBlockMapEraLength
                 16380


[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 16381' vdo_sanity/vdo_lv
  VDO block map era length 16381 is out of range [1..16380].
  Invalid argument for VDO setting "vdo_block_map_era_length".

[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 16381' vdo_sanity/vpool0
  VDO block map era length 16381 is out of range [1..16380].
  Invalid argument for VDO setting "vdo_block_map_era_length".

[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 16381' vdo_sanity/vpool0_vdata
  VDO minimum io size 0 is unsupported [512, 4096].
  VDO block map cache size 0 MiB is out of range [128..16777215].
  VDO block map era length 16381 is out of range [1..16380].
  VDO index memory size 0 MiB is out of range [256..1073741824].
  VDO slab size 0 MiB is out of range [128..32768].
  VDO max discard 0 is out of range [1..1048575].
  VDO bio threads 0 is out of range [1..100].
  VDO bio rotation 0 is out of range [1..1024].
  VDO cpu threads 0 is out of range [1..100].
  Invalid argument for VDO setting "vdo_block_map_era_length".

[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 1' vdo_sanity/vpool0
  Cannot change VDO settings for active VDO pool vdo_sanity/vpool0.
  VDO pool vdo_sanity/vpool0 with all its LVs needs to be deactivated.
[root@hayes-01 ~]# vgchange -an vdo_sanity
  0 logical volume(s) in volume group "vdo_sanity" now active
[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 1' vdo_sanity/vpool0
  Logical volume vdo_sanity/vpool0 changed.
[root@hayes-01 ~]#  lvs  -o vdo_block_map_era_length vdo_sanity/vdo_lv
  VDOBlockMapEraLength
                     1

[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 16379' vdo_sanity/vpool0
  Logical volume vdo_sanity/vpool0 changed.
[root@hayes-01 ~]#  lvs  -o vdo_block_map_era_length vdo_sanity/vdo_lv
  VDOBlockMapEraLength
                 16379

[root@hayes-01 ~]# lvchange --vdosettings 'vdo_block_map_era_length = 16381' vdo_sanity/vpool0
  VDO block map era length 16381 is out of range [1..16380].
  Invalid argument for VDO setting "vdo_block_map_era_length".

Comment 8 Corey Marthaler 2023-01-25 23:18:47 UTC
Marking VERIFIED in the latest.

kernel-4.18.0-449.el8.kpq0.g8c9e    BUILT: Fri Jan 13 16:20:45 CET 2023
lvm2-2.03.14-9.el8    BUILT: Thu Dec  8 17:40:55 CET 2022
lvm2-libs-2.03.14-9.el8    BUILT: Thu Dec  8 17:40:55 CET 2022


SCENARIO - offline_vdo_property_alteration:  Create a vdo volume, deactivate it, then change the supported OFFLINE properties post creation (bug 2100608|2070777|2108239) 
adding entry to the devices file for /dev/sda
creating PV on virt-520.cluster-qe.lab.eng.brq.redhat.com using device /dev/sda
pvcreate --yes -ff   /dev/sda
  Physical volume "/dev/sda" successfully created.
adding entry to the devices file for /dev/sdb
creating PV on virt-520.cluster-qe.lab.eng.brq.redhat.com using device /dev/sdb
pvcreate --yes -ff   /dev/sdb
  Physical volume "/dev/sdb" successfully created.
adding entry to the devices file for /dev/sdc
creating PV on virt-520.cluster-qe.lab.eng.brq.redhat.com using device /dev/sdc
pvcreate --yes -ff   /dev/sdc
  Physical volume "/dev/sdc" successfully created.
adding entry to the devices file for /dev/sdd
creating PV on virt-520.cluster-qe.lab.eng.brq.redhat.com using device /dev/sdd
pvcreate --yes -ff   /dev/sdd
  Physical volume "/dev/sdd" successfully created.
adding entry to the devices file for /dev/sde
creating PV on virt-520.cluster-qe.lab.eng.brq.redhat.com using device /dev/sde
pvcreate --yes -ff   /dev/sde
  Physical volume "/dev/sde" successfully created.
creating VG on virt-520.cluster-qe.lab.eng.brq.redhat.com using PV(s) /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde
vgcreate    vdo_sanity /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde
  Volume group "vdo_sanity" successfully created
lvcreate --yes --type linear -n vdo_pool  -L 10G vdo_sanity  
Logical volume "vdo_pool" created.

lvconvert --yes --type vdo-pool -n vdo_lv  -V100G vdo_sanity/vdo_pool
The VDO volume can address 6 GB in 3 data slabs, each 2 GB.
    It can grow to address at most 16 TB of physical storage in 8192 slabs.
    If a larger maximum size might be needed, use bigger slabs.
  Logical volume "vdo_lv" created.
  Converted vdo_sanity/vdo_pool to VDO pool volume and created virtual vdo_sanity/vdo_lv VDO volume.
WARNING: Converting logical volume vdo_sanity/vdo_pool to VDO pool volume with formating.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)

OFFLINE vdo alteration properties/limits to attempt:
vdo_ack_threads 100
vdo_bio_rotation 1024
vdo_bio_threads 100
vdo_cpu_threads 100
vdo_hash_zone_threads 100
vdo_logical_threads 60
vdo_max_discard 1048575
vdo_physical_threads 16
vdo_block_map_era_length 16380

deactivating LV vdo_lv on virt-520.cluster-qe.lab.eng.brq.redhat.com
lvchange --yes -an  vdo_sanity/vdo_lv

[vdo_ack_threads]
LIMIT attempt vdo_ack_threads setting for /dev/vdo_sanity/vdo_lv: 100
lvchange --vdosettings 'vdo_ack_threads=101' /dev/vdo_sanity/vdo_lv
VDO ack threads 101 is out of range [0..100].
  Invalid argument for VDO setting "vdo_ack_threads".
CURRENT vdo_ack_threads for /dev/vdo_sanity/vdo_lv: 1
lvchange --vdosettings 'vdo_ack_threads=2' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_ack_threads setting for /dev/vdo_sanity/vdo_lv: 2

[vdo_bio_rotation]
LIMIT attempt vdo_bio_rotation setting for /dev/vdo_sanity/vdo_lv: 1024
lvchange --vdosettings 'vdo_bio_rotation=1025' /dev/vdo_sanity/vdo_lv
VDO bio rotation 1025 is out of range [1..1024].
  Invalid argument for VDO setting "vdo_bio_rotation".
CURRENT vdo_bio_rotation for /dev/vdo_sanity/vdo_lv: 64
lvchange --vdosettings 'vdo_bio_rotation=65' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_bio_rotation setting for /dev/vdo_sanity/vdo_lv: 65

[vdo_bio_threads]
LIMIT attempt vdo_bio_threads setting for /dev/vdo_sanity/vdo_lv: 100
lvchange --vdosettings 'vdo_bio_threads=101' /dev/vdo_sanity/vdo_lv
VDO bio threads 101 is out of range [1..100].
  Invalid argument for VDO setting "vdo_bio_threads".
CURRENT vdo_bio_threads for /dev/vdo_sanity/vdo_lv: 4
lvchange --vdosettings 'vdo_bio_threads=5' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_bio_threads setting for /dev/vdo_sanity/vdo_lv: 5

[vdo_cpu_threads]
LIMIT attempt vdo_cpu_threads setting for /dev/vdo_sanity/vdo_lv: 100
lvchange --vdosettings 'vdo_cpu_threads=101' /dev/vdo_sanity/vdo_lv
VDO cpu threads 101 is out of range [1..100].
  Invalid argument for VDO setting "vdo_cpu_threads".
CURRENT vdo_cpu_threads for /dev/vdo_sanity/vdo_lv: 2
lvchange --vdosettings 'vdo_cpu_threads=3' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_cpu_threads setting for /dev/vdo_sanity/vdo_lv: 3

[vdo_hash_zone_threads]
LIMIT attempt vdo_hash_zone_threads setting for /dev/vdo_sanity/vdo_lv: 100
lvchange --vdosettings 'vdo_hash_zone_threads=101' /dev/vdo_sanity/vdo_lv
VDO hash zone threads 101 is out of range [0..100].
  Invalid argument for VDO setting "vdo_hash_zone_threads".
CURRENT vdo_hash_zone_threads for /dev/vdo_sanity/vdo_lv: 1
lvchange --vdosettings 'vdo_hash_zone_threads=2' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_hash_zone_threads setting for /dev/vdo_sanity/vdo_lv: 2

[vdo_logical_threads]
LIMIT attempt vdo_logical_threads setting for /dev/vdo_sanity/vdo_lv: 60
lvchange --vdosettings 'vdo_logical_threads=61' /dev/vdo_sanity/vdo_lv
VDO logical threads 61 is out of range [0..60].
  Invalid argument for VDO setting "vdo_logical_threads".
CURRENT vdo_logical_threads for /dev/vdo_sanity/vdo_lv: 1
lvchange --vdosettings 'vdo_logical_threads=2' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_logical_threads setting for /dev/vdo_sanity/vdo_lv: 2

[vdo_max_discard]
LIMIT attempt vdo_max_discard setting for /dev/vdo_sanity/vdo_lv: 1048575
lvchange --vdosettings 'vdo_max_discard=1048576' /dev/vdo_sanity/vdo_lv
VDO max discard 1048576 is out of range [1..1048575].
  Invalid argument for VDO setting "vdo_max_discard".
CURRENT vdo_max_discard for /dev/vdo_sanity/vdo_lv: 1
lvchange --vdosettings 'vdo_max_discard=2' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_max_discard setting for /dev/vdo_sanity/vdo_lv: 2

[vdo_physical_threads]
LIMIT attempt vdo_physical_threads setting for /dev/vdo_sanity/vdo_lv: 16
lvchange --vdosettings 'vdo_physical_threads=17' /dev/vdo_sanity/vdo_lv
VDO physical threads 17 is out of range [0..16].
  Invalid argument for VDO setting "vdo_physical_threads".
CURRENT vdo_physical_threads for /dev/vdo_sanity/vdo_lv: 1
lvchange --vdosettings 'vdo_physical_threads=2' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_physical_threads setting for /dev/vdo_sanity/vdo_lv: 2

[vdo_block_map_era_length]
LIMIT attempt vdo_block_map_era_length setting for /dev/vdo_sanity/vdo_lv: 16380
lvchange --vdosettings 'vdo_block_map_era_length=16381' /dev/vdo_sanity/vdo_lv
VDO block map era length 16381 is out of range [1..16380].
  Invalid argument for VDO setting "vdo_block_map_era_length".
CURRENT vdo_block_map_era_length for /dev/vdo_sanity/vdo_lv: 16380
lvchange --vdosettings 'vdo_block_map_era_length=16379' /dev/vdo_sanity/vdo_lv
  Logical volume vdo_sanity/vdo_lv changed.
ALTERED vdo_block_map_era_length setting for /dev/vdo_sanity/vdo_lv: 16379

lvremove  -f vdo_sanity/vdo_lv
Logical volume "vdo_lv" successfully removed.

removing vg vdo_sanity from virt-520.cluster-qe.lab.eng.brq.redhat.com
  Volume group "vdo_sanity" successfully removed
removing pv /dev/sda on virt-520.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sda" successfully wiped.
removing entry from the devices file for /dev/sda
removing pv /dev/sdb on virt-520.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sdb" successfully wiped.
removing entry from the devices file for /dev/sdb
removing pv /dev/sdc on virt-520.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sdc" successfully wiped.
removing entry from the devices file for /dev/sdc
removing pv /dev/sdd on virt-520.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sdd" successfully wiped.
removing entry from the devices file for /dev/sdd
removing pv /dev/sde on virt-520.cluster-qe.lab.eng.brq.redhat.com
  Labels on physical volume "/dev/sde" successfully wiped.
removing entry from the devices file for /dev/sde

Comment 10 errata-xmlrpc 2023-05-16 09:11:54 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-2023:3048