1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

locking: unlock memory on error path

Unlock memory and unblock signals on error path.
This commit is contained in:
Zdenek Kabelac 2013-07-06 10:58:56 +02:00
parent edf5cae679
commit 985251c8f3
2 changed files with 5 additions and 4 deletions

View File

@ -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.

View File

@ -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();