Bug 1356734 - raid0 replace attempt segfaults
Summary: raid0 replace attempt segfaults
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-14 21:40 UTC by Corey Marthaler
Modified: 2016-11-04 04:15 UTC (History)
7 users (show)

Fixed In Version: lvm2-2.02.161-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 04:15:53 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1445 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2016-11-03 13:46:41 UTC

Description Corey Marthaler 2016-07-14 21:40:12 UTC
Description of problem:
[root@host-082 ~]# lvcreate --type raid0 -i 2 -n raid0 -L 500M test
  Using default stripesize 64.00 KiB.
  Rounding size 500.00 MiB (125 extents) up to stripe boundary size 504.00 MiB (126 extents).
WARNING: ext4 signature detected on /dev/test/raid0 at offset 1080. Wipe it? [y/n]: y
  Wiping ext4 signature on /dev/test/raid0.
  Logical volume "raid0" created.

[root@host-082 ~]# pvscan
  PV /dev/sda1  VG test  lvm2 [12.50 GiB / 12.25 GiB free]
  PV /dev/sdb1  VG test  lvm2 [12.50 GiB / 12.25 GiB free]
  PV /dev/sdc1  VG test  lvm2 [12.50 GiB / 12.50 GiB free]
  PV /dev/sdd1  VG test  lvm2 [12.50 GiB / 12.50 GiB free]
  PV /dev/sde1  VG test  lvm2 [12.50 GiB / 12.50 GiB free]
  PV /dev/sdf1  VG test  lvm2 [12.50 GiB / 12.50 GiB free]
  PV /dev/sdg1  VG test  lvm2 [12.50 GiB / 12.50 GiB free]
  PV /dev/sdh1  VG test  lvm2 [12.50 GiB / 12.50 GiB free]

[root@host-082 ~]# lvs -a -o +devices
  LV               VG    Attr       LSize   Devices                            
  raid0            test  rwi-a-r--- 504.00m raid0_rimage_0(0),raid0_rimage_1(0)
  [raid0_rimage_0] test  iwi-aor--- 252.00m /dev/sda1(0)                       
  [raid0_rimage_1] test  iwi-aor--- 252.00m /dev/sdb1(0)                       


[root@host-082 ~]# lvconvert --replace /dev/sda1 test/raid0 /dev/sdg1
Segmentation fault (core dumped)

Jul 14 16:36:40 host-082 kernel: lvconvert[23430]: segfault at 0 ip 00007f148bea8aa8 sp 00007fffca49f0e0 error 4 in lvm[7f148bdcb000+193000]


