From e408d62eaf57e47cda8d0c10db4fe7a112850596 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Fri, 3 Feb 2006 19:36:20 +0000 Subject: [PATCH] suspend using existing LV metadata; vgreduce then needs partial flag --- lib/activate/activate.c | 6 +++--- tools/vgreduce.c | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/activate/activate.c b/lib/activate/activate.c index ac1839106..937820924 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -616,11 +616,11 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s, return 1; if (!(lv = lv_from_lvid(cmd, lvid_s, 0))) - return 0; + return_0; /* Use precommitted metadata if present */ if (!(lv_pre = lv_from_lvid(cmd, lvid_s, 1))) - return 0; + return_0; if (test_mode()) { _skip("Suspending '%s'.", lv->name); @@ -645,7 +645,7 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s, stack; memlock_inc(); - if (!_lv_suspend_lv(lv_pre)) { + if (!_lv_suspend_lv(lv)) { memlock_dec(); fs_unlock(); return 0; diff --git a/tools/vgreduce.c b/tools/vgreduce.c index b6f46bad3..613af287a 100644 --- a/tools/vgreduce.c +++ b/tools/vgreduce.c @@ -230,11 +230,14 @@ static int _make_vg_consistent(struct cmd_context *cmd, struct volume_group *vg) if (!test_mode()) { /* Suspend lvs_changed */ + init_partial(1); if (!suspend_lvs(cmd, &lvs_changed)) { stack; + init_partial(0); vg_revert(vg); return 0; } + init_partial(0); } if (!vg_commit(vg)) {