1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

Refactor vgsplit: _vgsplit_from or _vgsplit_to failure cleanup depends on order.

Should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
Dave Wysochanski 2009-09-02 21:27:05 +00:00
parent 9195a23c95
commit 54086f86d2

View File

@ -315,8 +315,11 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
}
vg_from = _vgsplit_from(cmd, vg_name_from);
if (!vg_from)
if (!vg_from) {
if (!lock_vg_from_first)
unlock_and_release_vg(cmd, vg_to, vg_name_to);
return ECMD_FAILED;
}
/*
* Set metadata format of original VG.
@ -327,7 +330,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
vg_to = _vgsplit_to(cmd, vg_name_to, &existing_vg);
if (!vg_to) {
unlock_and_release_vg(cmd, vg_from, vg_name_from);
if (lock_vg_from_first)
unlock_and_release_vg(cmd, vg_from, vg_name_from);
return ECMD_FAILED;
}
if (existing_vg) {