Skip to contentSkip to conversation

master - cache: wipe cache-pool before reuse

PATCH Zdenek Kabelac 1 participant 1 message Nov 3, 2014

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=b7bc28b7b7dfdcaf6be9f3d8050994d2df35d3e9
Commit:        b7bc28b7b7dfdcaf6be9f3d8050994d2df35d3e9
Parent:        29bd3cccc8de8949754edfe3d5a4c490627d5fa5
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Sun Nov 2 19:41:46 2014 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Mon Nov 3 14:19:33 2014 +0100

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 files changed, 4 insertions(+), 0 deletions(-)
lib/metadata/lv_manip.c +4 -0
index a42a7f5..b5fc84a 100644
@@ -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 */