public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2012-01-25 21:43 zkabelac
  0 siblings, 0 replies; 8+ messages in thread
From: zkabelac @ 2012-01-25 21:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-25 21:43:51

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Check for correctness of uint64 value if exists

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2240&r2=1.2241
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.98&r2=1.99

--- LVM2/WHATS_NEW	2012/01/25 13:10:26	1.2240
+++ LVM2/WHATS_NEW	2012/01/25 21:43:51	1.2241
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Check for correctness of uint64 dev_size value.
   Rename origin_only parameter to more generic flag use_layer for lv_info().
   Thin pools have segment fields thin_count, zero, transaction_id.
   Each new created LV volume has creation lv_time and lv_host.
--- LVM2/lib/format_text/import_vsn1.c	2012/01/19 15:31:45	1.98
+++ LVM2/lib/format_text/import_vsn1.c	2012/01/25 21:43:51	1.99
@@ -216,7 +216,11 @@
 		pv->status |= MISSING_PV;
 
 	/* Late addition */
-	_read_uint64(pvn, "dev_size", &pv->size);
+	if (dm_config_has_node(pvn, "dev_size") &&
+	    !_read_uint64(pvn, "dev_size", &pv->size)) {
+		log_error("Couldn't read dev size for physical volume.");
+		return 0;
+	}
 
 	if (!_read_uint64(pvn, "pe_start", &pv->pe_start)) {
 		log_error("Couldn't read extent size for physical volume.");


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

* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2011-12-21 12:49 zkabelac
  0 siblings, 0 replies; 8+ messages in thread
From: zkabelac @ 2011-12-21 12:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-12-21 12:49:00

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Allow empty strings for description and creation_host config fields

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2206&r2=1.2207
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96

--- LVM2/WHATS_NEW	2011/12/20 00:02:19	1.2206
+++ LVM2/WHATS_NEW	2011/12/21 12:49:00	1.2207
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Allow empty strings for description and creation_host config fields.
   Issue deprecation warning when removing last lvm1-format snapshot.
   Reinstate support for snapshot removal with lvm1 format. (2.02.86)
   Add policy based automated repair of RAID logical volumes
--- LVM2/lib/format_text/import_vsn1.c	2011/10/23 16:05:45	1.95
+++ LVM2/lib/format_text/import_vsn1.c	2011/12/21 12:49:00	1.96
@@ -800,7 +800,7 @@
 	int old_suppress;
 
 	old_suppress = log_suppress(1);
-	d = dm_config_find_str(cft->root, "description", "");
+	d = dm_config_find_str_allow_empty(cft->root, "description", "");
 	log_suppress(old_suppress);
 	*desc = dm_pool_strdup(mem, d);
 
@@ -819,7 +819,7 @@
 
 	old_suppress = log_suppress(2);
 	*creation_host = dm_pool_strdup(mem,
-					dm_config_find_str(cft->root,
+					dm_config_find_str_allow_empty(cft->root,
 							"creation_host", ""));
 	log_suppress(old_suppress);
 


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

* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2011-10-23 16:05 zkabelac
  0 siblings, 0 replies; 8+ messages in thread
From: zkabelac @ 2011-10-23 16:05 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-23 16:05:45

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Drop mempool parameter from read functions
	
	Use implicit vgmem pool.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2169&r2=1.2170
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.94&r2=1.95

--- LVM2/WHATS_NEW	2011/10/23 16:02:01	1.2169
+++ LVM2/WHATS_NEW	2011/10/23 16:05:45	1.2170
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Use vg memory pool implicitely for vg read.
   Always use vg memory pool for allocated lv segment.
   Remove extra 4kB buffer allocated on stack in print_log().
   Make move_lv_segment non-static function and use dm_list function.
--- LVM2/lib/format_text/import_vsn1.c	2011/10/23 16:02:02	1.94
+++ LVM2/lib/format_text/import_vsn1.c	2011/10/23 16:05:45	1.95
@@ -25,7 +25,7 @@
 #include "text_import.h"
 #include "defaults.h"
 
-typedef int (*section_fn) (struct format_instance * fid, struct dm_pool * mem,
+typedef int (*section_fn) (struct format_instance * fid,
 			   struct volume_group * vg, const struct dm_config_node * pvn,
 			   const struct dm_config_node * vgn,
 			   struct dm_hash_table * pv_hash,
@@ -148,7 +148,7 @@
 	return 1;
 }
 
-static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
+static int _read_pv(struct format_instance *fid,
 		    struct volume_group *vg, const struct dm_config_node *pvn,
 		    const struct dm_config_node *vgn __attribute__((unused)),
 		    struct dm_hash_table *pv_hash,
@@ -156,6 +156,7 @@
 		    unsigned *scan_done_once,
 		    unsigned report_missing_devices)
 {
+	struct dm_pool *mem = vg->vgmem;
 	struct physical_volume *pv;
 	struct pv_list *pvl;
 	const struct dm_config_value *cv;
@@ -285,10 +286,10 @@
 	dm_list_add(&lv->segments, &seg->list);
 }
 
-static int _read_segment(struct dm_pool *mem, struct volume_group *vg,
-			 struct logical_volume *lv, const struct dm_config_node *sn,
+static int _read_segment(struct logical_volume *lv, const struct dm_config_node *sn,
 			 struct dm_hash_table *pv_hash)
 {
+	struct dm_pool *mem = lv->vg->vgmem;
 	uint32_t area_count = 0u;
 	struct lv_segment *seg;
 	const struct dm_config_node *sn_child = sn->child;
@@ -321,7 +322,7 @@
 		return 0;
 	}
 
-	if (!(segtype = get_segtype_from_string(vg->cmd, segtype_str)))
+	if (!(segtype = get_segtype_from_string(lv->vg->cmd, segtype_str)))
 		return_0;
 
 	if (segtype->ops->text_import_area_count &&
@@ -343,7 +344,7 @@
 	if (dm_config_get_list(sn_child, "tags", &cv) &&
 	    !(read_tags(mem, &seg->tags, cv))) {
 		log_error("Couldn't read tags for a segment of %s/%s.",
-			  vg->name, lv->name);
+			  lv->vg->name, lv->name);
 		return 0;
 	}
 
@@ -430,8 +431,7 @@
 	return 1;
 }
 
-static int _read_segments(struct dm_pool *mem, struct volume_group *vg,
-			  struct logical_volume *lv, const struct dm_config_node *lvn,
+static int _read_segments(struct logical_volume *lv, const struct dm_config_node *lvn,
 			  struct dm_hash_table *pv_hash)
 {
 	const struct dm_config_node *sn;
@@ -443,7 +443,7 @@
 		 * All sub-sections are assumed to be segments.
 		 */
 		if (!sn->v) {
-			if (!_read_segment(mem, vg, lv, sn, pv_hash))
+			if (!_read_segment(lv, sn, pv_hash))
 				return_0;
 
 			count++;
@@ -483,7 +483,6 @@
 }
 
 static int _read_lvnames(struct format_instance *fid __attribute__((unused)),
-			 struct dm_pool *mem,
 			 struct volume_group *vg, const struct dm_config_node *lvn,
 			 const struct dm_config_node *vgn __attribute__((unused)),
 			 struct dm_hash_table *pv_hash __attribute__((unused)),
@@ -491,6 +490,7 @@
 			 unsigned *scan_done_once __attribute__((unused)),
 			 unsigned report_missing_devices __attribute__((unused)))
 {
+	struct dm_pool *mem = vg->vgmem;
 	struct logical_volume *lv;
 	const char *lv_alloc;
 	const struct dm_config_value *cv;
@@ -552,7 +552,6 @@
 }
 
 static int _read_lvsegs(struct format_instance *fid __attribute__((unused)),
-			struct dm_pool *mem,
 			struct volume_group *vg, const struct dm_config_node *lvn,
 			const struct dm_config_node *vgn __attribute__((unused)),
 			struct dm_hash_table *pv_hash,
@@ -581,7 +580,7 @@
 
 	memcpy(&lv->lvid.id[0], &lv->vg->id, sizeof(lv->lvid.id[0]));
 
-	if (!_read_segments(mem, vg, lv, lvn, pv_hash))
+	if (!_read_segments(lv, lvn, pv_hash))
 		return_0;
 
 	lv->size = (uint64_t) lv->le_count * (uint64_t) vg->extent_size;
@@ -606,7 +605,6 @@
 
 static int _read_sections(struct format_instance *fid,
 			  const char *section, section_fn fn,
-			  struct dm_pool *mem,
 			  struct volume_group *vg, const struct dm_config_node *vgn,
 			  struct dm_hash_table *pv_hash,
 			  struct dm_hash_table *lv_hash,
@@ -627,7 +625,7 @@
 	}
 
 	for (n = n->child; n; n = n->sib) {
-		if (!fn(fid, mem, vg, n, vgn, pv_hash, lv_hash,
+		if (!fn(fid, vg, n, vgn, pv_hash, lv_hash,
 			scan_done_once, report_missing_devices))
 			return_0;
 	}
@@ -728,7 +726,7 @@
 		goto bad;
 	}
 
-	if (!_read_sections(fid, "physical_volumes", _read_pv, vg->vgmem, vg,
+	if (!_read_sections(fid, "physical_volumes", _read_pv, vg,
 			    vgn, pv_hash, lv_hash, 0, &scan_done_once)) {
 		log_error("Couldn't find all physical volumes for volume "
 			  "group %s.", vg->name);
@@ -751,15 +749,15 @@
 		goto bad;
 	}
 
-	if (!_read_sections(fid, "logical_volumes", _read_lvnames, vg->vgmem,
-			    vg, vgn, pv_hash, lv_hash, 1, NULL)) {
+	if (!_read_sections(fid, "logical_volumes", _read_lvnames, vg,
+			    vgn, pv_hash, lv_hash, 1, NULL)) {
 		log_error("Couldn't read all logical volume names for volume "
 			  "group %s.", vg->name);
 		goto bad;
 	}
 
-	if (!_read_sections(fid, "logical_volumes", _read_lvsegs, vg->vgmem,
-			    vg, vgn, pv_hash, lv_hash, 1, NULL)) {
+	if (!_read_sections(fid, "logical_volumes", _read_lvsegs, vg,
+			    vgn, pv_hash, lv_hash, 1, NULL)) {
 		log_error("Couldn't read all logical volumes for "
 			  "volume group %s.", vg->name);
 		goto bad;


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

* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2010-03-31 17:20 mbroz
  0 siblings, 0 replies; 8+ messages in thread
From: mbroz @ 2010-03-31 17:20 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-03-31 17:20:03

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Use hash table for quick lv reference when reading metadata.
	
	The _read_vg uses already hash for PVs to optimise
	reading of large VGs and avoiding repeated PV list traversing.
	
	Use the same aproach to speed up parsing VG with many LVs.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1492&r2=1.1493
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.69&r2=1.70

--- LVM2/WHATS_NEW	2010/03/31 12:06:30	1.1492
+++ LVM2/WHATS_NEW	2010/03/31 17:20:02	1.1493
@@ -1,5 +1,6 @@
 Version 2.02.63 -  
 ================================
+  Use hash table of LVs to speed up parsing of text metadata with many LVs.
   Fix two messages, add a whitespace and parentheses
   When dmeventd is not forking because of -d flag, don't kill the parent process
   Fix 'make install' when $(builddir) is different from $(srcdir).
--- LVM2/lib/format_text/import_vsn1.c	2010/03/17 02:11:19	1.69
+++ LVM2/lib/format_text/import_vsn1.c	2010/03/31 17:20:03	1.70
@@ -28,6 +28,7 @@
 			   struct volume_group * vg, struct config_node * pvn,
 			   struct config_node * vgn,
 			   struct dm_hash_table * pv_hash,
+			   struct dm_hash_table * lv_hash,
 			   unsigned *scan_done_once,
 			   unsigned report_missing_devices);
 
@@ -155,7 +156,9 @@
 static int _read_pv(struct format_instance *fid, struct dm_pool *mem,
 		    struct volume_group *vg, struct config_node *pvn,
 		    struct config_node *vgn __attribute((unused)),
-		    struct dm_hash_table *pv_hash, unsigned *scan_done_once,
+		    struct dm_hash_table *pv_hash,
+		    struct dm_hash_table *lv_hash __attribute((unused)),
+		    unsigned *scan_done_once,
 		    unsigned report_missing_devices)
 {
 	struct physical_volume *pv;
@@ -495,6 +498,7 @@
 			 struct volume_group *vg, struct config_node *lvn,
 			 struct config_node *vgn __attribute((unused)),
 			 struct dm_hash_table *pv_hash __attribute((unused)),
+			 struct dm_hash_table *lv_hash,
 			 unsigned *scan_done_once __attribute((unused)),
 			 unsigned report_missing_devices __attribute((unused)))
 {
@@ -555,6 +559,9 @@
 		return 0;
 	}
 
+	if (!dm_hash_insert(lv_hash, lv->name, lv))
+		return_0;
+
 	return link_lv_to_vg(vg, lv);
 }
 
@@ -563,19 +570,17 @@
 			struct volume_group *vg, struct config_node *lvn,
 			struct config_node *vgn __attribute((unused)),
 			struct dm_hash_table *pv_hash,
+			struct dm_hash_table *lv_hash,
 			unsigned *scan_done_once __attribute((unused)),
 			unsigned report_missing_devices __attribute((unused)))
 {
 	struct logical_volume *lv;
-	struct lv_list *lvl;
 
-	if (!(lvl = find_lv_in_vg(vg, lvn->key))) {
+	if (!(lv = dm_hash_lookup(lv_hash, lvn->key))) {
 		log_error("Lost logical volume reference %s", lvn->key);
 		return 0;
 	}
 
-	lv = lvl->lv;
-
 	if (!(lvn = lvn->child)) {
 		log_error("Empty logical volume section.");
 		return 0;
@@ -617,7 +622,9 @@
 			  const char *section, section_fn fn,
 			  struct dm_pool *mem,
 			  struct volume_group *vg, struct config_node *vgn,
-			  struct dm_hash_table *pv_hash, int optional,
+			  struct dm_hash_table *pv_hash,
+			  struct dm_hash_table *lv_hash,
+			  int optional,
 			  unsigned *scan_done_once)
 {
 	struct config_node *n;
@@ -634,7 +641,7 @@
 	}
 
 	for (n = n->child; n; n = n->sib) {
-		if (!fn(fid, mem, vg, n, vgn, pv_hash, scan_done_once, report_missing_devices))
+		if (!fn(fid, mem, vg, n, vgn, pv_hash, lv_hash, scan_done_once, report_missing_devices))
 			return_0;
 	}
 
@@ -647,7 +654,7 @@
 {
 	struct config_node *vgn, *cn;
 	struct volume_group *vg;
-	struct dm_hash_table *pv_hash = NULL;
+	struct dm_hash_table *pv_hash = NULL, *lv_hash = NULL;
 	struct dm_pool *mem = dm_pool_create("lvm2 vg_read", VG_MEMPOOL_CHUNK);
 	unsigned scan_done_once = use_cached_pvs;
 
@@ -742,7 +749,7 @@
 	}
 
 	/*
-	 * The pv hash memoises the pv section names -> pv
+	 * The pv hash memorises the pv section names -> pv
 	 * structures.
 	 */
 	if (!(pv_hash = dm_hash_create(32))) {
@@ -752,7 +759,7 @@
 
 	dm_list_init(&vg->pvs);
 	if (!_read_sections(fid, "physical_volumes", _read_pv, mem, vg,
-			    vgn, pv_hash, 0, &scan_done_once)) {
+			    vgn, pv_hash, lv_hash, 0, &scan_done_once)) {
 		log_error("Couldn't find all physical volumes for volume "
 			  "group %s.", vg->name);
 		goto bad;
@@ -769,15 +776,24 @@
 		goto bad;
 	}
 
+	/*
+	 * The lv hash memorises the lv section names -> lv
+	 * structures.
+	 */
+	if (!(lv_hash = dm_hash_create(32))) {
+		log_error("Couldn't create hash table.");
+		goto bad;
+	}
+
 	if (!_read_sections(fid, "logical_volumes", _read_lvnames, mem, vg,
-			    vgn, pv_hash, 1, NULL)) {
+			    vgn, pv_hash, lv_hash, 1, NULL)) {
 		log_error("Couldn't read all logical volume names for volume "
 			  "group %s.", vg->name);
 		goto bad;
 	}
 
 	if (!_read_sections(fid, "logical_volumes", _read_lvsegs, mem, vg,
-			    vgn, pv_hash, 1, NULL)) {
+			    vgn, pv_hash, lv_hash, 1, NULL)) {
 		log_error("Couldn't read all logical volumes for "
 			  "volume group %s.", vg->name);
 		goto bad;
@@ -790,6 +806,7 @@
 	}
 
 	dm_hash_destroy(pv_hash);
+	dm_hash_destroy(lv_hash);
 
 	/*
 	 * Finished.
@@ -800,6 +817,9 @@
 	if (pv_hash)
 		dm_hash_destroy(pv_hash);
 
+	if (lv_hash)
+		dm_hash_destroy(lv_hash);
+
 	dm_pool_destroy(mem);
 	return NULL;
 }


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

* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2009-07-09 11:29 mbroz
  0 siblings, 0 replies; 8+ messages in thread
From: mbroz @ 2009-07-09 11:29 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-07-09 11:29:41

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Fix and precise metadata read errors for segment areas.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1172&r2=1.1173
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63

--- LVM2/WHATS_NEW	2009/07/09 11:29:00	1.1172
+++ LVM2/WHATS_NEW	2009/07/09 11:29:41	1.1173
@@ -1,5 +1,6 @@
 Version 2.02.49 - 
 ================================
+  Fix and precise metadata read errors for segment areas.
   Fix segment metadata read function errors to use proper segment name.
   Add parent node to config_node structure.
   Fix segment import functions to print segment name and logical volume name.
--- LVM2/lib/format_text/import_vsn1.c	2009/07/09 11:28:10	1.62
+++ LVM2/lib/format_text/import_vsn1.c	2009/07/09 11:29:41	1.63
@@ -377,32 +377,29 @@
 	unsigned int s;
 	struct config_value *cv;
 	struct logical_volume *lv1;
-	const char *seg_name = sn->key;
+	struct physical_volume *pv;
+	const char *seg_name = config_parent_name(sn);
 
 	if (!seg->area_count) {
-		log_error("Zero areas not allowed for segment '%s'", sn->key);
+		log_error("Zero areas not allowed for segment %s", seg_name);
 		return 0;
 	}
 
 	for (cv = cn->v, s = 0; cv && s < seg->area_count; s++, cv = cv->next) {
 
 		/* first we read the pv */
-		const char *bad = "Badly formed areas array for "
-		    "segment '%s'.";
-		struct physical_volume *pv;
-
 		if (cv->type != CFG_STRING) {
-			log_error(bad, sn->key);
+			log_error("Bad volume name in areas array for segment %s.", seg_name);
 			return 0;
 		}
 
 		if (!cv->next) {
-			log_error(bad, sn->key);
+			log_error("Missing offset in areas array for segment %s.", seg_name);
 			return 0;
 		}
 
 		if (cv->next->type != CFG_INT) {
-			log_error(bad, sn->key);
+			log_error("Bad offset in areas array for segment %s.", seg_name);
 			return 0;
 		}
 


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

* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2009-07-09 11:28 mbroz
  0 siblings, 0 replies; 8+ messages in thread
From: mbroz @ 2009-07-09 11:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-07-09 11:28:10

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Fix segment import functions to print segment name and logical volume name.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1170&r2=1.1171
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62

--- LVM2/WHATS_NEW	2009/07/09 10:19:07	1.1170
+++ LVM2/WHATS_NEW	2009/07/09 11:28:09	1.1171
@@ -1,5 +1,6 @@
 Version 2.02.49 - 
 ================================
+  Fix segment import functions to print segment name and logical volume name.
   Update vgsplit and vgcreate to call the new vg_create, then call 'set' fns.
   Change vg_create to take minimal parameters, obtain a lock, and return vg_t.
   Refactor vgchange extent_size, max_lv, max_pv, and alloc_policy for liblvm.
--- LVM2/lib/format_text/import_vsn1.c	2009/05/13 21:25:02	1.61
+++ LVM2/lib/format_text/import_vsn1.c	2009/07/09 11:28:10	1.62
@@ -293,32 +293,32 @@
 {
 	uint32_t area_count = 0u;
 	struct lv_segment *seg;
-	struct config_node *cn;
+	struct config_node *cn, *sn_child = sn->child;
 	struct config_value *cv;
 	uint32_t start_extent, extent_count;
 	struct segment_type *segtype;
 	const char *segtype_str;
 
-	if (!(sn = sn->child)) {
+	if (!sn_child) {
 		log_error("Empty segment section.");
 		return 0;
 	}
 
-	if (!_read_int32(sn, "start_extent", &start_extent)) {
-		log_error("Couldn't read 'start_extent' for segment '%s'.",
-			  sn->key);
+	if (!_read_int32(sn_child, "start_extent", &start_extent)) {
+		log_error("Couldn't read 'start_extent' for segment '%s' "
+			  "of logical volume %s.", sn->key, lv->name);
 		return 0;
 	}
 
-	if (!_read_int32(sn, "extent_count", &extent_count)) {
-		log_error("Couldn't read 'extent_count' for segment '%s'.",
-			  sn->key);
+	if (!_read_int32(sn_child, "extent_count", &extent_count)) {
+		log_error("Couldn't read 'extent_count' for segment '%s' "
+			  "of logical volume %s.", sn->key, lv->name);
 		return 0;
 	}
 
 	segtype_str = "striped";
 
-	if ((cn = find_config_node(sn, "type"))) {
+	if ((cn = find_config_node(sn_child, "type"))) {
 		cv = cn->v;
 		if (!cv || !cv->v.str) {
 			log_error("Segment type must be a string.");
@@ -331,7 +331,7 @@
 		return_0;
 
 	if (segtype->ops->text_import_area_count &&
-	    !segtype->ops->text_import_area_count(sn, &area_count))
+	    !segtype->ops->text_import_area_count(sn_child, &area_count))
 		return_0;
 
 	if (!(seg = alloc_lv_segment(mem, segtype, lv, start_extent,
@@ -342,11 +342,11 @@
 	}
 
 	if (seg->segtype->ops->text_import &&
-	    !seg->segtype->ops->text_import(seg, sn, pv_hash))
+	    !seg->segtype->ops->text_import(seg, sn_child, pv_hash))
 		return_0;
 
 	/* Optional tags */
-	if ((cn = find_config_node(sn, "tags")) &&
+	if ((cn = find_config_node(sn_child, "tags")) &&
 	    !(read_tags(mem, &seg->tags, cn->v))) {
 		log_error("Couldn't read tags for a segment of %s/%s.",
 			  vg->name, lv->name);
@@ -463,13 +463,14 @@
 	}
 
 	if (!_read_int32(lvn, "segment_count", &seg_count)) {
-		log_error("Couldn't read segment count for logical volume.");
+		log_error("Couldn't read segment count for logical volume %s.",
+			  lv->name);
 		return 0;
 	}
 
 	if (seg_count != count) {
 		log_error("segment_count and actual number of segments "
-			  "disagree.");
+			  "disagree for logical volume %s.", lv->name);
 		return 0;
 	}
 


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

* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2009-03-09 15:42 wysochanski
  0 siblings, 0 replies; 8+ messages in thread
From: wysochanski @ 2009-03-09 15:42 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2009-03-09 15:42:13

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Fix error messages when PV uuid or pe_start reading fails.
	
	Author: Takahiro Yasui <tyasui@redhat.com>
	Committer: Dave Wysochanski <dwysocha@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1064&r2=1.1065
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56

--- LVM2/WHATS_NEW	2009/03/06 16:19:52	1.1064
+++ LVM2/WHATS_NEW	2009/03/09 15:42:10	1.1065
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Fix error messages when PV uuid or pe_start reading fails.
   Rename liblvm.a to liblvm-internal.a and build new application library.
   Flush memory pool and fix locking in clvmd refresh and backup command.
   Fix unlocks in clvmd-corosync. Broken in 2.02.45.
--- LVM2/lib/format_text/import_vsn1.c	2008/11/03 22:14:28	1.55
+++ LVM2/lib/format_text/import_vsn1.c	2009/03/09 15:42:12	1.56
@@ -179,7 +179,7 @@
 	}
 
 	if (!_read_id(&pv->id, pvn, "id")) {
-		log_error("Couldn't read uuid for volume group.");
+		log_error("Couldn't read uuid for physical volume.");
 		return 0;
 	}
 
@@ -213,7 +213,7 @@
 	_read_int64(pvn, "dev_size", &pv->size);
 
 	if (!_read_int64(pvn, "pe_start", &pv->pe_start)) {
-		log_error("Couldn't read extent size for volume group.");
+		log_error("Couldn't read extent size for physical volume.");
 		return 0;
 	}
 


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

* LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c
@ 2007-11-04 15:43 agk
  0 siblings, 0 replies; 8+ messages in thread
From: agk @ 2007-11-04 15:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-11-04 15:43:51

Modified files:
	.              : WHATS_NEW 
	lib/format_text: import_vsn1.c 

Log message:
	Fix error message when fixing up PV size in lvm2 metadata (2.02.11).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.725&r2=1.726
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43

--- LVM2/WHATS_NEW	2007/11/02 20:40:04	1.725
+++ LVM2/WHATS_NEW	2007/11/04 15:43:50	1.726
@@ -1,5 +1,6 @@
 Version 2.02.29 -
 ==================================
+  Fix error message when fixing up PV size in lvm2 metadata (2.02.11).
   Fix orphan-related locking in pvdisplay and pvs.
   Fix missing VG unlocks in some pvchange error paths.
   Add some missing validation of VG names.
--- LVM2/lib/format_text/import_vsn1.c	2007/10/12 14:29:32	1.42
+++ LVM2/lib/format_text/import_vsn1.c	2007/11/04 15:43:50	1.43
@@ -221,7 +221,7 @@
                         log_error("%s: Couldn't get size.", pv_dev_name(pv));
                         return 0;
                 }
-                log_verbose("Fixing up missing format1 size (%s) "
+                log_verbose("Fixing up missing size (%s) "
                             "for PV %s", display_size(fid->fmt->cmd, pv->size),
                             pv_dev_name(pv));
                 if (vg) {


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

end of thread, other threads:[~2012-01-25 21:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-25 21:43 LVM2 ./WHATS_NEW lib/format_text/import_vsn1.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2011-12-21 12:49 zkabelac
2011-10-23 16:05 zkabelac
2010-03-31 17:20 mbroz
2009-07-09 11:29 mbroz
2009-07-09 11:28 mbroz
2009-03-09 15:42 wysochanski
2007-11-04 15:43 agk

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).