Bug 481793 - Attempting to vgsplit a base PV into a VG stacked on top causes a seg fault
Summary: Attempting to vgsplit a base PV into a VG stacked on top causes a seg fault
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2
Version: 5.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Petr Rockai
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-27 17:05 UTC by Corey Marthaler
Modified: 2010-03-30 09:01 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 09:01:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
core file (632.00 KB, application/octet-stream)
2009-01-27 17:33 UTC, Corey Marthaler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0298 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2010-03-29 15:16:34 UTC

Description Corey Marthaler 2009-01-27 17:05:19 UTC
Description of problem:
[root@hayes-03 ~]# pvscan
  PV /dev/etherd/e1.1p2   VG baseB           lvm2 [1.77 TB / 1.77 TB free]
  PV /dev/etherd/e1.1p1   VG baseA           lvm2 [1.77 TB / 1.77 TB free]
  PV /dev/baseA/baseA     VG top             lvm2 [496.00 MB / 496.00 MB free]
  PV /dev/baseB/baseB     VG top             lvm2 [496.00 MB / 496.00 MB free]
  PV /dev/etherd/e1.1p3   VG top             lvm2 [1.77 TB / 1.77 TB free]
  PV /dev/sda2            VG VolGroup00      lvm2 [74.38 GB / 0    free]
  PV /dev/etherd/e1.1p4                      lvm2 [1.77 TB]
  PV /dev/etherd/e1.1p5                      lvm2 [1.77 TB]

[root@hayes-03 ~]# vgchange -an top
  0 logical volume(s) in volume group "top" now active

[root@hayes-03 ~]# vgchange -an baseA
  0 logical volume(s) in volume group "baseA" now active

[root@hayes-03 ~]# vgsplit baseA top /dev/etherd/e1.1p1
  Couldn't find device with uuid 'A0dakQ-xeLf-Gmv0-fwl1-6z2g-SU8f-EtTfKB'.
  Couldn't find device with uuid 'A0dakQ-xeLf-Gmv0-fwl1-6z2g-SU8f-EtTfKB'.
Segmentation fault

Jan 27 10:46:17 hayes-03 kernel: vgsplit[14050]: segfault at 0000000000000010 rip 0000000000429324 rsp 00007fffc553ec70 error 4

I didn't see a corefile, I'll try and reproduce this and grab one.

Version-Release number of selected component (if applicable):
2.6.18-128.el5

lvm2-2.02.40-6.el5    BUILT: Fri Oct 24 07:37:33 CDT 2008
lvm2-cluster-2.02.40-7.el5    BUILT: Wed Nov 26 07:19:19 CST 2008
device-mapper-1.02.28-2.el5    BUILT: Fri Sep 19 02:50:32 CDT 2008

Comment 1 Corey Marthaler 2009-01-27 17:32:34 UTC
I Was able to repo this with a core, I'll attach it.

[root@hayes-03 ~]# vgsplit base1 top /dev/etherd/e1.1p1
  Couldn't find device with uuid 'L09k0F-aK8Q-TUQf-pJoQ-aZb4-u5bn-2kQ7yI'.
Segmentation fault (core dumped)

Comment 2 Corey Marthaler 2009-01-27 17:33:56 UTC
Created attachment 330126 [details]
core file

Comment 3 Corey Marthaler 2009-01-29 22:12:07 UTC
FWIW, the same thing happens if you attempt to split off an LV into a VG stacked above it.

[root@hayes-03 cache]# vgsplit -n /dev/base1/base1 base1 top
  Couldn't find device with uuid 'uj1DY7-qJKZ-Ssn8-uTsC-z1Fh-2kJc-ZXmfp8'.
Segmentation fault (core dumped)

Comment 4 Peter Rajnoha 2009-02-03 15:12:21 UTC
Segmentation fault is caused by null dereference in 'pv_uses_vg' function that is responsible for checking if a PV uses VG somewhere in its construction. Since the base VG with all LVs is deactivated (baseA), the PV constructed from this LV (/dev/baseA/baseA) is disabled as well and couldn't be found causing the PV's device beeing set to null value. We should check for this value in PV's structure that defines underlying device and return from 'pv_uses_vg' with error immediately if such situation occurs.

Comment 6 Peter Rajnoha 2009-06-01 09:07:13 UTC
Finally, the problem was solved by providing another solution from Peter (the other one :)) which incorporates more advanced checks. But it depends on new code that is not added to upstream yet...

Comment 7 Tom Coughlan 2009-06-16 00:05:25 UTC
Peter,

Is the fix in 5.4? If so, which BZ has the fix? We'll close this as a dup.

If this is not in 5.4, it will likely have to wait for 5.5. You should add a release note to 5.4 describing the problem. 

Tom

Comment 8 Petr Rockai 2009-06-16 06:31:49 UTC
No, unfortunately the fix for this is waiting for vg_read getting through review. Peter, if you could write the release note and when you are done, assign the bug to me? Or if you prefer, just reassign it to me and I'll look into that release note thing myself.

Comment 11 Petr Rockai 2009-08-02 21:46:09 UTC
Fixed in upstream, testcase included.

Comment 12 Milan Broz 2009-11-12 11:33:12 UTC
Fix in lvm2-2_02_54-1_el5.

Comment 15 Corey Marthaler 2010-02-03 19:35:42 UTC
Verified that the segfault is no longer present in lvm2-2.02.56-6.el5. That said, this operation still doesn't work due to bug 481657.

Comment 17 errata-xmlrpc 2010-03-30 09:01:52 UTC
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-2010-0298.html


Note You need to log in before you can comment on or make changes to this bug.