master - locking: unlock memory on error path
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=985251c8f385d2611dde44d1bf6824223f073749 Commit: 985251c8f385d2611dde44d1bf6824223f073749 Parent: edf5cae6799549827d4031f472451bd96d2f0f47 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Jul 6 10:58:56 2013 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Jul 8 14:02:49 2013 +0200
locking: unlock memory on error path
Unlock memory and unblock signals on error path.
--- WHATS_NEW | 1 + lib/locking/locking.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-)
WHATS_NEW +1 -0
@@ -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.
lib/locking/locking.c +4 -4
@@ -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 ();