Bug 753914
Summary: | Improve handling of devices that get resized after pvcreate, detect smaller size | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Dave Wysochanski <dwysocha> | ||||
Component: | lvm2 | Assignee: | Peter Rajnoha <prajnoha> | ||||
lvm2 sub component: | Devices, Filtering and Stacking (RHEL6) | QA Contact: | cluster-qe <cluster-qe> | ||||
Status: | CLOSED ERRATA | Docs Contact: | |||||
Severity: | medium | ||||||
Priority: | high | CC: | agk, cmarthal, dwysocha, heinzm, jbrassow, kkolakow, nperic, prajnoha, prockai, rbednar, thornber, zkabelac | ||||
Version: | 6.1 | Keywords: | Patch | ||||
Target Milestone: | rc | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | lvm2-2.02.141-1.el6 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2016-05-11 01:19:12 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: | 756082, 1172231, 1268411 | ||||||
Attachments: |
|
Description
Dave Wysochanski
2011-11-14 20:48:18 UTC
Initial patchset here: https://www.redhat.com/archives/lvm-devel/2011-November/msg00074.html An updated proposal is needed, taking into account comments in the email thread. Looking at the original patchset and Alasdairs comments, we could even control the checks per PV with the infrastructure we have now - the PV header extensions and the flags there. As for caching the actual dev size, I don't see a problem here either. We could do this in this release window finally I suppose. Patches are upstream now: https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=d090d6574e455625ad4e2a1a6f3d93f5c663b097 https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=1f5dfb7369600c169ecd2c78e0cd079ad1442548 https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=c0912af3104cb72ea275d90b8b1d68a25a9ca48a https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=136fd8f2f642c82b132ded4b9a95b05e822e9117 https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=bc8f8ac0facc610c3252eb9af592b9c63a935ce2 In summary: - device sizes are cached now for reuse to save resources a bit (there are filters which already get the device size so most of the time the size is cached at that moment) - lifetime of cached device sizes are limited to a point when all the VG locks are dropped (we already do dev_close_all at this moment too) - there's a warning message issued if device size is found to be less than PV size stored in metadata (when reading VGs and when adding PVs to a VG) - there's new metadata/check_pv_device_sizes lvm.conf option to enable or disable these checks and warnings (they're enabled by default) For example: # pvcreate --setphysicalvolumesize 200m /dev/sda WARNING: /dev/sda: Overriding real size. You could lose data. Physical volume "/dev/sda" successfully created # pvs -o pv_name,dev_size,pv_size /dev/sda PV DevSize PSize /dev/sda 128.00m 200.00m # vgcreate vg /dev/sda Device /dev/sda has size of 262144 sectors which is smaller than corresponding PV size of 409600 sectors. Was device resized? Volume group "vg" successfully created # pvs/vgs/lvs Device /dev/sda has size of 262144 sectors which is smaller than corresponding PV size of 409600 sectors. Was device resized? One or more devices used as PVs in VG vg have changed sizes. ... Created attachment 1123149 [details]
test results
Verified. Test results in attachment. 2.6.32-614.el6.x86_64 lvm2-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 lvm2-libs-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 lvm2-cluster-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 udev-147-2.71.el6 BUILT: Wed Feb 10 14:07:17 CET 2016 device-mapper-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-libs-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-event-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-event-libs-1.02.115-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 device-mapper-persistent-data-0.6.2-0.1.rc1.el6 BUILT: Wed Feb 10 16:52:15 CET 2016 cmirror-2.02.141-2.el6 BUILT: Wed Feb 10 14:49:03 CET 2016 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, 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://rhn.redhat.com/errata/RHBA-2016-0964.html |