Bug 440405
| Summary: | lvconvert -m0 fails when a PV is specified and all extents on the PV are allocated | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 4 | Reporter: | Bryn M. Reeves <bmr> | ||||
| Component: | lvm2 | Assignee: | Bryn M. Reeves <bmr> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Corey Marthaler <cmarthal> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | medium | ||||||
| Version: | 4.6 | CC: | agk, dwysocha, edamato, heinzm, jbrassow, mbroz, prockai | ||||
| Target Milestone: | rc | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | RHBA-2008-0776 | Doc Type: | Bug Fix | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2008-07-24 20:08:00 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Bug Depends On: | |||||||
| Bug Blocks: | 443060 | ||||||
| Attachments: |
|
||||||
Created attachment 300237 [details]
Don't pass allocatable=1 to create_pv_list in lvconvert
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. 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 |
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.