Bug 733320
Summary: | lvresize: When resizing striped LV it should align the size up instead of down | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Lukáš Czerner <lczerner> |
Component: | lvm2 | Assignee: | Petr Rockai <prockai> |
Status: | CLOSED ERRATA | QA Contact: | Corey Marthaler <cmarthal> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 6.2 | CC: | agk, coughlan, dwysocha, heinzm, jbrassow, mbroz, prajnoha, prockai, thornber, zkabelac |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | lvm2-2.02.87-3.el6 | Doc Type: | Bug Fix |
Doc Text: |
When striped logical volume was resized with the lvresize command, the size was aligned to the stripe boundary down. This could pose a problem when shrinking the volume with file system on it, because even if we computed the new size so that the file system did fit entirely onto the volume and resized it, the alignment done by the lvresize might have cut off a part of the file system and hence it might have corrupted it. To fix this, the rounding has been corrected for striped volumes so the volume never reduces more than requested.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2011-12-06 17:02:42 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: | 743047 |
Description
Lukáš Czerner
2011-08-25 13:16:30 UTC
When reducing, the logic for lvresize should indeed be identical to lvreduce. Rounding should always be done in the 'safe' direction. There was a recent fix: Fix extent rounding for striped volumes never to reduce more than requested - perhaps this case was missed? BTW, the problem is upstream as well. Thanks! -Lukas yes, the case is missed. rounding logic is there but the condition which trigger it seems to be incomplete. This should work now: [root@node-a ~]# lvcreate --name test -L 2G -i 3 -I 32 vg Rounding size (512 extents) up to stripe boundary size (513 extents) Logical volume "test" created [root@node-a ~]# lvresize -L 1077936128b /dev/vg/test Rounding size (257 extents) up to stripe boundary size for segment (258 extents) Reducing logical volume test to 1.01 GiB Logical volume test successfully resized is now the same as lvreduce: [root@node-a ~]# lvreduce -L 1077936128b /dev/vg/test Rounding size (257 extents) up to stripe boundary size for segment (258 extents) Reducing logical volume test to 1.01 GiB Logical volume test successfully resized Adding QA ack for this 6.2 blocker. Devel test results in comment #5. Fix verified in the latest rpms. 2.6.32-201.el6.x86_64 lvm2-2.02.87-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 lvm2-libs-2.02.87-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 lvm2-cluster-2.02.87-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 udev-147-2.40.el6 BUILT: Fri Sep 23 07:51:13 CDT 2011 device-mapper-1.02.66-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 device-mapper-libs-1.02.66-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 device-mapper-event-1.02.66-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 device-mapper-event-libs-1.02.66-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 cmirror-2.02.87-3.el6 BUILT: Wed Sep 21 09:54:55 CDT 2011 [root@hayes-01 ~]# lvcreate -v -n stripe -L 2G -i 3 -I 32 hayes Setting logging type to disk Finding volume group "hayes" Rounding size (512 extents) up to stripe boundary size (513 extents) [...] Logical volume "stripe" created [root@hayes-01 ~]# lvs -a -o +devices LV VG Attr LSize Origin Snap% Move Log Copy% Convert Devices stripe hayes -wi-a- 2.00g /dev/etherd/e1.1p1(0),/dev/etherd/e1.1p2(0),/dev/etherd/e1.1p3(0) [root@hayes-01 ~]# lvresize -v -L1077936128b /dev/hayes/stripe Finding volume group hayes Rounding size (257 extents) up to stripe boundary size for segment (258 extents) [...] Logical volume stripe successfully resized [root@hayes-01 ~]# lvreduce -L 1077936128b /dev/hayes/stripe Rounding size (257 extents) up to stripe boundary size for segment (258 extents) [...] Do you really want to reduce stripe? [y/n]: y Reducing logical volume stripe to 1.01 GiB Logical volume stripe successfully resized Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: When striped logical volume was resized with the lvresize command, the size was aligned to the stripe boundary down. This could pose a problem when shrinking the volume with file system on it, because even if we computed the new size so that the file system did fit entirely onto the volume and resized it, the alignment done by the lvresize might have cut off a part of the file system and hence it might have corrupted it. To fix this, the rounding has been corrected for striped volumes so the volume never reduces more than requested. 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. http://rhn.redhat.com/errata/RHBA-2011-1522.html |