Bug 710618
Summary: | mirrored stripe volume gets corrupted when reduce only alters one leg | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Corey Marthaler <cmarthal> | |
Component: | lvm2 | Assignee: | Milan Broz <mbroz> | |
Status: | CLOSED ERRATA | QA Contact: | Corey Marthaler <cmarthal> | |
Severity: | urgent | Docs Contact: | ||
Priority: | urgent | |||
Version: | 5.7 | CC: | agk, coughlan, dwysocha, heinzm, jbrassow, martinez, mbroz, prajnoha, prockai, pvrabec, thornber, zkabelac | |
Target Milestone: | rc | |||
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | lvm2-2.02.84-6.el5 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 723065 (view as bug list) | Environment: | ||
Last Closed: | 2011-07-21 10:50:30 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: | 723065 |
Description
Corey Marthaler
2011-06-03 20:51:16 UTC
This issue most likely exists in RHEL6.1 as well. First bug is in lvreduce (I've not looked beyond that). Reproduced with upstream code. vg_validate() needs fixing to detect metadata corruption like this as well. When it hit the error: Segment extent reduction 57not divisible by #stripes 7 it should have either aborted the operation (or rounded the size to something compatible, maybe earlier in the code) instead of carrying on and writing out corrupted metadata. (1) fix vg_validate to ensure that if a segment is mirrored, the size of every mimage matches (2) fix lvreduce to abort if it gets that error instead of ignoring it (3) fix the rounding logic to check all segments and round the size appropriately (common factor logic) - the only difficult part of this fix Item (1) should be sufficient to avoid the corruption; item (2) gives a clean error; item (3) makes the command work as intended. reproducer: lvcreate -i2; lvconvert -m1; lvreduce -l1 then compare LSize in lvs -a I'll add at least 1) + 2) to 5.7 so it cannot corrupt VG metadata. Fixed in lvm2-2.02.84-5.el5 lvm2-cluster-2.02.84-5.el5 full fix included. Roundig up logic hopefully fixed in lvm2-2.02.84-6.el5 Fix verified in the latest rpms. 2.6.18-266.el5 lvm2-2.02.84-6.el5 BUILT: Thu Jun 16 10:31:15 CDT 2011 lvm2-cluster-2.02.84-6.el5 BUILT: Thu Jun 16 10:32:56 CDT 2011 device-mapper-1.02.63-3.el5 BUILT: Thu May 19 08:09:22 CDT 2011 device-mapper-event-1.02.63-3.el5 BUILT: Thu May 19 08:09:22 CDT 2011 cmirror-1.1.39-10.el5 BUILT: Wed Sep 8 16:32:05 CDT 2010 kmod-cmirror-0.1.22-3.el5 BUILT: Tue Dec 22 13:39:47 CST 2009 [root@taft-01 ~]# pvcreate /dev/sd[bc][12356] Physical volume "/dev/sdb1" successfully created Physical volume "/dev/sdb2" successfully created Physical volume "/dev/sdb3" successfully created Physical volume "/dev/sdb5" successfully created Physical volume "/dev/sdb6" successfully created Physical volume "/dev/sdc1" successfully created Physical volume "/dev/sdc2" successfully created Physical volume "/dev/sdc3" successfully created Physical volume "/dev/sdc5" successfully created Physical volume "/dev/sdc6" successfully created [root@taft-01 ~]# vgcreate grant /dev/sd[bc][12356] Volume group "grant" successfully created [root@taft-01 ~]# lvcreate -L 1G --stripes 7 --stripesize 512 -n stripe grant Rounding size (256 extents) up to stripe boundary size (259 extents) Logical volume "stripe" created [root@taft-01 ~]# lvs -a -o +devices LV VG Attr LSize Devices stripe grant -wi-a- 1.01G /dev/sdb1(0),/dev/sdb2(0),/dev/sdb3(0),/dev/sdb5(0),/dev/sdb6(0),/dev/sdc1(0),/dev/sdc2(0) [root@taft-01 ~]# lvconvert -m 1 grant/stripe grant/stripe: Converted: 0.4% grant/stripe: Converted: 25.1% grant/stripe: Converted: 50.2% grant/stripe: Converted: 75.7% grant/stripe: Converted: 100.0% [root@taft-01 ~]# lvs -a -o +devices LV VG Attr LSize Log Copy% Devices stripe grant mwi-a- 1.01G stripe_mlog 100.00 stripe_mimage_0(0),stripe_mimage_1(0) [stripe_mimage_0] grant iwi-ao 1.01G /dev/sdb1(0),/dev/sdb2(0),/dev/sdb3(0),/dev/sdb5(0),/dev/sdb6(0),/dev/sdc1(0),/dev/sdc2(0) [stripe_mimage_1] grant iwi-ao 1.01G /dev/sdc3(0) [stripe_mlog] grant lwi-ao 4.00M /dev/sdc6(0) [root@taft-01 ~]# lvdisplay grant/stripe | grep Current Current LE 259 [root@taft-01 ~]# lvreduce -f -l 202 grant/stripe Rounding size (202 extents) up to stripe boundary size for segment (203 extents) WARNING: Reducing active logical volume to 812.00 MB THIS MAY DESTROY YOUR DATA (filesystem etc.) Reducing logical volume stripe to 812.00 MB Logical volume stripe successfully resized [root@taft-01 ~]# echo $? 0 [root@taft-01 ~]# lvdisplay grant/stripe | grep Current Current LE 203 [root@taft-01 ~]# lvextend -l 241 grant/stripe Extending 2 mirror images. Using stripesize of last segment 512.00 KB Rounding size (241 extents) down to stripe boundary size for segment (238 extents) Extending logical volume stripe to 952.00 MB Not enough PVs with free space available for parallel allocation. Consider --alloc anywhere if desperate. [root@taft-01 ~]# lvs -a -o +devices LV VG Attr LSize Log Copy% Devices stripe grant mwi-a- 812.00M stripe_mlog 100.00 stripe_mimage_0(0),stripe_mimage_1(0) [stripe_mimage_0] grant iwi-ao 812.00M /dev/sdb1(0),/dev/sdb2(0),/dev/sdb3(0),/dev/sdb5(0),/dev/sdb6(0),/dev/sdc1(0),/dev/sdc2(0) [stripe_mimage_1] grant iwi-ao 812.00M /dev/sdc3(0) [stripe_mlog] grant lwi-ao 4.00M /dev/sdc6(0) [root@taft-01 ~]# vgchange -an grant 0 logical volume(s) in volume group "grant" now active [root@taft-01 ~]# lvremove grant Logical volume "stripe" successfully removed 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-2011-1071.html 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-2011-1071.html |