diff --git a/WHATS_NEW b/WHATS_NEW index ae945386d..7375f5aaf 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.91 - =================================== + Fix test for snap percent for failing merge when removing LV. Switch int to void return for str_list_del(). Fix error path handling in _build_desc(). Add range test for device number in _scan_proc_dev(). diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 337401d20..252a5563e 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -3315,14 +3315,14 @@ int lv_remove_with_dependencies(struct cmd_context *cmd, struct logical_volume * if (lv_is_merging_cow(lv) && !level) { if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) && info.exists && info.live_table) { - if (lv_snapshot_percent(lv, &snap_percent) && - ((snap_percent != PERCENT_INVALID) && - (snap_percent != PERCENT_MERGE_FAILED))) { + if (!lv_snapshot_percent(lv, &snap_percent)) + return_0; + if ((snap_percent != PERCENT_INVALID) && + (snap_percent != PERCENT_MERGE_FAILED)) { log_error("Can't remove merging snapshot logical volume \"%s\"", lv->name); return 0; - } - else if ((snap_percent == PERCENT_MERGE_FAILED) && + } else if ((snap_percent == PERCENT_MERGE_FAILED) && (force == PROMPT) && yes_no_prompt("Removing snapshot \"%s\" that failed to merge may leave origin \"%s\" inconsistent. " "Proceed? [y/n]: ", lv->name, origin_from_cow(lv)->name) == 'n') {