From 9b5fd08d26dd33a5ba2def26064abaf84cfd3140 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Tue, 26 Jan 2010 08:00:02 +0000 Subject: [PATCH] Unlock shared lock if activation calls failed. Clvmd should unlock new lock if activation in device-mapper fails. --- WHATS_NEW | 1 + daemons/clvmd/lvm-functions.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index e8c35a8fa..cc5fe2243 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.60 - 23rd January 2010 =================================== + Unlock shared lock in clvmd if activation calls failed. Fix return code of info call for query by uuid. Extend cmirrord man page. Sleep before first progress check if pvmove/lvconvert interval has prefix '+'. diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index 74c660ea2..02d401b95 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -373,17 +373,22 @@ static int do_activate_lv(char *resource, unsigned char lock_flags, int mode) /* If it's suspended then resume it */ if (!lv_info_by_lvid(cmd, resource, &lvi, 0, 0)) - return EIO; + goto error; if (lvi.suspended) if (!lv_resume(cmd, resource)) - return EIO; + goto error; /* Now activate it */ if (!lv_activate(cmd, resource, exclusive)) - return EIO; + goto error; return 0; + +error: + if (oldmode == -1 || oldmode != mode) + (void)hold_unlock(resource); + return EIO; } /* Resume the LV if it was active */