Bug 440405 - lvconvert -m0 fails when a PV is specified and all extents on the PV are allocated
Summary: lvconvert -m0 fails when a PV is specified and all extents on the PV are allo...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2
Version: 4.6
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Bryn M. Reeves
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On:
Blocks: 443060
TreeView+ depends on / blocked
 
Reported: 2008-04-03 12:34 UTC by Bryn M. Reeves
Modified: 2018-10-19 22:07 UTC (History)
7 users (show)

Fixed In Version: RHBA-2008-0776
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-24 20:08:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Don't pass allocatable=1 to create_pv_list in lvconvert (456 bytes, patch)
2008-04-03 12:36 UTC, Bryn M. Reeves
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0776 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2008-07-23 17:19:45 UTC

Description Bryn M. Reeves 2008-04-03 12:34:30 UTC
Description of problem:
When converting a mirrored LV to linear using "lvconvert -m0", if the PV to
remove is specified on the command line and that PV is completely allocated,
lvconvert fails with "No free extents on physical volume".

Version-Release number of selected component (if applicable):
lvm2-2.02.27-2.el4, upstream CVS

How reproducible:
100%

Steps to Reproduce:
1. lvcreate -l <PV SIZE> -n l0 -m1 mvg0 /dev/pv0 /dev/pv1 /dev/pv2:0
2. lvconvert -m0 mvg0/l0 /dev/pv0

  
Actual results:
# lvconvert -m0 mvg0/m0 /dev/pv0
  No free extents on physical volume "/dev/pv0"
  No specified PVs have space available


Expected results:
# lvconvert -m0 mvg0/m0 /dev/pv0
  Logical volume m0 converted.


Additional info:
Looked into this with Marco and we found that this is happening here:

The problem is caused by this check in _create_pv_entry() function
./tools/toollib.c:_create_pv_entry():

       if (allocatable_only &&
           (pvl->pv->pe_count == pvl->pv->pe_alloc_count)) {
               log_err("No free extents on physical volume "%s"", pvname);
               return 1;
       }

Since converting to a linear volume does not require any new extent allocations
this check is invalid.

Forcing allocatable=0 in the debugger allows the command to complete without
error and produces the expected result.

Marco checked with Nick who couldn't see a problem with making this change -
patch from Marco attached.

Comment 1 Bryn M. Reeves 2008-04-03 12:36:14 UTC
Created attachment 300237 [details]
Don't pass allocatable=1 to create_pv_list in lvconvert

Comment 8 Corey Marthaler 2008-06-30 15:51:17 UTC
Fix verified in lvm2-2.02.37-3.el4.

[root@taft-03 dev]# lvcreate -L 135.66G -n mirror -m 1 taft /dev/sdb1 /dev/sdc1
/dev/sdd1:0
  Rounding up size to full physical extent 135.66 GB
  Logical volume "mirror" created

[root@taft-03 dev]# lvconvert -m 0 taft/mirror /dev/sdb1
  Logical volume mirror converted.

Comment 10 errata-xmlrpc 2008-07-24 20:08:00 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2008-0776.html


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