Bug 2070393
| Summary: | In pvdisplay, "not usable" size is inconsistent, and not correct for two metadatacopies | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | bjorn l. <bl_fedora> |
| Component: | lvm2 | Assignee: | LVM Team <lvm-team> |
| lvm2 sub component: | Displaying and Reporting | QA Contact: | cluster-qe <cluster-qe> |
| Status: | NEW --- | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | medium | CC: | agk, heinzm, jbrassow, msnitzer, prajnoha, teigland, zkabelac |
| Version: | --- | Keywords: | Triaged |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 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 of problem: When creating a PV with '--metadatacopies 2', the calculation of "not usable" space for pvdisplay is incorrect. In file lib/display/display.c, the following comparison is made: if (pv->size > data_size + pv->pe_start) { pvsize = pv->size; unusable = pvsize - data_size; } But if there are two copies of metadata, this will always yield a "not usable" amount equivalent to the space allocated to the two metadata copies. It seems that there should be a test for pv_mda_count, and if equal to two, subtract (pv_mda_size+pv->pe_start) from the unusable amount. [pv_mda_size is the smallest of the two metadata areas. But that seems sufficient: the most efficient is for both metadata areas to be the same size. But the first metadata space may be rounded up to preserve alignment. The alternative is to check for the size of the second metadata copy. But I don't know if it is as readily available, and besides, it wouldn't help if it is bigger than the first metadata copy.] As for the inconsistency: even for one metadata copy, the 'not usable' space includes the space of the one metadata copy. It seems that pv->pe_start should be subtracted from the "not usable" space. [Also, I am not sure when the 'else' clause gets triggered, other than when pv->size is equal to the sum of data_size and pv->pe_start, and the not usable space is zero.] Version-Release number of selected component (if applicable): Current master branch, after lvm2 Release 2.03.15 How reproducible: Steps to Reproduce: 1. Create PV with '--metadatacopies 2' 2. Create VG 3. Run pvdisplay Actual results: Shows "not usable" amount that does not correspond to not usable amount Expected results: Additional info: