From c3e674ad3010d21dc2cbde27b7634f7ea4fe67e3 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 1 Nov 2013 10:28:42 +0100 Subject: [PATCH] activation: _lv_activate is ok when filtered. If the volume_list filters out volume from activation, it is still success result for this function. Change the error message back to verbose level. Detect if the volume is active localy before zeroing, so we report error a bit later for cases, where volume could not be activated because it doesn't pass through volume list (but user still could create volume when he disables zeroing) --- WHATS_NEW | 1 + lib/activate/activate.c | 5 +++-- lib/metadata/lv_manip.c | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 2bf95d21e..ff8da1d17 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.104 - =================================== + Return success when LV cannot be activated because of volume_list filter. Return proper error state for remote exclusive activation. Fix missing lvmetad scan for PVs found on MD partitions. Respect DM_UDEV_DISABLE_OTHER_RULES_FLAG in lvmetad udev rules. diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 006681e12..7e6a5aca7 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -2029,8 +2029,9 @@ static int _lv_activate(struct cmd_context *cmd, const char *lvid_s, goto out; if (filter && !_passes_activation_filter(cmd, lv)) { - log_error("Not activating %s/%s since it does not pass " - "activation filter.", lv->vg->name, lv->name); + log_verbose("Not activating %s/%s since it does not pass " + "activation filter.", lv->vg->name, lv->name); + r = 1; goto out; } diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 88fceb2b7..020b365a1 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -5381,6 +5381,12 @@ int set_lv(struct cmd_context *cmd, struct logical_volume *lv, struct device *dev; char *name; + if (!lv_is_active_locally(lv)) { + log_error("Volume \"%s/%s\" is not active locally.", + lv->vg->name, lv->name); + return 0; + } + /* * FIXME: * also, more than 4k