Skip to contentSkip to conversation

LVM2 ./WHATS_NEW daemons/clvmd/lvm-functions.c

PATCH [email protected] 1 participant 1 message Jan 26, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: mbroz at sourceware.org 2010-01-26 08:00:03

Modified files:
. : WHATS_NEW
daemons/clvmd : lvm-functions.c

Log message:
Unlock shared lock if activation calls failed.

Clvmd should unlock new lock if activation in device-mapper fails.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1408&r2=1.1409
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84

WHATS_NEW +1 -0
@@ -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 '+'.
daemons/clvmd/lvm-functions.c +8 -3
@@ -373,17 +373,22 @@
 
 	/* 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 */