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
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)
Created attachment 330126 [details] core file
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)
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.
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...
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
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.
Fixed in upstream, testcase included.
Fix in lvm2-2_02_54-1_el5.
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.
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