Core was generated by `lvconvert --replace /dev/sda1 VG1/raid0_1 /dev/sdg1'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007fd7d88e3aa8 in lv_raid_replace (lv=lv@entry=0x7fd7d902ac38, remove_pvs=0x7fd7d8fa2490, allocate_pvs=0x7fd7d8fa2410) at metadata/raid_manip.c:2859
2859                    if ((seg_type(raid_seg, s) == AREA_UNASSIGNED) ||
Missing separate debuginfos, use: debuginfo-install bzip2-libs-1.0.6-13.el7.x86_64 elfutils-libelf-0.163-3.el7.x86_64 elfutils-libs-0.163-3.el7.x86_64 glibc-2.17-105.el7.x86_64 libattr-2.4.46-12.el7.x86_64 libblkid-2.23.2-26.el7.x86_64 libcap-2.22-8.el7.x86_64 libgcc-4.8.5-4.el7.x86_64 libselinux-2.2.2-6.el7.x86_64 libsepol-2.1.9-3.el7.x86_64 libuuid-2.23.2-26.el7.x86_64 ncurses-libs-5.9-13.20130511.el7.x86_64 pcre-8.32-15.el7.x86_64 readline-6.2-9.el7.x86_64 systemd-libs-219-21.el7.x86_64 xz-libs-5.1.2-12alpha.el7.x86_64 zlib-1.2.7-15.el7.x86_64
(gdb) bt
#0  0x00007fd7d88e3aa8 in lv_raid_replace (lv=lv@entry=0x7fd7d902ac38, remove_pvs=0x7fd7d8fa2490, allocate_pvs=0x7fd7d8fa2410) at metadata/raid_manip.c:2859
#1  0x00007fd7d8838afe in _lvconvert_raid (lv=lv@entry=0x7fd7d902ac38, lp=lp@entry=0x7fffe68e1d80) at lvconvert.c:1890
#2  0x00007fd7d883b6ef in _convert_striped_raid (cmd=<optimized out>, lp=0x7fffe68e1d80, lv=0x7fd7d902ac38) at lvconvert.c:3974
#3  _convert_striped (lp=<optimized out>, lv=<optimized out>, cmd=<optimized out>) at lvconvert.c:4272
#4  _lvconvert (lp=0x7fffe68e1d80, lv=0x7fd7d902ac38, cmd=0x7fd7d8f56020) at lvconvert.c:4388
#5  _lvconvert_and_add_to_poll_list (cmd=0x7fd7d8f56020, lp=0x7fffe68e1d80, lv=0x7fd7d902ac38) at lvconvert.c:4434
#6  0x00007fd7d8861336 in process_each_lv_in_vg (cmd=cmd@entry=0x7fd7d8f56020, vg=vg@entry=0x7fd7d9029e40, arg_lvnames=arg_lvnames@entry=0x7fffe68e1bf0, 
    tags_in=tags_in@entry=0x7fffe68e1ba0, stop_on_error=stop_on_error@entry=0, handle=handle@entry=0x7fd7d8fa21b8, 
    process_single_lv=process_single_lv@entry=0x7fd7d883cac0 <_lvconvert_single>) at toollib.c:2502
#7  0x00007fd7d8862639 in _process_lv_vgnameid_list (process_single_lv=0x7fd7d883cac0 <_lvconvert_single>, handle=0x7fd7d8fa21b8, arg_tags=0x7fffe68e1ba0, arg_lvnames=0x7fffe68e1bc0, 
    arg_vgnames=0x7fffe68e1bb0, vgnameids_to_process=0x7fffe68e1be0, read_flags=1048576, cmd=0x7fd7d8f56020) at toollib.c:2827
#8  process_each_lv (cmd=cmd@entry=0x7fd7d8f56020, argc=argc@entry=0, argv=argv@entry=0x0, one_vgname=<optimized out>, one_lvname=<optimized out>, read_flags=read_flags@entry=1048576, 
    handle=handle@entry=0x7fd7d8fa21b8, process_single_lv=process_single_lv@entry=0x7fd7d883cac0 <_lvconvert_single>) at toollib.c:2973
#9  0x00007fd7d883e594 in lvconvert (cmd=0x7fd7d8f56020, argc=<optimized out>, argv=0x7fffe68e2230) at lvconvert.c:4524
#10 0x00007fd7d884b8e9 in lvm_run_command (cmd=cmd@entry=0x7fd7d8f56020, argc=2, argc@entry=5, argv=0x7fffe68e2230, argv@entry=0x7fffe68e2218) at lvmcmdline.c:1715
#11 0x00007fd7d884c490 in lvm2_main (argc=5, argv=0x7fffe68e2218) at lvmcmdline.c:2184
#12 0x00007fd7d7548b15 in __libc_start_main () from /lib64/libc.so.6
#13 0x00007fd7d882ff91 in _start ()




Version-Release number of selected component (if applicable):
3.10.0-468.el7.x86_64

lvm2-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
lvm2-libs-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
lvm2-cluster-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-libs-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-event-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-event-libs-1.02.130-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
device-mapper-persistent-data-0.6.2-0.1.rc8.el7    BUILT: Wed May  4 02:56:34 CDT 2016
cmirror-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016
sanlock-3.3.0-1.el7    BUILT: Wed Feb 24 09:52:30 CST 2016
sanlock-lib-3.3.0-1.el7    BUILT: Wed Feb 24 09:52:30 CST 2016
lvm2-lockd-2.02.160-1.el7    BUILT: Wed Jul  6 11:16:47 CDT 2016


How reproducible:
Everytime

Comment 1 Heinz Mauelshagen 2016-07-18 18:17:49 UTC
Fixed to prohibit any replacement of raid0 SubLVs.

Upstream commit 94207dfd68ca426d7cd4a8a0dc84e5a955d3a6d9

Comment 3 Corey Marthaler 2016-07-21 19:30:50 UTC
Fix verified in the latest rpms.

[root@host-082 ~]# lvs -a -o +devices
  LV               VG    Attr       LSize   Cpy%Sync Convert Devices
  raid0            test  rwi-a-r--- 504.00m                  raid0_rimage_0(0),raid0_rimage_1(0)
  [raid0_rimage_0] test  iwi-aor--- 252.00m                  /dev/sda1(0)
  [raid0_rimage_1] test  iwi-aor--- 252.00m                  /dev/sdb1(0)

[root@host-082 ~]# lvconvert --replace /dev/sda1 test/raid0 /dev/sdg1
  Can't replace any devices in raid0 LV test/raid0


3.10.0-468.el7.x86_64
lvm2-2.02.161-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
lvm2-libs-2.02.161-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
lvm2-cluster-2.02.161-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
device-mapper-1.02.131-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
device-mapper-libs-1.02.131-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
device-mapper-event-1.02.131-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
device-mapper-event-libs-1.02.131-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
device-mapper-persistent-data-0.6.2-1.el7    BUILT: Mon Jul 11 04:32:34 CDT 2016
cmirror-2.02.161-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016
sanlock-3.4.0-1.el7    BUILT: Fri Jun 10 11:41:03 CDT 2016
sanlock-lib-3.4.0-1.el7    BUILT: Fri Jun 10 11:41:03 CDT 2016
lvm2-lockd-2.02.161-2.el7    BUILT: Wed Jul 20 07:48:14 CDT 2016

Comment 5 errata-xmlrpc 2016-11-04 04:15:53 UTC
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.

https://rhn.redhat.com/errata/RHBA-2016-1445.html


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