Bug 1741496 - linear to mirror conversion fails to divide extents correctly for certain lv sizes
Summary: linear to mirror conversion fails to divide extents correctly for certain lv ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: 8.0
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-15 09:59 UTC by Roman Bednář
Modified: 2021-09-07 11:50 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-15 07:43:56 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Roman Bednář 2019-08-15 09:59:04 UTC
Converting linear to mirror using lvconvert seems to fail in some cases. Depending on the size of linear lv used and number of stripes, the extents seem to be miscalculated in some cases making the conversion fail when the total number of extents requested is not divisible by stripe count. 

The failing conversions shown below should work because the size is specified in units (M) and not exact extent count.


# pvcreate /dev/sd[bcdefgh]1
 Physical volume "/dev/sdb1" successfully created.
 Physical volume "/dev/sdc1" successfully created.
 Physical volume "/dev/sdd1" successfully created.
 Physical volume "/dev/sde1" successfully created.
 Physical volume "/dev/sdf1" successfully created.
 Physical volume "/dev/sdg1" successfully created.
 Physical volume "/dev/sdh1" successfully created.
# vgcreate vg /dev/sd[bcdefgh]1
 Volume group "vg" successfully created


Working conversions:

# lvcreate -L 400M -n lv1 vg
 Logical volume "lv1" created.

# lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv1
 Using default stripesize 64.00 KiB.
 Logical volume vg/lv1 being converted.
 vg/lv1: Converted: 2.00%
 vg/lv1: Converted: 100.00%

=============================

# lvcreate -L 1g -n lv2 vg
 Logical volume "lv2" created.

# lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv2
 Using default stripesize 64.00 KiB.
 Logical volume vg/lv2 being converted.
 vg/lv2: Converted: 0.39%
 vg/lv2: Converted: 100.00%

=============================

# lvcreate -L 750m -n lv3 vg
 Rounding up size to full physical extent 752.00 MiB
 Logical volume "lv3" created.

# lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv3
 Using default stripesize 64.00 KiB.
 Logical volume vg/lv3 being converted.
 vg/lv3: Converted: 0.00%
 vg/lv3: Converted: 100.00%


Failing conversions:


# lvcreate -L 500M -n lv vg
 Logical volume "lv" created.

# lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv
 Using default stripesize 64.00 KiB.
 Number of extents requested (125) needs to be divisible by 4.
 Unable to allocate extents for mirror(s).

=============================

# lvcreate -L 600m -n lv4 vg
 Logical volume "lv4" created.
# lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv4
 Using default stripesize 64.00 KiB.
 Number of extents requested (150) needs to be divisible by 4.
 Unable to allocate extents for mirror(s).

=============================

# lvcreate -L 1100m -n lv5 vg
 Logical volume "lv5" created.
# lvconvert --type mirror --mirrors 1 --stripes 4 vg/lv5
 Using default stripesize 64.00 KiB.
 Number of extents requested (275) needs to be divisible by 4.
 Unable to allocate extents for mirror(s).



lvm2-2.03.05-2.el8.x86_64

Comment 3 RHEL Program Management 2021-02-15 07:43:56 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


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