From f201498f9997f8e170eb2181fc1fda97b56bcc4c Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 10 Nov 2011 12:42:36 +0000 Subject: [PATCH] Thin test min thin_pool size for at least 1 chunk --- lib/metadata/lv_manip.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 553c80ce9..04ebfc87d 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4102,6 +4102,12 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l return NULL; } + if (seg_is_thin_pool(lp) && + (lp->extents * vg->extent_size < lp->chunk_size)) { + log_error("Unable to create thin pool smaller than 1 chunk."); + return NULL; + } + if (lp->snapshot && !lp->thin && (lp->extents * vg->extent_size < 2 * lp->chunk_size)) { log_error("Unable to create a snapshot smaller than 2 chunks."); return NULL;