From f92b6f99305a31fe0e12b836942ec429c4828869 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 2 Mar 2018 22:07:14 +0100 Subject: [PATCH] lvremove: ensure no subLV is active Since component activation is going to be enabled, enusure, no subLV is active when we deactivate LV. --- lib/metadata/lv_manip.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index ff82b2d36..a1fc0ffa8 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. - * Copyright (C) 2004-2017 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved. * * This file is part of LVM2. * @@ -6086,12 +6086,9 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, /* Used cache pool, COW or historical LV cannot be activated */ if (!lv_is_used_cache_pool(lv) && !lv_is_cow(lv) && !lv_is_historical(lv) && - !deactivate_lv(cmd, lv)) { + !deactivate_lv_with_sub_lv(lv)) /* FIXME Review and fix the snapshot error paths! */ - log_error("Unable to deactivate logical volume %s.", - display_lvname(lv)); - return 0; - } + return_0; if (!archive(vg)) return 0; -- 2.43.5