Bug 1354549
| Summary: | lvconvert segfaults when target PV is specified | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Roman Bednář <rbednar> |
| Component: | lvm2 | Assignee: | Alasdair Kergon <agk> |
| lvm2 sub component: | Default / Unclassified | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | unspecified | ||
| Priority: | unspecified | CC: | agk, cmarthal, heinzm, jbrassow, lmiksik, msnitzer, prajnoha, prockai, zkabelac |
| Version: | 7.3 | ||
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.164-4.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2016-11-04 04:15:15 UTC | Type: | Bug |
| 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: | 1353860 | ||
|
Description
Roman Bednář
2016-07-11 14:18:09 UTC
WFM in upstream confirmed. definitely fails if you specify a bad PV. [root@bp-02 ~]# lvs -a -o name,vgname,segtype,devices vg LV VG Type Devices lv vg raid1 lv_rimage_0(0),lv_rimage_1(0),lv_rimage_2(0) [lv_rimage_0] vg linear /dev/sdb1(1) [lv_rimage_1] vg linear /dev/sdc1(1) [lv_rimage_2] vg linear /dev/sdd1(1) [lv_rmeta_0] vg linear /dev/sdb1(0) [lv_rmeta_1] vg linear /dev/sdc1(0) [lv_rmeta_2] vg linear /dev/sdd1(0) [root@bp-02 ~]# lvconvert --yes --splitmirrors 1 --trackchanges vg/lv /dev/sde1 Segmentation fault [root@bp-02 ~]# lvconvert --yes --splitmirrors 1 --trackchanges vg/lv /dev/sdd1 WARNING: Reading VG vg from disk because lvmetad metadata is invalid. lv_rimage_2 split from lv for read-only purposes. Use 'lvconvert --merge vg/lv_rimage_2' to merge back into lv [Note the OP's got some inconsistent information... splitting off mirror_lv_rimage_3 when no such sub-LV existed in the LV. Suggested likely error from bad input.] 1) If you get a segfault, you should install the debug package and obtain a backtrace from gdb and include that with the bug report. 2) If you find an lvm command goes wrong or doesn't do what you expected, you should run it with -vvvv (or equivalent logging) and include that with the bug report. That additional information will sometimes be sufficient for us to understand what the problem is and even to fix it. So in this case we have this backtrace:
(gdb) bt
#0 lv_raid_split_and_track (lv=0x7ffff8327490, splittable_pvs=0x7ffff831df78) at ../../lib/metadata/raid_manip.c:1508
#1 0x00007ffff7e4e34a in _lvconvert_raid (lv=0x7ffff8327490, lp=0x7fffffffd800) at ../../tools/lvconvert.c:1911
#2 0x00007ffff7e5666c in _convert_raid_splitmirrors (cmd=0x7ffff8230170, lv=0x7ffff8327490, lp=0x7fffffffd800) at ../../tools/lvconvert.c:3793
#3 0x00007ffff7e57361 in _convert_raid (cmd=0x7ffff8230170, lv=0x7ffff8327490, lp=0x7fffffffd800) at ../../tools/lvconvert.c:4282
#4 0x00007ffff7e57fb8 in _lvconvert (cmd=0x7ffff8230170, lv=0x7ffff8327490, lp=0x7fffffffd800) at ../../tools/lvconvert.c:4536
#5 0x00007ffff7e58201 in _lvconvert_and_add_to_poll_list (cmd=0x7ffff8230170, lp=0x7fffffffd800, lv=0x7ffff8327490) at ../../tools/lvconvert.c:4591
#6 0x00007ffff7e58514 in _lvconvert_single (cmd=0x7ffff8230170, lv=0x7ffff8327490, handle=0x7ffff8284408) at ../../tools/lvconvert.c:4635
#7 0x00007ffff7e81849 in process_each_lv_in_vg (cmd=0x7ffff8230170, vg=0x7ffff8326b00, arg_lvnames=0x7fffffffd5c0, tags_in=0x7fffffffd750, stop_on_error=0, handle=0x7ffff8284408,
process_single_lv=0x7ffff7e58337 <_lvconvert_single>) at ../../tools/toollib.c:2505
#8 0x00007ffff7e82907 in _process_lv_vgnameid_list (cmd=0x7ffff8230170, read_flags=1048576, vgnameids_to_process=0x7fffffffd710, arg_vgnames=0x7fffffffd740, arg_lvnames=0x7fffffffd730, arg_tags=0x7fffffffd750,
handle=0x7ffff8284408, process_single_lv=0x7ffff7e58337 <_lvconvert_single>) at ../../tools/toollib.c:2830
#9 0x00007ffff7e83015 in process_each_lv (cmd=0x7ffff8230170, argc=0, argv=0x0, one_vgname=0x7ffff8284430 "vg99", one_lvname=0x7fffffffe01d "lvol0", read_flags=1048576, handle=0x7ffff8284408,
process_single_lv=0x7ffff7e58337 <_lvconvert_single>) at ../../tools/toollib.c:2976
#10 0x00007ffff7e58762 in lvconvert (cmd=0x7ffff8230170, argc=2, argv=0x7fffffffdbd0) at ../../tools/lvconvert.c:4681
#11 0x00007ffff7e683f9 in lvm_run_command (cmd=0x7ffff8230170, argc=2, argv=0x7fffffffdbd0) at ../../tools/lvmcmdline.c:1723
#12 0x00007ffff7e69d2d in lvm2_main (argc=6, argv=0x7fffffffdbb0) at ../../tools/lvmcmdline.c:2249
#13 0x00007ffff7e9700c in main (argc=7, argv=0x7fffffffdba8) at ../../tools/lvm.c:22
which takes you straight to this code:
for (s = seg->area_count - 1; s >= 0; --s) {
...
}
if (s >= (int) seg->area_count) {
log_error("Unable to find image to satisfy request");
where the two things contradict each other: s counts down, not up.
It *is* a regression introduced by commit 9ee071705b2c35e1132f39f5731861c831a1bb6b which misunderstood some unusual code when applying our policy of not mixing signed and unsigned. Would have been better to rewrite it more clearly. https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=2fde4399a01a002437d6d882c7faa59221aca93e https://www.redhat.com/archives/lvm-devel/2016-August/msg00105.html Fix verified in the latest rpms. # 7.2 (lvm2-2.02.130-5) [root@host-128 ~]# lvs -a -o +devices LV VG Attr LSize Cpy%Sync Devices split_tracking test rwi-a-r--- 500.00m 100.00 split_tracking_rimage_0(0),split_tracking_rimage_1(0),split_tracking_rimage_2(0) [split_tracking_rimage_0] test iwi-aor--- 500.00m /dev/sda1(1) [split_tracking_rimage_1] test iwi-aor--- 500.00m /dev/sda2(1) [split_tracking_rimage_2] test iwi-aor--- 500.00m /dev/sdb1(1) [split_tracking_rmeta_0] test ewi-aor--- 4.00m /dev/sda1(0) [split_tracking_rmeta_1] test ewi-aor--- 4.00m /dev/sda2(0) [split_tracking_rmeta_2] test ewi-aor--- 4.00m /dev/sdb1(0) [root@host-128 ~]# lvconvert --yes --splitmirrors 1 --trackchanges test/split_tracking /dev/sde1 Segmentation fault (core dumped) # latest 7.3 (lvm2-2.02.165-1) [root@host-127 ~]# lvs -a -o +devices LV VG Attr LSize Cpy%Sync Devices split_tracking split_image rwi-a-r--- 500.00m 100.00 split_tracking_rimage_0(0),split_tracking_rimage_1(0),split_tracking_rimage_2(0) [split_tracking_rimage_0] split_image iwi-aor--- 500.00m /dev/sdc1(1) [split_tracking_rimage_1] split_image iwi-aor--- 500.00m /dev/sdh1(1) [split_tracking_rimage_2] split_image iwi-aor--- 500.00m /dev/sdd1(1) [split_tracking_rmeta_0] split_image ewi-aor--- 4.00m /dev/sdc1(0) [split_tracking_rmeta_1] split_image ewi-aor--- 4.00m /dev/sdh1(0) [split_tracking_rmeta_2] split_image ewi-aor--- 4.00m /dev/sdd1(0) [root@host-127 ~]# lvconvert --yes --splitmirrors 1 --trackchanges split_image/split_tracking /dev/sde1 Unable to find image to satisfy request 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 |