Prompt if request is made to remove a snapshot whose "Merge failed". --- WHATS_NEW | 1 + lib/metadata/lv_manip.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) Index: lvm2/lib/metadata/lv_manip.c =================================================================== --- lvm2.orig/lib/metadata/lv_manip.c +++ lvm2/lib/metadata/lv_manip.c @@ -3271,7 +3271,7 @@ int lv_remove_with_dependencies(struct c if (lv_is_cow(lv)) { /* * A merging snapshot cannot be removed directly unless - * it has been invalidated. + * it has been invalidated or failed merge removal is requested. */ if (lv_is_merging_cow(lv) && !level) { if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) && @@ -3283,6 +3283,13 @@ int lv_remove_with_dependencies(struct c lv->name); return 0; } + 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') { + log_error("Logical volume %s not removed.", lv->name); + return 0; + } } } } Index: lvm2/WHATS_NEW =================================================================== --- lvm2.orig/WHATS_NEW +++ lvm2/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Prompt if request is made to remove a snapshot whose "Merge failed". Allow removal of an invalid snapshot that was to be merged on next activation. Don't allow a user to merge an invalid snapshot. Use m and M lv_attr to indicate that a snapshot merge failed in lvs.