From 1cae10a36c69fb63e0e4380d59a14141dbc5a55f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 3 Nov 2011 15:58:20 +0000 Subject: [PATCH] Thin keep pool device in the same state Leave the optimalisation to be done differently and preserve availability state of the pool device. --- lib/metadata/thin_manip.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c index 71d08324f..5d776429d 100644 --- a/lib/metadata/thin_manip.c +++ b/lib/metadata/thin_manip.c @@ -307,10 +307,11 @@ int update_pool_lv(struct logical_volume *lv, int activate) if (activate) { /* If the pool was not yet activated, do it */ - if (!lv_is_active(lv) && - !activate_lv_excl(lv->vg->cmd, lv)) { - log_error("Failed to activate %s.", lv->name); - return 0; + if (!lv_is_active(lv)) { + if (!activate_lv_excl(lv->vg->cmd, lv)) + return_0; + if (!deactivate_lv(lv->vg->cmd, lv)) + return_0; } /* If already active, do suspend resume *