public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 lib/metadata/lv_manip.c lib/metadata/merg ...
@ 2011-09-06 22:44 agk
  0 siblings, 0 replies; 2+ messages in thread
From: agk @ 2011-09-06 22:44 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-09-06 22:43:58

Modified files:
	lib/metadata   : lv_manip.c merge.c metadata-exported.h 
	                 metadata.h thin_manip.c 
	lib/thin       : thin.c 
	tools          : lvcreate.c 

Log message:
	pool attach fns & more field renaming

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.281&r2=1.282
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.206&r2=1.207
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.253&r2=1.254
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/thin_manip.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/thin/thin.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.237&r2=1.238

--- LVM2/lib/metadata/lv_manip.c	2011/09/06 19:25:43	1.281
+++ LVM2/lib/metadata/lv_manip.c	2011/09/06 22:43:56	1.282
@@ -257,7 +257,7 @@
 
 	if (log_lv) {
 		if (thin_pool_lv) {
-			if (!attach_pool_metadata(seg, log_lv))
+			if (!attach_pool_metadata_lv(seg, log_lv))
 				return_NULL;
 		} else if (!attach_mirror_log(seg, log_lv))
 			return_NULL;
--- LVM2/lib/metadata/merge.c	2011/09/06 00:26:43	1.46
+++ LVM2/lib/metadata/merge.c	2011/09/06 22:43:57	1.47
@@ -313,7 +313,7 @@
 	if (!(split_seg = alloc_lv_segment(lv->vg->vgmem, seg->segtype,
 					   seg->lv, seg->le, seg->len,
 					   seg->status, seg->stripe_size,
-					   seg->log_lv, seg->thin_pool_lv,
+					   seg->log_lv, seg->pool_lv,
 					   seg->area_count, seg->area_len,
 					   seg->chunk_size, seg->region_size,
 					   seg->extents_copied, seg->pvmove_source_seg))) {
--- LVM2/lib/metadata/metadata-exported.h	2011/09/06 19:25:43	1.206
+++ LVM2/lib/metadata/metadata-exported.h	2011/09/06 22:43:57	1.207
@@ -85,6 +85,8 @@
 
 #define THIN_VOLUME		UINT64_C(0x0000001000000000)	/* LV */
 #define THIN_POOL		UINT64_C(0x0000002000000000)	/* LV */
+#define THIN_POOL_DATA		UINT64_C(0x0000002000000000)	/* LV */
+#define THIN_POOL_METADATA	UINT64_C(0x0000004000000000)	/* LV */
 
 #define LVM_READ		0x00000100U	/* LV VG 32-bit */
 #define LVM_WRITE		0x00000200U	/* LV VG 32-bit */
@@ -134,6 +136,8 @@
 
 #define lv_is_thin_volume(lv)	((lv)->status & THIN_VOLUME ? 1 : 0)
 #define lv_is_thin_pool(lv)	((lv)->status & THIN_POOL ? 1 : 0)
+#define lv_is_thin_pool_data(lv)	((lv)->status & THIN_POOL_DATA ? 1 : 0)
+#define lv_is_thin_pool_metadata(lv)	((lv)->status & THIN_POOL_METADATA ? 1 : 0)
 #define lv_is_mirrored(lv)	((lv)->status & MIRRORED ? 1 : 0)
 #define lv_is_rlog(lv)		((lv)->status & REPLICATOR_LOG ? 1 : 0)
 
@@ -322,12 +326,12 @@
 	struct dm_list tags;
 
 	struct lv_segment_area *areas;
-	struct lv_segment_area *meta_areas; /* For RAID */
-	struct logical_volume *pool_lv;		/* For thin_pool */
-	struct logical_volume *metadata_lv;	/* For thin_pool */
+	struct lv_segment_area *meta_areas;	/* For RAID */
+	struct logical_volume *pool_data_lv;	/* For thin_pool */
+	struct logical_volume *pool_metadata_lv;/* For thin_pool */
 	uint64_t transaction_id;		/* For thin_pool */
 	uint32_t zero_new_blocks;		/* For thin_pool */
-	struct logical_volume *thin_pool_lv;	/* For thin */
+	struct logical_volume *pool_lv;		/* For thin */
 	uint64_t device_id;			/* For thin */
 
 	struct logical_volume *replicator;/* For replicator-devs - link to replicator LV */
--- LVM2/lib/metadata/metadata.h	2011/09/06 19:25:43	1.253
+++ LVM2/lib/metadata/metadata.h	2011/09/06 22:43:57	1.254
@@ -442,9 +442,11 @@
 /*
  * From thin_manip.c
  */
-int attach_pool_metadata(struct lv_segment *seg,
-			 struct logical_volume *thin_pool_metadata);
-int attach_pool_lv(struct lv_segment *seg, struct logical_volume *thin_pool_lv);
+int attach_pool_metadata_lv(struct lv_segment *seg,
+			    struct logical_volume *pool_metadata_lv);
+int attach_pool_data_lv(struct lv_segment *seg,
+			struct logical_volume *pool_data_lv);
+int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv);
 
 /*
  * Begin skeleton for external LVM library
--- LVM2/lib/metadata/thin_manip.c	2011/09/06 19:25:43	1.1
+++ LVM2/lib/metadata/thin_manip.c	2011/09/06 22:43:57	1.2
@@ -15,19 +15,28 @@
 #include "lib.h"
 #include "metadata.h"
 
-int attach_pool_metadata(struct lv_segment *seg, struct logical_volume *thin_pool_metadata)
+int attach_pool_metadata_lv(struct lv_segment *seg, struct logical_volume *pool_metadata_lv)
 {
-	// FIXME Housekeeping needed here (cf attach_mirror_log)
-	seg->metadata_lv = thin_pool_metadata;
+	seg->pool_metadata_lv = pool_metadata_lv;
+	pool_metadata_lv->status |= THIN_POOL_METADATA;
+        lv_set_hidden(pool_metadata_lv);
 
-	return 1;
+        return add_seg_to_segs_using_this_lv(pool_metadata_lv, seg);
 }
 
-int attach_pool_lv(struct lv_segment *seg, struct logical_volume *thin_pool_lv)
+int attach_pool_data_lv(struct lv_segment *seg, struct logical_volume *pool_data_lv)
 {
-	// FIXME Housekeeping needed here (cf attach_mirror_log)
-	seg->thin_pool_lv = thin_pool_lv;
+	seg->pool_data_lv = pool_data_lv;
+	pool_data_lv->status |= THIN_POOL_DATA;
+        lv_set_hidden(pool_data_lv);
 
-	return 1;
+        return add_seg_to_segs_using_this_lv(pool_data_lv, seg);
 }
 
+int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv)
+{
+	seg->pool_lv = pool_lv;
+	pool_lv->status |= THIN_POOL;
+
+        return add_seg_to_segs_using_this_lv(pool_lv, seg);
+}
--- LVM2/lib/thin/thin.c	2011/09/06 22:35:44	1.10
+++ LVM2/lib/thin/thin.c	2011/09/06 22:43:57	1.11
@@ -47,21 +47,26 @@
 			struct dm_hash_table *pv_hash __attribute__((unused)))
 {
 	const char *lv_name;
+	struct logical_volume *pool_data_lv, *pool_metadata_lv;
 
 	if (!dm_config_get_str(sn, "pool", &lv_name))
 		return SEG_LOG_ERROR("Pool must be a string in");
 
-// Use attach_pool_lv
-	if (!(seg->pool_lv = find_lv(seg->lv->vg, lv_name)))
+	if (!(pool_data_lv = find_lv(seg->lv->vg, lv_name)))
 		return SEG_LOG_ERROR("Unknown pool %s in", lv_name);
 
 	if (!dm_config_get_str(sn, "metadata", &lv_name))
 		return SEG_LOG_ERROR("Metadata must be a string in");
 
-// Use attach_pool_metadata()
-	if (!(seg->metadata_lv = find_lv(seg->lv->vg, lv_name)))
+	if (!(pool_metadata_lv = find_lv(seg->lv->vg, lv_name)))
 		return SEG_LOG_ERROR("Unknown metadata %s in", lv_name);
 
+	if (!attach_pool_metadata_lv(seg, pool_metadata_lv))
+		return_0;
+
+	if (!attach_pool_data_lv(seg, pool_data_lv))
+		return_0;
+
 	if (!dm_config_get_uint64(sn, "transaction_id", &seg->transaction_id))
 		return SEG_LOG_ERROR("Could not read transaction_id for");
 
@@ -74,8 +79,8 @@
 
 static int _thin_pool_text_export(const struct lv_segment *seg, struct formatter *f)
 {
-	outf(f, "pool = \"%s\"", seg->pool_lv->name);
-	outf(f, "metadata = \"%s\"", seg->metadata_lv->name);
+	outf(f, "pool = \"%s\"", seg->pool_data_lv->name);
+	outf(f, "metadata = \"%s\"", seg->pool_metadata_lv->name);
 	outf(f, "transaction_id = %" PRIu64, seg->transaction_id);
 	if (seg->zero_new_blocks)
 		outf(f, "zero_new_blocks = 1");
@@ -92,13 +97,17 @@
 			struct dm_hash_table *pv_hash __attribute__((unused)))
 {
 	const char *lv_name;
+	struct logical_volume *pool_lv;
 
 	if (!dm_config_get_str(sn, "thin_pool", &lv_name))
 		return SEG_LOG_ERROR("Thin pool must be a string in");
 
-	if (!(seg->thin_pool_lv = find_lv(seg->lv->vg, lv_name)))
+	if (!(pool_lv = find_lv(seg->lv->vg, lv_name)))
 		return SEG_LOG_ERROR("Unknown thin pool %s in", lv_name);
 
+	if (!attach_pool_lv(seg, pool_lv))
+		return_0;
+
 	if (dm_config_has_node(sn, "origin")) {
 		if (!dm_config_get_str(sn, "origin", &lv_name))
 			return SEG_LOG_ERROR("Origin must be a string in");
@@ -115,7 +124,7 @@
 
 static int _thin_text_export(const struct lv_segment *seg, struct formatter *f)
 {
-	outf(f, "thin_pool = \"%s\"", seg->thin_pool_lv->name);
+	outf(f, "thin_pool = \"%s\"", seg->pool_lv->name);
 	outf(f, "device_id = %" PRIu64, seg->device_id);
 
 	if (seg->origin)
--- LVM2/tools/lvcreate.c	2011/09/06 19:25:42	1.237
+++ LVM2/tools/lvcreate.c	2011/09/06 22:43:58	1.238
@@ -198,13 +198,12 @@
 		return 0;
 	}
 
-	/* FIXME Replace with lv_is_thin_volume() once more flags are added */
 	if (lv_is_thin_volume(lvl->lv)) {
 		lp->thin = 1;
 		if (!(lp->segtype = get_segtype_from_string(vg->cmd, "thin")))
 			return_0;
 
-		lp->pool = first_seg(lvl->lv)->thin_pool_lv->name;
+		lp->pool = first_seg(lvl->lv)->pool_lv->name;
 	}
 
 	if (!lp->thin && !arg_count(vg->cmd, extents_ARG) && !arg_count(vg->cmd, size_ARG)) {


^ permalink raw reply	[flat|nested] 2+ messages in thread

* LVM2 lib/metadata/lv_manip.c lib/metadata/merg ...
@ 2011-11-07 11:03 zkabelac
  0 siblings, 0 replies; 2+ messages in thread
From: zkabelac @ 2011-11-07 11:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-07 11:03:48

Modified files:
	lib/metadata   : lv_manip.c merge.c metadata.h thin_manip.c 
	lib/report     : report.c 
	lib/thin       : thin.c 
	tools          : lvcreate.c 

Log message:
	Thin supports snapshots
	
	Full support for thin snapshots.
	Create and remove is supported.
	
	TODO: lvconvert support is not yes available.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.324&r2=1.325
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.263&r2=1.264
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/thin_manip.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.146&r2=1.147
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/thin/thin.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.246&r2=1.247

--- LVM2/lib/metadata/lv_manip.c	2011/11/07 10:58:13	1.324
+++ LVM2/lib/metadata/lv_manip.c	2011/11/07 11:03:47	1.325
@@ -255,9 +255,16 @@
 	dm_list_init(&seg->thin_messages);
 
 	if (thin_pool_lv) {
-		seg->transaction_id = first_seg(thin_pool_lv)->transaction_id;
-		if (!attach_pool_lv(seg, thin_pool_lv))
-			return_NULL;
+		/* If this thin volume, thin snapshot is being created */
+		if (lv_is_thin_volume(thin_pool_lv)) {
+			seg->transaction_id = first_seg(first_seg(thin_pool_lv)->pool_lv)->transaction_id;
+			if (!attach_pool_lv(seg, first_seg(thin_pool_lv)->pool_lv, thin_pool_lv))
+				return_NULL;
+		} else {
+			seg->transaction_id = first_seg(thin_pool_lv)->transaction_id;
+			if (!attach_pool_lv(seg, thin_pool_lv, NULL))
+				return_NULL;
+		}
 	}
 
 	if (log_lv && !attach_mirror_log(seg, log_lv))
@@ -4004,8 +4011,20 @@
 
 	status |= lp->permission | VISIBLE_LV;
 
-	/* FIXME Thin snapshots are different */
-	if (lp->snapshot) {
+	if (lp->snapshot && lp->thin) {
+		if (!(org = find_lv(vg, lp->origin))) {
+			log_error("Couldn't find origin volume '%s'.",
+				  lp->origin);
+			return NULL;
+		}
+
+		if (org->status & LOCKED) {
+			log_error("Snapshots of locked devices are not supported.");
+			return NULL;
+		}
+
+		lp->voriginextents = org->le_count;
+	} else if (lp->snapshot) {
 		if (!activation()) {
 			log_error("Can't create snapshot without using "
 				  "device-mapper kernel driver");
@@ -4074,7 +4093,7 @@
 		return NULL;
 	}
 
-	if (lp->snapshot && (lp->extents * vg->extent_size < 2 * lp->chunk_size)) {
+	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;
 	}
@@ -4105,7 +4124,7 @@
 	}
 
 	/* The snapshot segment gets created later */
-	if (lp->snapshot &&
+	if (lp->snapshot && !lp->thin &&
 	    !(lp->segtype = get_segtype_from_string(cmd, "striped")))
 		return_NULL;
 
@@ -4173,7 +4192,7 @@
 		       lp->mirrors,
 		       seg_is_thin_pool(lp) ? lp->poolmetadataextents : lp->region_size,
 		       seg_is_thin_volume(lp) ? lp->voriginextents : lp->extents,
-		       seg_is_thin_volume(lp) ? lp->pool : NULL, lp->pvh, lp->alloc))
+		       seg_is_thin_volume(lp) ? (org ? org->name : lp->pool) : NULL, lp->pvh, lp->alloc))
 		return_NULL;
 
 	if (seg_is_thin_pool(lp)) {
@@ -4221,6 +4240,24 @@
 	init_dmeventd_monitor(lp->activation_monitoring);
 
 	if (seg_is_thin(lp)) {
+
+		/* For thin snapshot suspend active thin origin first */
+		if (org && lv_is_active(org)) {
+			if (!suspend_lv(cmd, org)) {
+				log_error("Failed to suspend thin origin %s.",
+					  org->name);
+				goto revert_new_lv;
+			} else if (!resume_lv(cmd, org)) {
+				log_error("Failed to resume thin origin %s.",
+					  org->name);
+				goto revert_new_lv;
+			}
+			/* At this point snapshot is active in kernel thin mda */
+			if (!update_pool_lv(first_seg(org)->pool_lv, 0)) {
+				stack;
+				goto deactivate_and_revert_new_lv;
+			}
+		}
 		if (((lp->activate == CHANGE_AY) ||
 		     (lp->activate == CHANGE_AE) ||
 		     (lp->activate == CHANGE_ALY))) {
@@ -4261,7 +4298,7 @@
 		goto deactivate_and_revert_new_lv;
 	}
 
-	if (lp->snapshot) {
+	if (lp->snapshot && !lp->thin) {
 		/* Reset permission after zeroing */
 		if (!(lp->permission & LVM_WRITE))
 			lv->status &= ~LVM_WRITE;
--- LVM2/lib/metadata/merge.c	2011/10/23 16:02:02	1.54
+++ LVM2/lib/metadata/merge.c	2011/11/07 11:03:47	1.55
@@ -373,6 +373,8 @@
 			seg_found++;
 		if (seg->pool_metadata_lv == lv || seg->pool_lv == lv)
 			seg_found++;
+		if (seg_is_thin_volume(seg) && seg->origin == lv)
+			seg_found++;
 		if (!seg_found) {
 			log_error("LV %s is used by LV %s:%" PRIu32 "-%" PRIu32
 				  ", but missing ptr from %s to %s",
--- LVM2/lib/metadata/metadata.h	2011/10/30 22:01:39	1.263
+++ LVM2/lib/metadata/metadata.h	2011/11/07 11:03:47	1.264
@@ -456,7 +456,8 @@
 			    struct logical_volume *pool_metadata_lv);
 int attach_pool_data_lv(struct lv_segment *seg,
 			struct logical_volume *pool_data_lv);
-int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv);
+int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv,
+		   struct logical_volume *origin_lv);
 int detach_pool_lv(struct lv_segment *seg);
 int attach_pool_message(struct lv_segment *seg, dm_thin_message_t type,
 			struct logical_volume *lv, uint32_t delete_id,
--- LVM2/lib/metadata/thin_manip.c	2011/11/07 10:59:07	1.23
+++ LVM2/lib/metadata/thin_manip.c	2011/11/07 11:03:47	1.24
@@ -39,10 +39,15 @@
 	return 1;
 }
 
-int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv)
+int attach_pool_lv(struct lv_segment *seg, struct logical_volume *pool_lv,
+		   struct logical_volume *origin)
 {
 	seg->pool_lv = pool_lv;
 	seg->lv->status |= THIN_VOLUME;
+	seg->origin = origin;
+
+	if (origin && !add_seg_to_segs_using_this_lv(origin, seg))
+		return_0;
 
 	return add_seg_to_segs_using_this_lv(pool_lv, seg);
 }
@@ -50,6 +55,7 @@
 int detach_pool_lv(struct lv_segment *seg)
 {
 	struct lv_thin_message *tmsg, *tmp;
+	struct seg_list *sl, *tsl;
 
 	if (!seg->pool_lv || !lv_is_thin_pool(seg->pool_lv)) {
 		log_error(INTERNAL_ERROR "LV %s is not a thin volume",
@@ -78,7 +84,30 @@
 				 NULL, seg->device_id, 0))
 		return_0;
 
-	return remove_seg_from_segs_using_this_lv(seg->pool_lv, seg);
+	if (!remove_seg_from_segs_using_this_lv(seg->pool_lv, seg))
+		return_0;
+
+	if (seg->origin &&
+	    !remove_seg_from_segs_using_this_lv(seg->origin, seg))
+		return_0;
+
+	/* If thin origin, remove it from related thin snapshots */
+	/*
+	 * TODO: map removal of origin as snapshot lvconvert --merge?
+	 * i.e. rename thin snapshot to origin thin origin
+	 */
+	dm_list_iterate_items_safe(sl, tsl, &seg->lv->segs_using_this_lv) {
+		if (!seg_is_thin_volume(sl->seg) ||
+		    (seg->lv != sl->seg->origin))
+			continue;
+
+		if (!remove_seg_from_segs_using_this_lv(seg->lv, sl->seg))
+			return_0;
+		/* Thin snapshot is now regular thin volume */
+		sl->seg->origin = NULL;
+	}
+
+	return 1;
 }
 
 int attach_pool_message(struct lv_segment *seg, dm_thin_message_t type,
--- LVM2/lib/report/report.c	2011/09/09 00:54:49	1.146
+++ LVM2/lib/report/report.c	2011/11/07 11:03:47	1.147
@@ -309,6 +309,9 @@
 	if (lv_is_cow(lv))
 		return _lvname_disp(rh, mem, field, origin_from_cow(lv), private);
 
+	if (lv_is_thin_volume(lv) && first_seg(lv)->origin)
+		return _lvname_disp(rh, mem, field, first_seg(lv)->origin, private);
+
 	dm_report_field_set_value(field, "", NULL);
 	return 1;
 }
--- LVM2/lib/thin/thin.c	2011/11/03 14:52:10	1.30
+++ LVM2/lib/thin/thin.c	2011/11/07 11:03:48	1.31
@@ -317,7 +317,7 @@
 			     struct dm_hash_table *pv_hash __attribute__((unused)))
 {
 	const char *lv_name;
-	struct logical_volume *pool_lv;
+	struct logical_volume *pool_lv, *origin = NULL;
 
 	if (!dm_config_get_str(sn, "thin_pool", &lv_name))
 		return SEG_LOG_ERROR("Thin pool must be a string in");
@@ -325,9 +325,6 @@
 	if (!(pool_lv = find_lv(seg->lv->vg, lv_name)))
 		return SEG_LOG_ERROR("Unknown thin pool %s in", lv_name);
 
-	if (!attach_pool_lv(seg, pool_lv))
-		return_0;
-
 	if (!dm_config_get_uint64(sn, "transaction_id", &seg->transaction_id))
 		return SEG_LOG_ERROR("Could not read transaction_id for");
 
@@ -335,7 +332,7 @@
 		if (!dm_config_get_str(sn, "origin", &lv_name))
 			return SEG_LOG_ERROR("Origin must be a string in");
 
-		if (!(seg->origin = find_lv(seg->lv->vg, lv_name)))
+		if (!(origin = find_lv(seg->lv->vg, lv_name)))
 			return SEG_LOG_ERROR("Unknown origin %s in", lv_name);
 	}
 
@@ -346,6 +343,9 @@
 		return SEG_LOG_ERROR("Unsupported value %u for device_id",
 				     seg->device_id);
 
+	if (!attach_pool_lv(seg, pool_lv, origin))
+		return_0;
+
 	return 1;
 }
 
--- LVM2/tools/lvcreate.c	2011/11/07 11:01:54	1.246
+++ LVM2/tools/lvcreate.c	2011/11/07 11:03:48	1.247
@@ -1013,13 +1013,6 @@
 			    lp.pool, lp.vg_name, lp.snapshot ? " as snapshot of " : "",
 			    lp.snapshot ? lp.origin : "", lp.segtype->name);
 
-	/* FIXME Remove when thin snapshots are supported. */
-	if (lp.thin && lp.snapshot) {
-		log_error("Thin snapshots are not yet supported.");
-		r = ECMD_FAILED;
-		goto_out;
-	}
-
 	if (!lv_create_single(vg, &lp)) {
 		stack;
 		r = ECMD_FAILED;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-07 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-06 22:44 LVM2 lib/metadata/lv_manip.c lib/metadata/merg agk
2011-11-07 11:03 zkabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).