Skip to contentSkip to conversation

LVM2/lib/metadata metadata.c

PATCH [email protected] 1 participant 1 message Jul 12, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2007-07-12 04:12:04

Modified files:
lib/metadata : metadata.c

Log message:
Refactor vg_extend error path.

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

lib/metadata/metadata.c +7 -5
@@ -249,15 +249,17 @@
 
 	/* attach each pv */
 	for (i = 0; i < pv_count; i++)
-		if (!_add_pv_to_vg(vg, pv_names[i])) {
-			log_error("Unable to add physical volume '%s' to "
-				  "volume group '%s'.", pv_names[i], vg->name);
-			return 0;
-		}
+		if (!_add_pv_to_vg(vg, pv_names[i]))
+			goto bad;
 
 /* FIXME Decide whether to initialise and add new mdahs to format instance */
 
 	return 1;
+	
+      bad:
+	log_error("Unable to add physical volume '%s' to "
+		  "volume group '%s'.", pv_names[i], vg->name);
+	return 0;
 }
 
 const char *strip_dir(const char *vg_name, const char *dev_dir)