1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-28 02:50:41 +03:00

raid_manip: 'vgreduce --removemissing --force ...' segfaults on raid0 LV

An unconditional access to the non-existing MetaLV of a raid0 LV in
lv_raid_remove_missing() was causing the segfault.

Only call log_debug() on replacements of existing MetaLVs.

- resolves rhbz1354646
This commit is contained in:
Heinz Mauelshagen 2016-07-12 17:55:01 +02:00
parent c77c59f3d9
commit 9c27573493

@ -3090,8 +3090,11 @@ int lv_raid_remove_missing(struct logical_volume *lv)
(!seg->meta_areas || !seg_metalv(seg, s) || !lv_is_partial(seg_metalv(seg, s))))
continue;
log_debug("Replacing %s and %s segments with error target",
seg_lv(seg, s)->name, seg_metalv(seg, s)->name);
log_debug("Replacing %s segments with error target",
display_lvname(seg_lv(seg, s)));
if (seg->meta_areas && seg_metalv(seg, s))
log_debug("Replacing %s segments with error target",
display_lvname(seg_metalv(seg, s)));
if (!replace_lv_with_error_segment(seg_lv(seg, s))) {
log_error("Failed to replace %s's extents with error target.",
display_lvname(seg_lv(seg, s)));