diff --git a/WHATS_NEW b/WHATS_NEW index e389a36b6..567441a6d 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Relase memory and unblock signals in lock_vol error path. Define LVM2_* command errors in lvm2cmd.h and use in dmeventd plugins. Move errors.h to tools dir. Add man page entries for profile configuration and related options. diff --git a/lib/locking/locking.c b/lib/locking/locking.c index 34e8bd9d3..9183ee68e 100644 --- a/lib/locking/locking.c +++ b/lib/locking/locking.c @@ -368,18 +368,18 @@ static int _lock_vol(struct cmd_context *cmd, const char *resource, if (!*resource) { log_error(INTERNAL_ERROR "Use of P_orphans is deprecated."); - return 0; + goto out; } if ((is_orphan_vg(resource) || is_global_vg(resource)) && (flags & LCK_CACHE)) { log_error(INTERNAL_ERROR "P_%s referenced", resource); - return 0; + goto out; } if (cmd->metadata_read_only && lck_type == LCK_WRITE && strcmp(resource, VG_GLOBAL)) { log_error("Operation prohibited while global/metadata_read_only is set."); - return 0; + goto out; } if ((ret = _locking.lock_resource(cmd, resource, flags, lv))) { @@ -399,7 +399,7 @@ static int _lock_vol(struct cmd_context *cmd, const char *resource, if (!ret) _update_vg_lock_count(resource, flags); } - +out: _unlock_memory(cmd, lv_op); _unblock_signals();