From: Zdenek Kabelac Date: Fri, 1 Nov 2013 09:26:43 +0000 (+0100) Subject: locking: activate_lv_excl return correct error code X-Git-Tag: v2_02_104~10 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1bde9f68cea61c7ee085588f2595ed52277da084;p=lvm2.git locking: activate_lv_excl return correct error code Correct return code of activate_lv_excl(). Function is not supposed to return activation state of activated volume, but return code of the operation. Since i.e. when activation filter is allowing to activate volume on current system, it is still success even though no volume is activated. --- diff --git a/WHATS_NEW b/WHATS_NEW index b8a9bf784..2bf95d21e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.104 - =================================== + 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. Fix clvmd message verification to not reject REMOTE flag. (2.02.100) diff --git a/lib/locking/locking.c b/lib/locking/locking.c index 9183ee68e..9433e4027 100644 --- a/lib/locking/locking.c +++ b/lib/locking/locking.c @@ -559,10 +559,10 @@ int activate_lv_excl(struct cmd_context *cmd, struct logical_volume *lv) return 1; /* FIXME Deal with error return codes. */ - if (activate_lv_excl_remote(cmd, lv)) - stack; + if (!activate_lv_excl_remote(cmd, lv)) + return_0; - return lv_is_active_exclusive(lv); + return 1; } /* Lock a list of LVs */