1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvconvert: update error path

Update the error path after problems with suspend_lv or vg_commit.
It's not exactly well defined what should happen, and this
code seems to appear in many different instancies<F2> in the
whole source code tree - we should probably pick the best version.
This commit is contained in:
Zdenek Kabelac 2013-02-05 11:21:21 +01:00
parent be5ad90703
commit 15115b61c0

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2005-2007 Red Hat, Inc. All rights reserved. * Copyright (C) 2005-2013 Red Hat, Inc. All rights reserved.
* *
* This file is part of LVM2. * This file is part of LVM2.
* *
@ -503,10 +503,13 @@ static int _reload_lv(struct cmd_context *cmd,
if (!suspend_lv(cmd, lv)) { if (!suspend_lv(cmd, lv)) {
log_error("Failed to lock %s", lv->name); log_error("Failed to lock %s", lv->name);
vg_revert(vg); vg_revert(vg);
if (!resume_lv(cmd, lv))
stack;
goto out; goto out;
} }
if (!vg_commit(vg)) { if (!vg_commit(vg)) {
vg_revert(vg);
if (!resume_lv(cmd, lv)) if (!resume_lv(cmd, lv))
stack; stack;
goto_out; goto_out;
@ -520,8 +523,8 @@ static int _reload_lv(struct cmd_context *cmd,
} }
r = 1; r = 1;
out:
backup(vg); backup(vg);
out:
return r; return r;
} }