From 4d925f5785b04ffcf59933106dc8aef67c23e6d6 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Fri, 21 Oct 2011 09:55:50 +0000 Subject: [PATCH] Remove double-hack for setting metadata size Drop the second lv_extend and set 128MB directly in the first hack place. --- lib/metadata/lv_manip.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 927eed9aa..e0681795f 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -800,8 +800,8 @@ static struct alloc_handle *_alloc_init(struct cmd_context *cmd, } } else if (segtype_is_thin_pool(segtype)) { ah->log_area_count = metadata_area_count; -// FIXME Calculate thin metadata area size - ah->log_len = 1; +// FIXME Calculate thin metadata area size (--metadatasize, or reuse --regionsize??) + ah->log_len = 128 * 1024 * 1024 / (512 * extent_size); /* Fixed 128MB */ } else { ah->log_area_count = metadata_area_count; ah->log_len = !metadata_area_count ? 0 : @@ -2605,17 +2605,12 @@ int lv_extend(struct logical_volume *lv, stripes, stripe_size))) goto out; - if (segtype_is_thin_pool(segtype)) { - /* FIXME: resize metadata size here for now */ - struct logical_volume *tmeta = first_seg(lv)->pool_metadata_lv; - if ((r = lv_add_segment(ah, ah->area_count, 1, tmeta, - get_segtype_from_string(lv->vg->cmd, "striped"), 0, 0, 0))) { - if (!(r = lv_extend(tmeta, first_seg(tmeta)->segtype, - 1, 0, 1, 0, 10, NULL, allocatable_pvs, ALLOC_INHERIT))) - stack; - } else - stack; - } + if (segtype_is_thin_pool(segtype) && + !(r = lv_add_segment(ah, ah->area_count, 1, + first_seg(lv)->pool_metadata_lv, + get_segtype_from_string(lv->vg->cmd, + "striped"), 0, 0, 0))) + goto_out; /* * If we are expanding an existing mirror, we can skip the -- 2.43.5