[lvm-devel] [PATCH 9/9] Change vgsplit behavior to open/lock first vg based on alphabetical ordering.
Dave Wysochanski
dwysocha at redhat.com
Thu Aug 13 21:27:03 UTC 2009
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.
Signed-off-by: Dave Wysochanski <dwysocha at redhat.com>
---
tools/vgsplit.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index ef1ab2c..a8e525d 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -314,6 +314,9 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
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)
--
1.6.0.6
More information about the lvm-devel
mailing list