1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18: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 d1c45aa74f
commit 392b185173

View File

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