From f0153d801e02ddfa9d3a485e9867111af5d14cee Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Thu, 13 Aug 2009 17:16:38 +0000 Subject: [PATCH] Fix error paths for vgcfgrestore when locking fails. --- WHATS_NEW | 1 + tools/vgcfgrestore.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 0f1388569..2ca6d5866 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.52 - ================================= + Fix vgcfgrestore error paths when locking fails (2.02.49). Added configure --enable-clogd to conditionally build the cluster log daemon. Make lvchange --refresh only take a read lock on volume group. Fix bug where non-blocking file locks could be granted in error. diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c index 0e99f1c89..dda22beac 100644 --- a/tools/vgcfgrestore.c +++ b/tools/vgcfgrestore.c @@ -45,12 +45,12 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv) if (!lock_vol(cmd, vg_name, LCK_VG_WRITE)) { log_error("Unable to lock volume group %s", vg_name); - unlock_vg(cmd, VG_ORPHANS); return ECMD_FAILED; } if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE)) { log_error("Unable to lock orphans"); + unlock_vg(cmd, vg_name); return ECMD_FAILED; } @@ -58,8 +58,8 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char **argv) backup_restore_from_file(cmd, vg_name, arg_str_value(cmd, file_ARG, "")) : backup_restore(cmd, vg_name))) { - unlock_vg(cmd, vg_name); unlock_vg(cmd, VG_ORPHANS); + unlock_vg(cmd, vg_name); log_error("Restore failed."); return ECMD_FAILED; } -- 2.43.5