Skip to contentSkip to conversation

LVM2/tools lvchange.c vgchange.c

PATCH [email protected] 1 participant 1 message Oct 28, 2011

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2011-10-28 20:29:07

Modified files:
tools : lvchange.c vgchange.c

Log message:
Thin works only with exclusive activation

Enforce exclusive activation with thin targets.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.131&r2=1.132
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.125&r2=1.126

tools/lvchange.c +3 -1
@@ -135,7 +135,9 @@
 		if (!deactivate_lv(cmd, lv))
 			return_0;
 	} else {
-		if (lv_is_origin(lv) || (activate == CHANGE_AE)) {
+		if ((activate == CHANGE_AE) ||
+		    lv_is_origin(lv) ||
+		    lv_is_thin_type(lv)) {
 			log_verbose("Activating logical volume \"%s\" "
 				    "exclusively", lv->name);
 			if (!activate_lv_excl(cmd, lv))
tools/vgchange.c +4 -4
@@ -149,10 +149,10 @@
 				stack;
 				continue;
 			}
-		} else if (lv_is_origin(lv) ||
-			   lv_is_thin_pool(lv) ||
-			   lv_is_thin_volume(lv) ||
-			   (activate == CHANGE_AE)) {
+		} else if ((activate == CHANGE_AE) ||
+			   lv_is_origin(lv) ||
+			   lv_is_thin_type(lv)) {
+			/* FIXME: duplicated test code with lvchange */
 			if (!activate_lv_excl(cmd, lv)) {
 				stack;
 				continue;