From fea5c22b7c0a46ff3603bdbf535dbf078cd7e0af Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 28 Oct 2005 14:38:20 +0000 Subject: [PATCH] reorder commit --- tools/lvcreate.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/lvcreate.c b/tools/lvcreate.c index 09097a2f0..4977397da 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -748,12 +748,6 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp) return 0; } - /* FIXME write/commit/backup sequence issue */ - if (!suspend_lv(cmd, org)) { - log_error("Failed to suspend origin %s", org->name); - return 0; - } - if (!vg_add_snapshot(vg->fid, NULL, org, lv, NULL, org->le_count, lp->chunk_size)) { log_err("Couldn't create snapshot."); @@ -761,7 +755,15 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp) } /* store vg on disk(s) */ - if (!vg_write(vg) || !vg_commit(vg)) + if (!vg_write(vg)) + return 0; + + if (!suspend_lv(cmd, org)) { + log_error("Failed to suspend origin %s", org->name); + return 0; + } + + if (!vg_commit(vg)) return 0; if (!resume_lv(cmd, org)) { -- 2.43.5