From b7bc28b7b7dfdcaf6be9f3d8050994d2df35d3e9 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 2 Nov 2014 19:41:46 +0100 Subject: [PATCH] cache: wipe cache-pool before reuse Before we reuse cache-pool - we need to ensure metadata volume has wiped header. --- lib/metadata/lv_manip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index a42a7f5f6..b5fc84ad4 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -6678,6 +6678,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, lp->extents = size; } } + + if (seg_is_cache(lp) && + !wipe_cache_pool(pool_lv)) + return_NULL; } /* Resolve origin volume */