From 87371d48cc7bae3d659f86ba1c4d08a6a98442bf Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Mon, 7 Nov 2011 10:58:13 +0000 Subject: [PATCH] Thin revert code for exclusive pool activation There are no limits on thin-pool activation now. Revert code that is no longer needed. --- lib/activate/activate.c | 2 +- lib/metadata/lv_manip.c | 13 ------------- tools/lvresize.c | 4 ---- tools/vgchange.c | 4 ---- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/lib/activate/activate.c b/lib/activate/activate.c index a96e78113..2b44b1926 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -782,7 +782,7 @@ int lvs_in_vg_opened(const struct volume_group *vg) return 0; dm_list_iterate_items(lvl, &vg->lvs) - if (lv_is_visible(lvl->lv) && !lv_is_used_thin_pool(lvl->lv)) + if (lv_is_visible(lvl->lv)) count += (_lv_open_count(vg->cmd, lvl->lv) > 0); log_debug("Counted %d open LVs in VG %s", count, vg->name); diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index a8c0b9e48..d4b349426 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4184,19 +4184,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l } else if (seg_is_thin_volume(lp)) { pool_lv = first_seg(lv)->pool_lv; - /* Ensure unused thin pool is not active */ - if (!lv_is_used_thin_pool(pool_lv) && - !deactivate_lv(cmd, pool_lv)) { - log_error("Failed to deactivate unused pool %s.", - pool_lv->name); - goto revert_new_lv; - } - - /* - * From now the thin pool de/activation is made - * only via implicit thin volume dependency. - */ - if (!(first_seg(lv)->device_id = get_free_pool_device_id(first_seg(pool_lv)))) { stack; diff --git a/tools/lvresize.c b/tools/lvresize.c index aebed4452..aafef6f62 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -755,10 +755,6 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg, /* If snapshot, must suspend all associated devices */ if (lv_is_cow(lv)) lock_lv = origin_from_cow(lv); - else if (lv_is_used_thin_pool(lv)) - // FIXME: what to pick here - maybe an active thin? - // but it still seems to be racy in cluster - lock_lv = lv; else lock_lv = lv; diff --git a/tools/vgchange.c b/tools/vgchange.c index 39d58f146..6332117e1 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -100,10 +100,6 @@ static int _activate_lvs_in_vg(struct cmd_context *cmd, if (!lv_is_visible(lv)) continue; - /* Never manipulate with thin pools in use */ - if (lv_is_used_thin_pool(lv)) - continue; - /* If LV is sparse, activate origin instead */ if (lv_is_cow(lv) && lv_is_virtual_origin(origin_from_cow(lv))) lv = origin_from_cow(lv); -- 2.43.5