From 0025670dc9b9e705dda1e3b56d8c5a424835cb10 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 24 Nov 2009 16:13:02 +0000 Subject: [PATCH] Do not try to unlock VG which is not locked. If the vg_read() returned error, no lock was taken, so always call vg_release(). Otherwise this can happen because of missing FAILED_*: # vgchange -a y x --ignorelockingfailure Volume group "x" not found Internal error: Attempt to unlock unlocked VG x --- WHATS_NEW | 1 + tools/toollib.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index e1eb88808..7a94f5286 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.56 - ==================================== + Do not try to unlock VG which is not locked in _process_one_vg. Move persistent filter dump to more appropriate place. Refresh device filters before full device rescan in lvmcache. Return error status if vgchange fails to activate some volume. diff --git a/tools/toollib.c b/tools/toollib.c index 39a6d697a..33daf3089 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -452,8 +452,7 @@ static int _process_one_vg(struct cmd_context *cmd, const char *vg_name, ret_max = ret; out: - if ((vg_read_error(vg) == FAILED_ALLOCATION)|| - (vg_read_error(vg) == FAILED_LOCKING)) + if (vg_read_error(vg)) vg_release(vg); else unlock_and_release_vg(cmd, vg, vg_name);