Skip to contentSkip to conversation

LVM2/lib/metadata thin_manip.c

PATCH [email protected] 1 participant 1 message Nov 3, 2011

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-11-03 15:58:20

Modified files:
lib/metadata : thin_manip.c

Log message:
Thin keep pool device in the same state

Leave the optimalisation to be done differently and preserve availability state of the pool device.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/thin_manip.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22

lib/metadata/thin_manip.c +5 -4
@@ -307,10 +307,11 @@
 
 	if (activate) {
 		/* If the pool was not yet activated, do it */
-		if (!lv_is_active(lv) &&
-		    !activate_lv_excl(lv->vg->cmd, lv)) {
-			log_error("Failed to activate %s.", lv->name);
-			return 0;
+		if (!lv_is_active(lv)) {
+			if (!activate_lv_excl(lv->vg->cmd, lv))
+				return_0;
+			if (!deactivate_lv(lv->vg->cmd, lv))
+				return_0;
 		}
 		/* If already active, do suspend resume
 		 *