From a1c4a54ada2608e088ed9504110268f3e5346fff Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 15 Nov 2011 17:23:51 +0000 Subject: [PATCH] Thin supports only thin volumes as snapshot origins It's currently of the scope to properly solve the snapshoting of internal thin devs so prevent non-toplevel snapshots here. --- lib/metadata/lv_manip.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index b3c531807..6ca40f38c 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4071,6 +4071,16 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l "merging snapshot is not supported"); return NULL; } + + if (lv_is_thin_type(org) && !lv_is_thin_volume(org)) { + log_error("Snapshots of thin pool %sdevices " + "are not supported.", + lv_is_thin_pool_data(org) ? "data " : + lv_is_thin_pool_metadata(org) ? + "metadata " : ""); + return NULL; + } + if ((org->status & MIRROR_IMAGE) || (org->status & MIRROR_LOG)) { log_error("Snapshots of mirror %ss "