Bug 481793 - Attempting to vgsplit a base PV into a VG stacked on top causes a seg fault
Attempting to vgsplit a base PV into a VG stacked on top causes a seg fault
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
5.3
All Linux
medium Severity medium
: rc
: ---
Assigned To: Petr Rockai
Cluster QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-27 12:05 EST by Corey Marthaler
Modified: 2010-03-30 05:01 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 05:01:52 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Corey Marthaler 2009-01-27 12:05:19 EST
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 12:32:34 EST
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 12:33:56 EST
Created attachment 330126 [details]
core file
Comment 3 Corey Marthaler 2009-01-29 17:12:07 EST
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 10:12:21 EST
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 05:07:13 EDT
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-15 20:05:25 EDT
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 02:31:49 EDT
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 17:46:09 EDT
Fixed in upstream, testcase included.
Comment 12 Milan Broz 2009-11-12 06:33:12 EST
Fix in lvm2-2_02_54-1_el5.
Comment 15 Corey Marthaler 2010-02-03 14:35:42 EST
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 05:01:52 EDT
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.