Skip to contentSkip to conversation

LVM2/tools vgsplit.c

PATCH [email protected] 1 participant 1 message Sep 2, 2009

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: wysochanski at sourceware.org 2009-09-02 21:27:39

Modified files:
tools : vgsplit.c

Log message:
Change vgsplit behavior to open/lock first vg based on alphabetical ordering.

If the destination vgname comes before the source vgname, we must open the destination first because of the locking rules. Thus, do a strcmp and set the flag based on the comparison.

Author: Dave Wysochanski <[email protected]>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93

tools/vgsplit.c +3 -0
@@ -314,6 +314,9 @@
 		return ECMD_FAILED;
 	}
 
+	if (strcmp(vg_name_to, vg_name_from) < 0)
+		lock_vg_from_first = 0;
+
 	if (lock_vg_from_first) {
 		vg_from = _vgsplit_from(cmd, vg_name_from);
 		if (!vg_from)