From: Alasdair Kergon Date: Fri, 25 Jan 2002 22:58:01 +0000 (+0000) Subject: If lv isn't active, skip reactivation. X-Git-Tag: v2_02_91~5781 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=2fb0db7710f016f309761006a84501937fcab4a7;p=lvm2.git If lv isn't active, skip reactivation. --- diff --git a/tools/lvresize.c b/tools/lvresize.c index 8511d5179..07f1a636c 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -37,6 +37,7 @@ int lvresize(int argc, char **argv) struct list *pvh, *segh; struct lv_list *lvl; int opt = 0; + int active; enum { LV_ANY = 0, @@ -314,6 +315,9 @@ int lvresize(int argc, char **argv) return ECMD_FAILED; } + + active = lv_active(lv); + /********* FIXME Suspend lv ***********/ /* store vg on disk(s) */ @@ -322,8 +326,7 @@ int lvresize(int argc, char **argv) backup(vg); - /* FIXME Ensure it always displays errors? */ - if (!lv_reactivate(lv)) + if (active && !lv_reactivate(lv)) return ECMD_FAILED; /********* FIXME Resume *********/