diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2009-09-02 21:27:39 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2009-09-02 21:27:39 +0000 |
commit | ae4ca998a320138f2816caf74bb8eaa5d4df3cbf (patch) | |
tree | 5009b1f67b77d3797dd493e831f00c0c971bf4f7 | |
parent | eb7c87e90d410c523d09ac597ecfa4123005db8c (diff) | |
download | lvm2-ae4ca998a320138f2816caf74bb8eaa5d4df3cbf.tar.gz lvm2-ae4ca998a320138f2816caf74bb8eaa5d4df3cbf.tar.xz lvm2-ae4ca998a320138f2816caf74bb8eaa5d4df3cbf.zip |
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 <dwysocha@redhat.com>
-rw-r--r-- | tools/vgsplit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/vgsplit.c b/tools/vgsplit.c index d4a7eed1..751c970d 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) |