public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2008-10-23 11:21 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2008-10-23 11:21 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-10-23 11:21:04

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix temp table activation in mirror conversions not to happen in other cmds.
	Fix temp table in mirror conversions to use always-present error not zero.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.979&r2=1.980
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.157&r2=1.158

--- LVM2/WHATS_NEW	2008/10/17 17:48:10	1.979
+++ LVM2/WHATS_NEW	2008/10/23 11:21:04	1.980
@@ -1,5 +1,7 @@
 Version 2.02.42 - 
 ===================================
+  Fix temp table activation in mirror conversions not to happen in other cmds.
+  Fix temp table in mirror conversions to use always-present error not zero.
 
 Version 2.02.41 - 17th October 2008
 ===================================
--- LVM2/lib/metadata/lv_manip.c	2008/10/17 10:57:15	1.157
+++ LVM2/lib/metadata/lv_manip.c	2008/10/23 11:21:04	1.158
@@ -2380,30 +2380,29 @@
 		return NULL;
 	}
 
-	if (strstr(name, "_mimagetmp")) {
-		log_very_verbose("Creating transient 'zero' LV"
-				 " for Mirror -> mirror up-convert.");
+	if (lv_is_active(lv_where) && strstr(name, "_mimagetmp")) {
+		log_very_verbose("Creating transient LV %s for mirror conversion in VG %s.", name, lv_where->vg->name);
 
-		segtype = get_segtype_from_string(cmd, "zero");
+		segtype = get_segtype_from_string(cmd, "error");
 
 		if (!lv_add_virtual_segment(layer_lv, 0, lv_where->le_count, segtype)) {
-			log_error("Creation of intermediate layer LV failed.");
+			log_error("Creation of transient LV %s for mirror conversion in VG %s failed.", name, lv_where->vg->name);
 			return NULL;
 		}
 
 		if (!vg_write(lv_where->vg)) {
-			log_error("Failed to write intermediate VG metadata");
+			log_error("Failed to write intermediate VG %s metadata for mirror conversion.", lv_where->vg->name);
 			return NULL;
 		}
 
 		if (!vg_commit(lv_where->vg)) {
-			log_error("Failed to commit intermediate VG metadata");
+			log_error("Failed to commit intermediate VG %s metadata for mirror conversion.", lv_where->vg->name);
 			vg_revert(lv_where->vg);
 			return NULL;
 		}
 
 		if (!activate_lv(cmd, layer_lv)) {
-			log_error("Failed to resume intermediate 'zero' LV, %s", name);
+			log_error("Failed to resume transient error LV %s for mirror conversion in VG %s.", name, lv_where->vg->name);
 			return NULL;
 		}
 	}


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-05-11 22:19 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2012-05-11 22:19 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-05-11 22:19:12

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix allocation policy loop so it doesn't continue beyond cling using later
	policies it shouldn't be using when --alloc cling is specified but no tags
	are defined.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2402&r2=1.2403
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.378&r2=1.379

--- LVM2/WHATS_NEW	2012/05/11 18:59:01	1.2402
+++ LVM2/WHATS_NEW	2012/05/11 22:19:12	1.2403
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Fix policy loop not to use later policies when --alloc cling without tags.
   Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags.
   Add missing pkg init --with-systemdsystemunitdir in configure.in (2.02.92).
   Fix division by zero if PV with zero PE count is used during vgcfgrestore.
--- LVM2/lib/metadata/lv_manip.c	2012/05/11 18:59:01	1.378
+++ LVM2/lib/metadata/lv_manip.c	2012/05/11 22:19:12	1.379
@@ -2022,7 +2022,7 @@
 		ah->alloc = ALLOC_CLING_BY_TAGS;
 
 	/* Attempt each defined allocation policy in turn */
-	for (alloc = ALLOC_CONTIGUOUS; alloc < ALLOC_INHERIT; alloc++) {
+	for (alloc = ALLOC_CONTIGUOUS; alloc <= ah->alloc; alloc++) {
 		/* Skip cling_by_tags if no list defined */
 		if (alloc == ALLOC_CLING_BY_TAGS && !ah->cling_tag_list_cn)
 			continue;
@@ -2039,7 +2039,7 @@
 		if (!_find_max_parallel_space_for_one_policy(ah, &alloc_parms, pvms, &alloc_state))
 			goto_out;
 
-		if ((alloc_state.allocated == ah->new_extents && !alloc_state.log_area_count_still_needed) || (ah->alloc == alloc) ||
+		if ((alloc_state.allocated == ah->new_extents && !alloc_state.log_area_count_still_needed) ||
 		    (!can_split && (alloc_state.allocated != old_allocated)))
 			break;
 	}
@@ -2154,7 +2154,7 @@
 		return NULL;
 	}
 
-	if (alloc == ALLOC_INHERIT)
+	if (alloc >= ALLOC_INHERIT)
 		alloc = vg->alloc;
 
 	new_extents = (lv ? lv->le_count : 0) + extents;


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-05-11 18:59 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2012-05-11 18:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-05-11 18:59:02

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags.
	Remove some unnecesary prev_lvseg checks.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2401&r2=1.2402
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.377&r2=1.378

--- LVM2/WHATS_NEW	2012/05/10 08:54:33	1.2401
+++ LVM2/WHATS_NEW	2012/05/11 18:59:01	1.2402
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags.
   Add missing pkg init --with-systemdsystemunitdir in configure.in (2.02.92).
   Fix division by zero if PV with zero PE count is used during vgcfgrestore.
   Add initial support for thin pool lvconvert.
--- LVM2/lib/metadata/lv_manip.c	2012/05/11 15:32:19	1.377
+++ LVM2/lib/metadata/lv_manip.c	2012/05/11 18:59:01	1.378
@@ -39,10 +39,12 @@
 #define RAID_METADATA_AREA_LEN 1
 
 /* FIXME These ended up getting used differently from first intended.  Refactor. */
-#define A_CONTIGUOUS		0x01
-#define A_CLING			0x02
-#define A_CLING_BY_TAGS		0x04
-#define A_CLING_TO_ALLOCED	0x08	/* Only for ALLOC_NORMAL */
+/* Only one of A_CONTIGUOUS_TO_LVSEG, A_CLING_TO_LVSEG, A_CLING_TO_ALLOCED may be set */
+#define A_CONTIGUOUS_TO_LVSEG	0x01	/* Must be contiguous to an existing segment */
+#define A_CLING_TO_LVSEG	0x02	/* Must use same disks as existing LV segment */
+#define A_CLING_TO_ALLOCED	0x04	/* Must use same disks as already-allocated segment */
+
+#define A_CLING_BY_TAGS		0x08	/* Must match tags against existing segment */
 #define A_CAN_SPLIT		0x10
 
 /*
@@ -907,11 +909,11 @@
 	/* Are there any preceding segments we must follow on from? */
 	if (alloc_parms->prev_lvseg) {
 		if (alloc_parms->alloc == ALLOC_CONTIGUOUS)
-			alloc_parms->flags |= A_CONTIGUOUS;
+			alloc_parms->flags |= A_CONTIGUOUS_TO_LVSEG;
 		else if (alloc_parms->alloc == ALLOC_CLING)
-			alloc_parms->flags |= A_CLING;
+			alloc_parms->flags |= A_CLING_TO_LVSEG;
 		else if (alloc_parms->alloc == ALLOC_CLING_BY_TAGS) {
-			alloc_parms->flags |= A_CLING;
+			alloc_parms->flags |= A_CLING_TO_LVSEG;
 			alloc_parms->flags |= A_CLING_BY_TAGS;
 		}
 	}
@@ -1494,14 +1496,14 @@
 				return NEXT_AREA;
 
 	/* If maximise_cling is set, perform several checks, otherwise perform exactly one. */
-	if (!iteration_count && !log_iteration_count && alloc_parms->flags & (A_CONTIGUOUS | A_CLING | A_CLING_TO_ALLOCED)) {
+	if (!iteration_count && !log_iteration_count && alloc_parms->flags & (A_CONTIGUOUS_TO_LVSEG | A_CLING_TO_LVSEG | A_CLING_TO_ALLOCED)) {
 		/* Contiguous? */
-		if (((alloc_parms->flags & A_CONTIGUOUS) || ah->maximise_cling) &&
-		    alloc_parms->prev_lvseg && _check_contiguous(ah->cmd, alloc_parms->prev_lvseg, pva, alloc_state))
+		if (((alloc_parms->flags & A_CONTIGUOUS_TO_LVSEG) || (ah->maximise_cling && alloc_parms->prev_lvseg)) &&
+		    _check_contiguous(ah->cmd, alloc_parms->prev_lvseg, pva, alloc_state))
 			return PREFERRED;
 	
 		/* Try next area on same PV if looking for contiguous space */
-		if (alloc_parms->flags & A_CONTIGUOUS)
+		if (alloc_parms->flags & A_CONTIGUOUS_TO_LVSEG)
 			return NEXT_AREA;
 	
 		/* Cling_to_alloced? */
@@ -1667,7 +1669,7 @@
 	uint32_t devices_needed = ah->area_count + ah->parity_count;
 
 	/* ix_offset holds the number of parallel allocations that must be contiguous/cling */
-	if (alloc_parms->flags & (A_CONTIGUOUS | A_CLING) && alloc_parms->prev_lvseg)
+	if (alloc_parms->flags & (A_CONTIGUOUS_TO_LVSEG | A_CLING_TO_LVSEG))
 		ix_offset = _stripes_per_mimage(alloc_parms->prev_lvseg) * alloc_parms->prev_lvseg->area_count;
 
 	if (alloc_parms->flags & A_CLING_TO_ALLOCED)


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-05-09 12:12 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2012-05-09 12:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-05-09 12:12:22

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix regression in for_each_sub_lv
	
	pool_lv is not a sub lv in terms for this function.
	It has caused problem with renaming thin_volume, where it has tried to
	rename pool LV as well.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2397&r2=1.2398
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.374&r2=1.375

--- LVM2/WHATS_NEW	2012/05/05 02:08:46	1.2397
+++ LVM2/WHATS_NEW	2012/05/09 12:12:21	1.2398
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Fix lvrename for thin volumes (regression in for_each_sub_lv() 2.02.89).
   Fix up-convert when mirror activation is controled by volume_list and tags.
   Disallow snapshots of mirror segment type.
   Fix bug in cmirror that caused incorrect status info to print on some nodes.
--- LVM2/lib/metadata/lv_manip.c	2012/05/05 02:08:47	1.374
+++ LVM2/lib/metadata/lv_manip.c	2012/05/09 12:12:21	1.375
@@ -2814,13 +2814,6 @@
 				return_0;
 		}
 
-		if (seg->pool_lv) {
-			if (!fn(cmd, seg->pool_lv, data))
-				return_0;
-			if (!for_each_sub_lv(cmd, seg->pool_lv, fn, data))
-				return_0;
-		}
-
 		if (seg->metadata_lv) {
 			if (!fn(cmd, seg->metadata_lv, data))
 				return_0;


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-03-05 14:13 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2012-03-05 14:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-05 14:12:58

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Use 64bit math
	
	Prevent 32bit overflow and resulting weird error reports when working
	with TB sizes..

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2341&r2=1.2342
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.370&r2=1.371

--- LVM2/WHATS_NEW	2012/03/04 17:40:59	1.2341
+++ LVM2/WHATS_NEW	2012/03/05 14:12:57	1.2342
@@ -1,5 +1,6 @@
 Version 2.02.95 -
 ================================
+  Use 64bit math for verification of thin pool and snapshot chunk size.
   Validate udev structures in _insert_udev_dir().
   Scan all devices for lvmetad if 'pvscan --cache' used without device list.
   Populate lvmcache from lvmetad before displaying PVs in pvscan. (2.02.94)
--- LVM2/lib/metadata/lv_manip.c	2012/03/04 15:57:27	1.370
+++ LVM2/lib/metadata/lv_manip.c	2012/03/05 14:12:57	1.371
@@ -4239,12 +4239,12 @@
 	}
 
 	if (seg_is_thin_pool(lp) &&
-	    (lp->extents * vg->extent_size < lp->chunk_size)) {
+	    ((uint64_t)lp->extents * vg->extent_size < lp->chunk_size)) {
 		log_error("Unable to create thin pool smaller than 1 chunk.");
 		return NULL;
 	}
 
-	if (lp->snapshot && !lp->thin && (lp->extents * vg->extent_size < 2 * lp->chunk_size)) {
+	if (lp->snapshot && !lp->thin && ((uint64_t)lp->extents * vg->extent_size < 2 * lp->chunk_size)) {
 		log_error("Unable to create a snapshot smaller than 2 chunks.");
 		return NULL;
 	}


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-02-29 22:09 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2012-02-29 22:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-29 22:08:58

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Wipe initial 4KiB for non-zeroed thin volumes
	
	If the thin pool has disabled zeroing  (created with -Zn), we at least
	clear initial 4KiB of such thin volume (provisions 1st block).
	
	If lvcreate is executed with '-an' command will abort (same way like we for
	normal LV - however for normal LV option -Zn may skip clearing completely,
	for thin volumes this option is not supported (applies only for pools).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2326&r2=1.2327
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.367&r2=1.368

--- LVM2/WHATS_NEW	2012/02/29 21:15:34	1.2326
+++ LVM2/WHATS_NEW	2012/02/29 22:08:57	1.2327
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================
+  Use set_lv() (wipe initial 4KiB) for non zeroed thin volume.
   Allow cluster mirrors to handle the absence of the checkpoint lib (libSaCkpt).
   Revert free of allocated segtype in init segment error path (2.02.89).
   Test dm_hash_insert() failures in filter-persistent.c and fid_add_mda().
--- LVM2/lib/metadata/lv_manip.c	2012/02/28 10:08:20	1.367
+++ LVM2/lib/metadata/lv_manip.c	2012/02/29 22:08:58	1.368
@@ -4457,7 +4457,10 @@
 
 	if (!seg_is_thin(lp) && !lp->zero && !lp->snapshot)
 		log_warn("WARNING: \"%s\" not zeroed", lv->name);
-	else if (!seg_is_thin(lp) && !set_lv(cmd, lv, UINT64_C(0), 0)) {
+	else if ((!seg_is_thin(lp) ||
+		  (lv_is_thin_volume(lv) &&
+		   !first_seg(first_seg(lv)->pool_lv)->zero_new_blocks)) &&
+		 !set_lv(cmd, lv, UINT64_C(0), 0)) {
 		log_error("Aborting. Failed to wipe %s.",
 			  lp->snapshot ? "snapshot exception store" :
 					 "start of new LV");


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-02-22 17:14 jbrassow
  0 siblings, 0 replies; 45+ messages in thread
From: jbrassow @ 2012-02-22 17:14 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2012-02-22 17:14:39

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2297&r2=1.2298
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.362&r2=1.363

--- LVM2/WHATS_NEW	2012/02/20 21:11:06	1.2297
+++ LVM2/WHATS_NEW	2012/02/22 17:14:38	1.2298
@@ -1,5 +1,6 @@
 Version 2.02.93 - 
 ====================================
+  Fix 'build_parallel_areas_from_lv' to work properly with RAID 4/5/6
 
 Version 2.02.92 - 20th February 2012
 ====================================
--- LVM2/lib/metadata/lv_manip.c	2012/02/15 15:18:43	1.362
+++ LVM2/lib/metadata/lv_manip.c	2012/02/22 17:14:39	1.363
@@ -3061,7 +3061,8 @@
 	struct dm_list *parallel_areas;
 	struct seg_pvs *spvs;
 	uint32_t current_le = 0;
-	struct lv_segment * uninitialized_var(seg);
+	uint32_t raid_multiple;
+	struct lv_segment *seg = first_seg(lv);
 
 	if (!(parallel_areas = dm_pool_alloc(cmd->mem, sizeof(*parallel_areas)))) {
 		log_error("parallel_areas allocation failed");
@@ -3100,7 +3101,9 @@
 			return_NULL;
 
 		current_le = spvs->le + spvs->len;
-	} while (current_le < lv->le_count);
+		raid_multiple = (seg->segtype->parity_devs) ?
+			seg->area_count - seg->segtype->parity_devs : 1;
+	} while ((current_le * raid_multiple) < lv->le_count);
 
 	/* FIXME Merge adjacent segments with identical PV lists (avoids need for contiguous allocation attempts between successful allocations) */
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-02-09 15:13 prajnoha
  0 siblings, 0 replies; 45+ messages in thread
From: prajnoha @ 2012-02-09 15:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2012-02-09 15:13:43

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Stop processing lvextend if trying to extend a mirror that is being recovered.
	
	Missing correct return value in lv_extend fn.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2273&r2=1.2274
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.358&r2=1.359

--- LVM2/WHATS_NEW	2012/02/08 13:05:38	1.2273
+++ LVM2/WHATS_NEW	2012/02/09 15:13:42	1.2274
@@ -1,5 +1,6 @@
 Version 2.02.91 -
 ===================================
+  Stop processing lvextend if trying to extend a mirror that is being recovered.
   Add pool_below_threshold() function to check thin pool percent status.
   Fix test for snap percent for failing merge when removing LV.
   Switch int to void return for str_list_del().
--- LVM2/lib/metadata/lv_manip.c	2012/02/08 13:05:39	1.358
+++ LVM2/lib/metadata/lv_manip.c	2012/02/09 15:13:42	1.359
@@ -2674,6 +2674,7 @@
 				log_error("%s/%s cannot be extended while"
 					  " it is recovering.",
 					  lv->vg->name, lv->name);
+				r = 0;
 				goto out;
 			}
 		}


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-02-08 13:02 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2012-02-08 13:02 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-08 13:02:08

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix test for lv_snapshot_percent
	
	Do not check for PERCENT_MERGE_FAILED if the lv_snapshot_percent() failed.
	(test for snap_percent would be testing uninitialized value).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2271&r2=1.2272
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.356&r2=1.357

--- LVM2/WHATS_NEW	2012/02/08 12:57:15	1.2271
+++ LVM2/WHATS_NEW	2012/02/08 13:02:07	1.2272
@@ -1,5 +1,6 @@
 Version 2.02.91 -
 ===================================
+  Fix test for snap percent for failing merge when removing LV.
   Switch int to void return for str_list_del().
   Fix error path handling in _build_desc().
   Add range test for device number in _scan_proc_dev().
--- LVM2/lib/metadata/lv_manip.c	2012/02/01 02:11:43	1.356
+++ LVM2/lib/metadata/lv_manip.c	2012/02/08 13:02:07	1.357
@@ -3315,14 +3315,14 @@
 		if (lv_is_merging_cow(lv) && !level) {
 			if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) &&
 			    info.exists && info.live_table) {
-				if (lv_snapshot_percent(lv, &snap_percent) &&
-				    ((snap_percent != PERCENT_INVALID) &&
-				     (snap_percent != PERCENT_MERGE_FAILED))) {
+				if (!lv_snapshot_percent(lv, &snap_percent))
+					return_0;
+				if ((snap_percent != PERCENT_INVALID) &&
+				     (snap_percent != PERCENT_MERGE_FAILED)) {
 					log_error("Can't remove merging snapshot logical volume \"%s\"",
 						  lv->name);
 					return 0;
-				}
-				else if ((snap_percent == PERCENT_MERGE_FAILED) &&
+				} else if ((snap_percent == PERCENT_MERGE_FAILED) &&
 					 (force == PROMPT) &&
 					 yes_no_prompt("Removing snapshot \"%s\" that failed to merge may leave origin \"%s\" inconsistent. "
 						       "Proceed? [y/n]: ", lv->name, origin_from_cow(lv)->name) == 'n') {


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2012-01-20 22:04 snitzer
  0 siblings, 0 replies; 45+ messages in thread
From: snitzer @ 2012-01-20 22:04 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2012-01-20 22:04:16

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Prompt if request is made to remove a snapshot whose "Merge failed".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2232&r2=1.2233
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.344&r2=1.345

--- LVM2/WHATS_NEW	2012/01/20 22:03:48	1.2232
+++ LVM2/WHATS_NEW	2012/01/20 22:04:16	1.2233
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Prompt if request is made to remove a snapshot whose "Merge failed".
   Allow removal of an invalid snapshot that was to be merged on next activation.
   Don't allow a user to merge an invalid snapshot.
   Use m and M lv_attr to indicate that a snapshot merge failed in lvs.
--- LVM2/lib/metadata/lv_manip.c	2012/01/20 22:03:48	1.344
+++ LVM2/lib/metadata/lv_manip.c	2012/01/20 22:04:16	1.345
@@ -3271,7 +3271,7 @@
 	if (lv_is_cow(lv)) {
 		/*
 		 * A merging snapshot cannot be removed directly unless
-		 * it has been invalidated.
+		 * it has been invalidated or failed merge removal is requested.
 		 */
 		if (lv_is_merging_cow(lv) && !level) {
 			if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0) &&
@@ -3283,6 +3283,13 @@
 						  lv->name);
 					return 0;
 				}
+				else if ((snap_percent == PERCENT_MERGE_FAILED) &&
+					 (force == PROMPT) &&
+					 yes_no_prompt("Removing snapshot \"%s\" that failed to merge may leave origin \"%s\" inconsistent. "
+						       "Proceed? [y/n]: ", lv->name, origin_from_cow(lv)->name) == 'n') {
+					log_error("Logical volume %s not removed.", lv->name);
+					return 0;
+				}
 			}
 		}
 	}


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-11-15 17:32 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2011-11-15 17:32 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-15 17:32:12

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Adjusted mirror region size only for mirrors and raids
	
	Update region_size only for mirror and raid targets.
	This fixes warning messages when vg is using small
	extent size like 1KiB and no mirror/raid is created,
	but the user still got the message:
	
	$> vgcreate -s 1K vg  <pvs>
	$> lvcreate -L10K vg
	Using reduced mirror region size of 4 sectors

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2185&r2=1.2186
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.336&r2=1.337

--- LVM2/WHATS_NEW	2011/11/15 17:27:41	1.2185
+++ LVM2/WHATS_NEW	2011/11/15 17:32:12	1.2186
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Adjusted mirror region size only for mirrors and raids.
   Reorder prompt conditions for removal of active volumes.
   Avoid 'mda inconsistency' by properly registering UNLABELLED_PV flag (2.02.86).
   Fix --enable-static_link unless using --enable-dmeventd / --enable-udev_sync.
--- LVM2/lib/metadata/lv_manip.c	2011/11/15 17:29:52	1.336
+++ LVM2/lib/metadata/lv_manip.c	2011/11/15 17:32:12	1.337
@@ -4197,6 +4197,10 @@
 				 lp->segtype->name);
 			status |= LV_NOTSYNCED;
 		}
+
+		lp->region_size = adjusted_mirror_region_size(vg->extent_size,
+							      lp->extents,
+							      lp->region_size);
 	}
 
 	if (!(lv = lv_create_empty(new_lv_name ? : "lvol%d", NULL,
@@ -4218,10 +4222,6 @@
 
 	dm_list_splice(&lv->tags, &lp->tags);
 
-	lp->region_size = adjusted_mirror_region_size(vg->extent_size,
-						      lp->extents,
-						      lp->region_size);
-
 	if (!lv_extend(lv, lp->segtype,
 		       lp->stripes, lp->stripe_size,
 		       lp->mirrors,


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-11-15 17:28 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2011-11-15 17:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-15 17:27:42

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Reorder AND test condition
	
	Take the easiest condition for checking first since they must
	apply all together, check local conditions first before doing
	more expensive tests.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2184&r2=1.2185
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.334&r2=1.335

--- LVM2/WHATS_NEW	2011/11/15 11:54:15	1.2184
+++ LVM2/WHATS_NEW	2011/11/15 17:27:41	1.2185
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Reorder prompt conditions for removal of active volumes.
   Avoid 'mda inconsistency' by properly registering UNLABELLED_PV flag (2.02.86).
   Fix --enable-static_link unless using --enable-dmeventd / --enable-udev_sync.
   Move gentoo MAKEDEV to /sbin in lvm2create_initrd.
--- LVM2/lib/metadata/lv_manip.c	2011/11/15 17:23:51	1.334
+++ LVM2/lib/metadata/lv_manip.c	2011/11/15 17:27:41	1.335
@@ -3179,8 +3179,9 @@
 		if (!lv_check_not_in_use(cmd, lv, &info))
 			return_0;
 
-		if (lv_is_active(lv) && (force == PROMPT) &&
+		if ((force == PROMPT) &&
 		    lv_is_visible(lv) &&
+		    lv_is_active(lv) &&
 		    yes_no_prompt("Do you really want to remove active "
 				  "%slogical volume %s? [y/n]: ",
 				  vg_is_clustered(vg) ? "clustered " : "",


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-10-28 20:23 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2011-10-28 20:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-28 20:23:25

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Improve lv_extend stack reporting
	
	and some code cleanup with setting return value.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2175&r2=1.2176
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.307&r2=1.308

--- LVM2/WHATS_NEW	2011/10/28 20:17:55	1.2175
+++ LVM2/WHATS_NEW	2011/10/28 20:23:24	1.2176
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Improve lv_extend stack reporting.
   Increase virtual segment size instead of creating multiple segment list.
   Add last_seg(lv) internal function.
   Support empty string for log/prefix.
--- LVM2/lib/metadata/lv_manip.c	2011/10/28 20:19:26	1.307
+++ LVM2/lib/metadata/lv_manip.c	2011/10/28 20:23:25	1.308
@@ -2571,10 +2571,11 @@
 	if (segtype_is_thin_pool(segtype)) {
 		if (!(r = extend_pool(lv, segtype, ah)))
 			stack;
-	} else if (!segtype_is_mirrored(segtype) && !segtype_is_raid(segtype))
-		r = lv_add_segment(ah, 0, ah->area_count, lv, segtype,
-				   stripe_size, 0u, 0);
-	else {
+	} else if (!segtype_is_mirrored(segtype) && !segtype_is_raid(segtype)) {
+		if (!(r = lv_add_segment(ah, 0, ah->area_count, lv, segtype,
+					 stripe_size, 0u, 0)))
+			stack;
+	} else {
 		/*
 		 * For RAID, all the devices are AREA_LV.
 		 * However, for 'mirror on stripe' using non-RAID targets,
@@ -2587,11 +2588,10 @@
 			sub_lv_count = mirrors;
 
 		if (!lv->le_count &&
-		    !_lv_insert_empty_sublvs(lv, segtype, stripe_size,
-					     region_size, sub_lv_count)) {
+		    !(r = _lv_insert_empty_sublvs(lv, segtype, stripe_size,
+						  region_size, sub_lv_count))) {
 			log_error("Failed to insert layer for %s", lv->name);
-			alloc_destroy(ah);
-			return 0;
+			goto out;
 		}
 
 		if (!(r = _lv_extend_layered_lv(ah, lv, extents, 0,
@@ -2620,9 +2620,8 @@
 				goto out;
 			}
 
-			r = 0;
-			if (!lv_mirror_percent(lv->vg->cmd, lv, 0,
-					       &sync_percent, NULL)) {
+			if (!(r = lv_mirror_percent(lv->vg->cmd, lv, 0,
+						    &sync_percent, NULL))) {
 				log_error("Failed to get sync percent for %s/%s",
 					  lv->vg->name, lv->name);
 				goto out;
@@ -2638,7 +2637,6 @@
 					  lv->vg->name, lv->name);
 				goto out;
 			}
-			r = 1;
 		}
 	}
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-10-28 20:17 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2011-10-28 20:17 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-28 20:17:56

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Extend virtual segment instead of adding new one
	
	Before adding a new virtual segment to LV, check first whether
	the last segment isn't already of the same type. In this case
	extend last segment instead of creating the new one.
	
	Thin volumes should have always only 1 virtual segment, but it
	helps also to virtual snapshot or error segtype..

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2174&r2=1.2175
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.304&r2=1.305

--- LVM2/WHATS_NEW	2011/10/28 20:12:54	1.2174
+++ LVM2/WHATS_NEW	2011/10/28 20:17:55	1.2175
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Increase virtual segment size instead of creating multiple segment list.
   Add last_seg(lv) internal function.
   Support empty string for log/prefix.
   Fix regression that allowed mirrored logs for cluster mirrors.
--- LVM2/lib/metadata/lv_manip.c	2011/10/23 16:02:02	1.304
+++ LVM2/lib/metadata/lv_manip.c	2011/10/28 20:17:56	1.305
@@ -2043,20 +2043,23 @@
 		thin_pool_lv = lvl->lv;
 	}
 
-	if (!(seg = alloc_lv_segment(segtype, lv, lv->le_count, extents,
-				     status, 0, NULL, thin_pool_lv, 0,
-				     extents, 0, 0, 0, NULL))) {
-		log_error("Couldn't allocate new zero segment.");
-		return 0;
+	if ((seg = last_seg(lv)) && (seg->segtype == segtype)) {
+		seg->area_len += extents;
+		seg->len += extents;
+	} else {
+		if (!(seg = alloc_lv_segment(segtype, lv, lv->le_count, extents,
+					     status, 0, NULL, thin_pool_lv, 0,
+					     extents, 0, 0, 0, NULL))) {
+			log_error("Couldn't allocate new zero segment.");
+			return 0;
+		}
+		lv->status |= VIRTUAL;
+		dm_list_add(&lv->segments, &seg->list);
 	}
 
-	dm_list_add(&lv->segments, &seg->list);
-
 	lv->le_count += extents;
 	lv->size += (uint64_t) extents *lv->vg->extent_size;
 
-	lv->status |= VIRTUAL;
-
 	return 1;
 }
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-09-14 14:20 mbroz
  0 siblings, 0 replies; 45+ messages in thread
From: mbroz @ 2011-09-14 14:20 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2011-09-14 14:20:17

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Activate virtual snapshot origin exclusively (only on local node in cluster).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2108&r2=1.2109
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.284&r2=1.285

--- LVM2/WHATS_NEW	2011/09/14 09:57:35	1.2108
+++ LVM2/WHATS_NEW	2011/09/14 14:20:16	1.2109
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Activate virtual snapshot origin exclusively (only on local node in cluster).
   Fix lv_mirror_count to handle mirrored stripes properly.
   Fix failure to down-convert a mirror to linear due to udev "dev open" conflict
   Fix mirrored log creation when PE size is small - force log_size >= region_size
--- LVM2/lib/metadata/lv_manip.c	2011/09/13 18:42:58	1.284
+++ LVM2/lib/metadata/lv_manip.c	2011/09/14 14:20:16	1.285
@@ -4154,7 +4154,7 @@
 		    (!(org = _create_virtual_origin(cmd, vg, lv->name,
 						    lp->permission,
 						    lp->voriginextents)) ||
-		     !activate_lv(cmd, org))) {
+		     !activate_lv_excl(cmd, org))) {
 			log_error("Couldn't create virtual origin for LV %s",
 				  lv->name);
 			if (org && !lv_remove(org))


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-09-13 18:43 jbrassow
  0 siblings, 0 replies; 45+ messages in thread
From: jbrassow @ 2011-09-13 18:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-09-13 18:42:59

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix for bug 737200 - Can't create mirrored-log mirror on a VG with small extents
	
	Kernel requires a mirror to be at least 1 region large.  So,
	if our mirror log is itself a mirror, it must be at least
	1 region large.  This restriction may not be necessary for
	non-mirrored logs, but we apply the rule anyway.
	
	(The other option is to make the region size of the log
	mirror smaller than the mirror it is acting as a log for,
	but that really complicates things.  It's much easier to
	keep the region_size the same for both.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2104&r2=1.2105
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.283&r2=1.284

--- LVM2/WHATS_NEW	2011/09/13 16:33:21	1.2104
+++ LVM2/WHATS_NEW	2011/09/13 18:42:57	1.2105
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix mirrored log creation when PE size is small - force log_size >= region_size
   Fix improper RAID 64-bit status flag reset when and'ing against 32-bit flag.
   Fix log size calculation when only a log is being added to a mirror.
   Work around resume_lv causing error LV scanning during splitmirror operation.
--- LVM2/lib/metadata/lv_manip.c	2011/09/08 16:41:18	1.283
+++ LVM2/lib/metadata/lv_manip.c	2011/09/13 18:42:58	1.284
@@ -687,8 +687,21 @@
 	/* Log device holds both header and bitset. */
 	log_size = dm_round_up((MIRROR_LOG_OFFSET << SECTOR_SHIFT) + bitset_size, 1 << SECTOR_SHIFT);
 	log_size >>= SECTOR_SHIFT;
+	log_size = dm_div_up(log_size, pe_size);
 
-	return dm_div_up(log_size, pe_size);
+	/*
+	 * Kernel requires a mirror to be at least 1 region large.  So,
+	 * if our mirror log is itself a mirror, it must be at least
+	 * 1 region large.  This restriction may not be necessary for
+	 * non-mirrored logs, but we apply the rule anyway.
+	 *
+	 * (The other option is to make the region size of the log
+	 * mirror smaller than the mirror it is acting as a log for,
+	 * but that really complicates things.  It's much easier to
+	 * keep the region_size the same for both.)
+	 */
+	return (log_size > (region_size / pe_size)) ? log_size :
+		(region_size / pe_size);
 }
 
 /*


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-06-29 17:05 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2011-06-29 17:05 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-06-29 17:05:53

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Reinstate correct permissions when creating mirrors.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2030&r2=1.2031
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.264&r2=1.265

--- LVM2/WHATS_NEW	2011/06/29 14:56:33	1.2030
+++ LVM2/WHATS_NEW	2011/06/29 17:05:53	1.2031
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Reinstate correct permissions when creating mirrors. [2.02.85]
   Append 'm' attribute to pv_attr for missing PVs.
   Annotate CLVMD_CMD_SYNC_NAMES in decode_cmd.
   Remove enforcement of udev verification when using non-standard /dev location.
--- LVM2/lib/metadata/lv_manip.c	2011/06/23 14:00:58	1.264
+++ LVM2/lib/metadata/lv_manip.c	2011/06/29 17:05:53	1.265
@@ -2157,7 +2157,8 @@
 
 	for (i = 0; i < devices; i++) {
 		sub_lv = lv_create_empty(img_name, NULL,
-					 MIRROR_IMAGE, lv->alloc, lv->vg);
+					 LVM_READ | LVM_WRITE | MIRROR_IMAGE,
+					 lv->alloc, lv->vg);
 		if (!sub_lv)
 			return_0;
 		if (!set_lv_segment_area_lv(mapseg, i, sub_lv, 0, status))


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-04-07 21:49 jbrassow
  0 siblings, 0 replies; 45+ messages in thread
From: jbrassow @ 2011-04-07 21:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-04-07 21:49:30

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Thanks to Zdenek Kabelac (kabi) for pointing out that I was using
	dm_pool_free incorrectly.  This check-in fixes that incorrect usage.
	
	I've also added a WHATS_NEW line to reflect the changes I made to allow
	lv_extend to operate on 0 length intrinsically layered LVs (i.e mirrors
	and RAID).  I forgot that in the last commit.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1967&r2=1.1968
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.255&r2=1.256

--- LVM2/WHATS_NEW	2011/03/30 13:14:34	1.1967
+++ LVM2/WHATS_NEW	2011/04/07 21:49:29	1.1968
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Allow lv_extend() to work on zero length intrinsically layered LVs.
   Keep the cache content when the exported vg buffer is matching.
   Extend the set of memory regions, that are not locked to memory.
   Enhance usability with the valgrind memcheck tool.
--- LVM2/lib/metadata/lv_manip.c	2011/04/06 21:32:20	1.255
+++ LVM2/lib/metadata/lv_manip.c	2011/04/07 21:49:29	1.256
@@ -2114,8 +2114,8 @@
 	struct logical_volume *sub_lv;
 	uint32_t i;
 	uint64_t status = 0;
-	char *img_name;
-	size_t len;
+	size_t len = strlen(lv->name) + 32;
+	char img_name[len];
 	struct lv_segment *mapseg;
 
 	if (lv->le_count || first_seg(lv)) {
@@ -2141,9 +2141,6 @@
 	/*
 	 * Next, create all of our sub_lv's and link them in.
 	 */
-	len = strlen(lv->name) + 32;
-	if (!(img_name = dm_pool_alloc(lv->vg->cmd->mem, len)))
-		return_0;
 	if (dm_snprintf(img_name, len, "%s%s", lv->name, "_mimage_%d") < 0)
 		return_0;
 
@@ -2157,7 +2154,6 @@
 	}
 	dm_list_add(&lv->segments, &mapseg->list);
 
-	dm_pool_free(lv->vg->cmd->mem, img_name);
 	return 1;
 }
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-02-27  1:16 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2011-02-27  1:16 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-02-27 01:16:54

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix check for log-only allocation in new alloc normal loop.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1927&r2=1.1928
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.249&r2=1.250

--- LVM2/WHATS_NEW	2011/02/27 00:38:31	1.1927
+++ LVM2/WHATS_NEW	2011/02/27 01:16:52	1.1928
@@ -1,7 +1,7 @@
 Version 2.02.85 - 
 ===================================
-  Extend normal policy to allow mirror logs on same devs as images if necessary.
-  Improve cling policy to recognise devs already allocated in the transaction.
+  Extend normal policy to allow mirror logs on same PVs as images if necessary.
+  Improve cling policy to recognise PVs already used during the transaction.
   Improve normal allocation algorithm to include clinging to existing areas.
   Add allocation/maximise_cling & mirror_logs_require_separate_pvs to lvm.conf.
   Fix metadata balance code to work with recent changes in metadata handling.
--- LVM2/lib/metadata/lv_manip.c	2011/02/27 00:38:32	1.249
+++ LVM2/lib/metadata/lv_manip.c	2011/02/27 01:16:53	1.250
@@ -1555,9 +1555,9 @@
 		  (alloc_parms->flags & A_CLING_TO_ALLOCED) && !iteration_count++) ||
 		/* Extra iteration needed to fill log areas on PVs already used? */
 		 (alloc_parms->alloc == ALLOC_NORMAL && preferred_count == ix_offset && !ah->mirror_logs_separate &&
+		  (ix + preferred_count >= ah->area_count) && 
 		  (ix + preferred_count < ah->area_count + alloc_state->log_area_count_still_needed) && !log_iteration_count++));
 
-
 	if (preferred_count < ix_offset && !(alloc_parms->flags & A_CLING_TO_ALLOCED))
 		return 1;
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2011-01-28  2:58 snitzer
  0 siblings, 0 replies; 45+ messages in thread
From: snitzer @ 2011-01-28  2:58 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2011-01-28 02:58:01

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Improve lvcreate "insufficient extents" errors to "insufficient free space".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1892&r2=1.1893
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.245&r2=1.246

--- LVM2/WHATS_NEW	2011/01/27 00:21:37	1.1892
+++ LVM2/WHATS_NEW	2011/01/28 02:58:00	1.1893
@@ -1,6 +1,7 @@
 Version 2.02.83 - 
 ===================================
   Always use O_DIRECT when opening block devices to check for partitioning.
+  Improve lvcreate "insufficient extents" errors to "insufficient free space".
 
 Version 2.02.82 - 24th January 2011
 ===================================
--- LVM2/lib/metadata/lv_manip.c	2011/01/24 14:19:05	1.245
+++ LVM2/lib/metadata/lv_manip.c	2011/01/28 02:58:01	1.246
@@ -1481,7 +1481,7 @@
 	}
 
 	if (log_needs_allocating) {
-		log_error("Insufficient extents for log allocation "
+		log_error("Insufficient free space for log allocation "
 			  "for logical volume %s.",
 			  lv ? lv->name : "");
 		goto out;
@@ -3232,8 +3232,9 @@
 
 	if (!seg_is_virtual(lp) &&
 	    vg->free_count < lp->extents) {
-		log_error("Insufficient free extents (%u) in volume group %s: "
-			  "%u required", vg->free_count, vg->name, lp->extents);
+		log_error("Volume group \"%s\" has insufficient free space "
+			  "(%u extents): %u required.",
+			  vg->name, vg->free_count, lp->extents);
 		return 0;
 	}
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2010-12-20 14:38 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2010-12-20 14:38 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-12-20 14:38:22

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Add missing test for reallocation error.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1847&r2=1.1848
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.240&r2=1.241

--- LVM2/WHATS_NEW	2010/12/20 14:08:46	1.1847
+++ LVM2/WHATS_NEW	2010/12/20 14:38:22	1.1848
@@ -1,5 +1,6 @@
 Version 2.02.79 -  
 ===================================
+  Add missing test for reallocation error in _find_parallel_space().
   Add check for unlink error result in remove_lockfile() (dmeventd).
   Use dm_free for dm_malloc-ed areas in _clog_ctr/_clog_dtr (cmirrord).
   Add checks for allocation errors in config node clonning.
--- LVM2/lib/metadata/lv_manip.c	2010/12/20 13:12:56	1.240
+++ LVM2/lib/metadata/lv_manip.c	2010/12/20 14:38:22	1.241
@@ -1302,7 +1302,12 @@
 					/* Expand areas array if needed after an area was split. */
 					if (ix + ix_offset > *areas_size_ptr) {
 						*areas_size_ptr *= 2;
-						*areas_ptr = dm_realloc(*areas_ptr, sizeof(**areas_ptr) * (*areas_size_ptr));
+						if (!(*areas_ptr = dm_realloc(*areas_ptr,
+									     sizeof(**areas_ptr) *
+									     (*areas_size_ptr)))) {
+							log_error("Memory reallocation for parallel areas failed.");
+							return 0;
+						}
 					}
 					(*areas_ptr)[ix + ix_offset - 1].pva = pva;
 						(*areas_ptr)[ix + ix_offset - 1].used = required;


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2010-12-01 12:56 zkabelac
  0 siblings, 0 replies; 45+ messages in thread
From: zkabelac @ 2010-12-01 12:56 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-12-01 12:56:39

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Add backtraces for errors
	
	Add stack;  backtraces when error is reported from dev_set() or
	dev_close_immediate().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1823&r2=1.1824
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.238&r2=1.239

--- LVM2/WHATS_NEW	2010/12/01 12:41:49	1.1823
+++ LVM2/WHATS_NEW	2010/12/01 12:56:39	1.1824
@@ -1,5 +1,6 @@
 Version 2.02.78 - 
 ====================================
+  Add backtraces for dev_set() and dev_close_immediate() errors in set_lv().
   Add logging for unlink() error in clvmd remove_lockfile().
   Add logging for pipe write() and close() error in clvmd child_init_signal().
   Add test for existance of orphan vginfo in _lvmcache_update_vgname().
--- LVM2/lib/metadata/lv_manip.c	2010/11/11 17:29:06	1.238
+++ LVM2/lib/metadata/lv_manip.c	2010/12/01 12:56:39	1.239
@@ -3033,9 +3033,13 @@
 	if (sectors > lv->size)
 		sectors = lv->size;
 
-	dev_set(dev, UINT64_C(0), (size_t) sectors << SECTOR_SHIFT, value);
+	if (!dev_set(dev, UINT64_C(0), (size_t) sectors << SECTOR_SHIFT, value))
+		stack;
+
 	dev_flush(dev);
-	dev_close_immediate(dev);
+
+	if (!dev_close_immediate(dev))
+                stack;
 
 	return 1;
 }


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2010-03-29 17:59 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2010-03-29 17:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-03-29 17:59:47

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix --alloc contiguous policy only to allocate one set of parallel areas.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1487&r2=1.1488
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.217&r2=1.218

--- LVM2/WHATS_NEW	2010/03/29 16:09:40	1.1487
+++ LVM2/WHATS_NEW	2010/03/29 17:59:46	1.1488
@@ -1,10 +1,10 @@
 Version 2.02.63 -  
 ================================
+  Fix --alloc contiguous policy only to allocate one set of parallel areas.
   Do not allow {vg|lv}change --ignoremonitoring if on clustered VG.
   Improved dependency tracking for dmeventd and liblvm2cmd sources.
   Improved Makefile rules for distclean and cflow targets.
   Add ability to create mirrored logs for mirror LVs.
-  Use a real socket for singlenode clvmd to fix clvmd's high cpu load.
   Fix clvmd cluster propagation of dmeventd monitoring mode.
   Allow ALLOC_ANYWHERE to split contiguous areas.
   Use INTERNAL_ERROR for internal errors throughout tree.
--- LVM2/lib/metadata/lv_manip.c	2010/03/26 22:15:43	1.217
+++ LVM2/lib/metadata/lv_manip.c	2010/03/29 17:59:46	1.218
@@ -1243,7 +1243,7 @@
 					  log_needs_allocating, ix_log_offset))
 			return_0;
 
-	} while (!contiguous && *allocated != needed && can_split);
+	} while ((alloc != ALLOC_CONTIGUOUS) && *allocated != needed && can_split);
 
 	return 1;
 }


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2010-03-25 18:16 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2010-03-25 18:16 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-03-25 18:16:55

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Add some assertions to allocation code.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1479&r2=1.1480
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.214&r2=1.215

--- LVM2/WHATS_NEW	2010/03/25 11:48:54	1.1479
+++ LVM2/WHATS_NEW	2010/03/25 18:16:54	1.1480
@@ -1,5 +1,6 @@
 Version 2.02.63 -  
 ================================
+  Add some assertions to allocation code.
   Introduce pv_area_used into allocation algorithm and add debug messages.
   Add activation/monitoring to lvm.conf.
   Add --monitor and --ignoremonitoring to lvcreate.
--- LVM2/lib/metadata/lv_manip.c	2010/03/25 02:40:09	1.214
+++ LVM2/lib/metadata/lv_manip.c	2010/03/25 18:16:55	1.215
@@ -600,6 +600,11 @@
 	if (segtype_is_virtual(segtype))
 		return ah;
 
+	if (!(area_count + log_area_count)) {
+		log_error(INTERNAL_ERROR "_alloc_init called for non-virtual segment with no disk space.");
+		return NULL;
+	}
+
 	if (!(ah->mem = dm_pool_create("allocation", 1024))) {
 		log_error("allocation pool creation failed");
 		return NULL;
@@ -744,6 +749,11 @@
 	uint32_t total_area_count = ah->area_count + (log_needs_allocating ? ah->log_area_count : 0);
 	struct alloced_area *aa;
 
+	if (!total_area_count) {
+		log_error(INTERNAL_ERROR "_alloc_parallel_area called without any allocation to do.");
+		return 1;
+	}
+
 	remaining = needed - *allocated;
 	area_len = remaining / ah->area_multiple;
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2010-03-23 15:07 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2010-03-23 15:07 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-03-23 15:07:56

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Allow dynamic extension of array of areas selected as allocation candidates.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1474&r2=1.1475
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.210&r2=1.211

--- LVM2/WHATS_NEW	2010/03/23 14:47:35	1.1474
+++ LVM2/WHATS_NEW	2010/03/23 15:07:55	1.1475
@@ -1,5 +1,6 @@
 Version 2.02.63 - 
 ================================
+  Allow dynamic extension of array of areas selected as allocation candidates.
   Export and use only valid cookie value in test suite.
   Remove const modifier for struct volume_group* from process_each_lv_in_vg().
   Don't allow resizing of internal logical volumes.
--- LVM2/lib/metadata/lv_manip.c	2010/03/01 20:00:21	1.210
+++ LVM2/lib/metadata/lv_manip.c	2010/03/23 15:07:55	1.211
@@ -989,8 +989,8 @@
  * Choose sets of parallel areas to use, respecting any constraints.
  */
 static int _find_parallel_space(struct alloc_handle *ah, alloc_policy_t alloc,
-				struct dm_list *pvms, struct pv_area **areas,
-				uint32_t areas_size, unsigned can_split,
+				struct dm_list *pvms, struct pv_area ***areas_ptr,
+				uint32_t *areas_size_ptr, unsigned can_split,
 				struct lv_segment *prev_lvseg,
 				uint32_t *allocated, uint32_t needed)
 {
@@ -1094,8 +1094,8 @@
 					if (prev_lvseg &&
 					    _check_contiguous(ah->cmd,
 							      prev_lvseg,
-							      pva, areas,
-							      areas_size)) {
+							      pva, *areas_ptr,
+							      *areas_size_ptr)) {
 						preferred_count++;
 						goto next_pv;
 					}
@@ -1106,8 +1106,8 @@
 					if (prev_lvseg &&
 					    _check_cling(ah->cmd,
 							   prev_lvseg,
-							   pva, areas,
-							   areas_size)) {
+							   pva, *areas_ptr,
+							   *areas_size_ptr)) {
 						preferred_count++;
 					}
 					goto next_pv;
@@ -1127,10 +1127,15 @@
 					already_found_one = 1;
 				}
 
-				areas[ix + ix_offset - 1] = pva;
+				/* Expand areas array if needed after an area was split. */
+				if (ix + ix_offset > *areas_size_ptr) {
+					*areas_size_ptr *= 2;
+					*areas_ptr = dm_realloc(*areas_ptr, sizeof(**areas_ptr) * (*areas_size_ptr));
+				}
+				(*areas_ptr)[ix + ix_offset - 1] = pva;
 			}
 		next_pv:
-			if (ix >= areas_size)
+			if (ix >= *areas_size_ptr)
 				break;
 		}
 
@@ -1146,7 +1151,7 @@
 
 		/* sort the areas so we allocate from the biggest */
 		if (ix > 1)
-			qsort(areas + ix_offset, ix, sizeof(*areas),
+			qsort((*areas_ptr) + ix_offset, ix, sizeof(**areas_ptr),
 			      _comp_area);
 
 		/*
@@ -1160,7 +1165,7 @@
 		if (log_needs_allocating) {
 			/* How many areas are too small for the log? */
 			while (too_small_for_log_count < ix_offset + ix &&
-			       (*(areas + ix_offset + ix - 1 -
+			       (*((*areas_ptr) + ix_offset + ix - 1 -
 				  too_small_for_log_count))->count < ah->log_len)
 				too_small_for_log_count++;
 			ix_log_offset = ix_offset + ix - too_small_for_log_count - ah->log_area_count;
@@ -1172,7 +1177,7 @@
 			/* FIXME With ALLOC_ANYWHERE, need to split areas */
 			break;
 
-		if (!_alloc_parallel_area(ah, max_parallel, areas, allocated,
+		if (!_alloc_parallel_area(ah, max_parallel, *areas_ptr, allocated,
 					  log_needs_allocating, ix_log_offset))
 			return_0;
 
@@ -1247,8 +1252,8 @@
 	/* Attempt each defined allocation policy in turn */
 	for (alloc = ALLOC_CONTIGUOUS; alloc < ALLOC_INHERIT; alloc++) {
 		old_allocated = allocated;
-		if (!_find_parallel_space(ah, alloc, pvms, areas,
-					  areas_size, can_split,
+		if (!_find_parallel_space(ah, alloc, pvms, &areas,
+					  &areas_size, can_split,
 					  prev_lvseg, &allocated, ah->new_extents))
 			goto_out;
 		if ((allocated == ah->new_extents) || (ah->alloc == alloc) ||


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2010-01-12 20:53 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2010-01-12 20:53 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-01-12 20:53:20

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix allocation code not to stop at the first area of a PV that fits.
	
	This spurious 'break' has been here since this code was first committed
	in June 2005 and stopped the algorithm behaving as described in the
	comment above it and rendered the variable 'already_found_one' useless.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1382&r2=1.1383
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.196&r2=1.197

--- LVM2/WHATS_NEW	2010/01/12 14:47:00	1.1382
+++ LVM2/WHATS_NEW	2010/01/12 20:53:20	1.1383
@@ -1,5 +1,6 @@
 Version 2.02.58 - 
 ===================================
+  Fix allocation code not to stop at the first area of a PV that fits.
 
 Version 2.02.57 - 12th January 2010
 ===================================
--- LVM2/lib/metadata/lv_manip.c	2010/01/12 14:00:51	1.196
+++ LVM2/lib/metadata/lv_manip.c	2010/01/12 20:53:20	1.197
@@ -1114,8 +1114,6 @@
 				}
 
 				areas[ix + ix_offset - 1] = pva;
-
-				goto next_pv;
 			}
 		next_pv:
 			if (ix >= areas_size)


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2010-01-05 15:58 mbroz
  0 siblings, 0 replies; 45+ messages in thread
From: mbroz @ 2010-01-05 15:58 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-01-05 15:58:12

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Resume volumes in reverse order to preserve memlock pairing.
	
	If renaming snapshot with virtual origin, the origin is renamed too.
	But the code must resume LVs in reverse order to properly
	pair memlock (in cluster locking).
	
	(The resume of snapshot resumes origin too and later resume
	is ignored otherwise.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1354&r2=1.1355
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.189&r2=1.190

--- LVM2/WHATS_NEW	2009/12/18 12:45:41	1.1354
+++ LVM2/WHATS_NEW	2010/01/05 15:58:11	1.1355
@@ -1,5 +1,6 @@
 Version 2.02.57 -
 ====================================
+  Resume renamed volumes in reverse order to preserve memlock pairing.
   Drop metadata cache after device was autorepaired and removed from VG.
   Remove missing flag in metadata if PV reappeared and is empty.
   Destroy allocated mempool in _vg_read_orphans() error path.
--- LVM2/lib/metadata/lv_manip.c	2009/12/04 17:48:32	1.189
+++ LVM2/lib/metadata/lv_manip.c	2010/01/05 15:58:11	1.190
@@ -1767,7 +1767,7 @@
 	struct volume_group *vg = lv->vg;
 	struct lv_names lv_names;
 	DM_LIST_INIT(lvs_changed);
-	struct lv_list lvl, lvl2;
+	struct lv_list lvl, lvl2, *lvlp;
 	int r = 0;
 
 	/* rename is not allowed on sub LVs */
@@ -1822,7 +1822,13 @@
 	if (!(r = vg_commit(vg)))
 		stack;
 
-	resume_lvs(cmd, &lvs_changed);
+	/*
+	 * FIXME: resume LVs in reverse order to prevent memory
+	 * lock imbalance when resuming virtual snapshot origin
+	 * (resume of snapshot resumes origin too)
+	 */
+	dm_list_iterate_back_items(lvlp, &lvs_changed)
+		resume_lv(cmd, lvlp->lv);
 out:
 	backup(vg);
 	return r;


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2009-05-30  0:09 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2009-05-30  0:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-05-30 00:09:27

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Handle multi-extent mirror log allocation when smallest PV has only 1 extent.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1133&r2=1.1134
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.177&r2=1.178

--- LVM2/WHATS_NEW	2009/05/29 18:34:10	1.1133
+++ LVM2/WHATS_NEW	2009/05/30 00:09:27	1.1134
@@ -1,6 +1,7 @@
 Version 2.02.48 - 
 ===============================
-  Fix rpmlint in clvmd initscript
+  Handle multi-extent mirror log allocation when smallest PV has only 1 extent.
+  Add LSB standard headers and functions (incl. reload) to clvmd initscript.
   When creating new LV, double-check that name is not already in use.
   Remove /dev/vgname/lvname symlink automatically if LV is no longer visible.
   Rename internal vorigin LV to match visible LV.
--- LVM2/lib/metadata/lv_manip.c	2009/05/28 01:59:37	1.177
+++ LVM2/lib/metadata/lv_manip.c	2009/05/30 00:09:27	1.178
@@ -728,7 +728,8 @@
  */
 static int _alloc_parallel_area(struct alloc_handle *ah, uint32_t needed,
 				struct pv_area **areas,
-				uint32_t *ix, struct pv_area *log_area)
+				uint32_t *ix, struct pv_area *log_area,
+				uint32_t log_len)
 {
 	uint32_t area_len, remaining;
 	uint32_t s;
@@ -763,9 +764,7 @@
 	if (log_area) {
 		ah->log_area.pv = log_area->map->pv;
 		ah->log_area.pe = log_area->start;
-		ah->log_area.len = mirror_log_extents(ah->log_region_size,
-						      pv_pe_size(log_area->map->pv),
-						      area_len);
+		ah->log_area.len = log_len;
 		consume_pv_area(log_area, ah->log_area.len);
 	}
 
@@ -990,11 +989,15 @@
 	unsigned contiguous = 0, cling = 0, preferred_count = 0;
 	unsigned ix;
 	unsigned ix_offset = 0;	/* Offset for non-preferred allocations */
+	unsigned too_small_for_log_count; /* How many too small for log? */
 	uint32_t max_parallel;	/* Maximum extents to allocate */
 	uint32_t next_le;
 	struct seg_pvs *spvs;
 	struct dm_list *parallel_pvs;
 	uint32_t free_pes;
+	uint32_t log_len;
+	struct pv_area *log_area;
+	unsigned log_needs_allocating;
 
 	/* Is there enough total space? */
 	free_pes = pv_maps_size(pvms);
@@ -1121,25 +1124,49 @@
 		if ((contiguous || cling) && (preferred_count < ix_offset))
 			break;
 
-		/* Only allocate log_area the first time around */
-		if (ix + ix_offset < ah->area_count +
-			    ((ah->log_count && !ah->log_area.len) ?
-				ah->log_count : 0))
-			/* FIXME With ALLOC_ANYWHERE, need to split areas */
-			break;
-
 		/* sort the areas so we allocate from the biggest */
 		if (ix > 1)
 			qsort(areas + ix_offset, ix, sizeof(*areas),
 			      _comp_area);
 
-		/* First time around, use smallest area as log_area */
-		/* FIXME decide which PV to use at top of function instead */
-		if (!_alloc_parallel_area(ah, max_parallel, areas,
-					  allocated,
-					  (ah->log_count && !ah->log_area.len) ?
-						*(areas + ix_offset + ix - 1) :
-						NULL))
+		/*
+		 * First time around, if there's a log, allocate it on the
+		 * smallest device that has space for it.
+		 *
+		 * FIXME decide which PV to use at top of function instead
+		 */
+
+		log_needs_allocating = (ah->log_count && !ah->log_area.len) ?
+				       1 : 0;
+
+		too_small_for_log_count = 0;
+
+		if (!log_needs_allocating) {
+			log_len = 0;
+			log_area = NULL;
+		} else {
+			log_len = mirror_log_extents(ah->log_region_size,
+			    pv_pe_size((*areas)->map->pv),
+			    (max_parallel - *allocated) / ah->area_multiple);
+
+			/* How many areas are too small for the log? */
+			while (too_small_for_log_count < ix_offset + ix &&
+			       (*(areas + ix_offset + ix - 1 -
+				  too_small_for_log_count))->count < log_len)
+				too_small_for_log_count++;
+
+			log_area = *(areas + ix_offset + ix - 1 -
+				     too_small_for_log_count);
+		}
+
+		if (ix + ix_offset < ah->area_count +
+		    (log_needs_allocating ? ah->log_count +
+					    too_small_for_log_count : 0))
+			/* FIXME With ALLOC_ANYWHERE, need to split areas */
+			break;
+
+		if (!_alloc_parallel_area(ah, max_parallel, areas, allocated,
+					  log_area, log_len))
 			return_0;
 
 	} while (!contiguous && *allocated != needed && can_split);


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2009-05-28  1:59 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2009-05-28  1:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-05-28 01:59:37

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	When creating new LV, double-check that name is not already in use.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1131&r2=1.1132
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.176&r2=1.177

--- LVM2/WHATS_NEW	2009/05/28 01:11:29	1.1131
+++ LVM2/WHATS_NEW	2009/05/28 01:59:37	1.1132
@@ -1,5 +1,6 @@
 Version 2.02.48 - 
 ===============================
+  When creating new LV, double-check that name is not already in use.
   Remove /dev/vgname/lvname symlink automatically if LV is no longer visible.
   Rename internal vorigin LV to match visible LV.
   Suppress 'removed' messages displayed when internal LVs are removed.
--- LVM2/lib/metadata/lv_manip.c	2009/05/28 00:29:15	1.176
+++ LVM2/lib/metadata/lv_manip.c	2009/05/28 01:59:37	1.177
@@ -1844,6 +1844,10 @@
 		log_error("Failed to generate unique name for the new "
 			  "logical volume");
 		return NULL;
+	} else if (find_lv_in_vg(vg, name)) {
+		log_error("Unable to create LV %s in Volume Group %s: "
+			  "name already in use.", name, vg->name);
+		return NULL;
 	}
 
 	log_verbose("Creating logical volume %s", name);


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2009-05-28  0:29 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2009-05-28  0:29 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-05-28 00:29:15

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Rename internal vorigin LV to match visible LV.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1129&r2=1.1130
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.175&r2=1.176

--- LVM2/WHATS_NEW	2009/05/27 18:19:21	1.1129
+++ LVM2/WHATS_NEW	2009/05/28 00:29:14	1.1130
@@ -1,5 +1,6 @@
 Version 2.02.48 - 
 ===============================
+  Rename internal vorigin LV to match visible LV.
   Suppress 'removed' messages displayed when internal LVs are removed.
   Fix lvchange -a and -p for sparse LVs.
   Fix lvcreate --virtualsize to activate the new device immediately.
--- LVM2/lib/metadata/lv_manip.c	2009/05/27 18:19:21	1.175
+++ LVM2/lib/metadata/lv_manip.c	2009/05/28 00:29:15	1.176
@@ -1700,19 +1700,24 @@
 					void *data),
 			    void *data)
 {
+	struct logical_volume *org;
 	struct lv_segment *seg;
 	uint32_t s;
 
+	if (lv_is_cow(lv) && lv_is_virtual_origin(org = origin_from_cow(lv)))
+		if (!func(cmd, org, data))
+			return_0;
+
 	dm_list_iterate_items(seg, &lv->segments) {
 		if (seg->log_lv && !func(cmd, seg->log_lv, data))
-			return 0;
+			return_0;
 		for (s = 0; s < seg->area_count; s++) {
 			if (seg_type(seg, s) != AREA_LV)
 				continue;
 			if (!func(cmd, seg_lv(seg, s), data))
-				return 0;
+				return_0;
 			if (!_for_each_sub_lv(cmd, seg_lv(seg, s), func, data))
-				return 0;
+				return_0;
 		}
 	}
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2008-12-19 15:26 mbroz
  0 siblings, 0 replies; 45+ messages in thread
From: mbroz @ 2008-12-19 15:26 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2008-12-19 15:26:02

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Do not issue write behind lv size.
	
	pvcreate $DEV
	vgcreate -s 1k vg_test $DEV
	lvcreate -l 1 -n lv1 vg_test
	..
	/dev/vg_test/lv1: write failed after 1024 of 4096 at 0: No space left on device
	
	Just check for maximum write size in set_lv.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1013&r2=1.1014
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.161&r2=1.162

--- LVM2/WHATS_NEW	2008/12/19 15:24:52	1.1013
+++ LVM2/WHATS_NEW	2008/12/19 15:26:01	1.1014
@@ -1,5 +1,6 @@
 Version 2.02.44 - 
 ====================================
+  Check for maximal LV size when wiping device.
   Calculate mirror log size instead of using 1 extent.
   Check if requested major/minor pair is already used.
   Fix incorrect return value in help function.
--- LVM2/lib/metadata/lv_manip.c	2008/12/19 15:24:53	1.161
+++ LVM2/lib/metadata/lv_manip.c	2008/12/19 15:26:02	1.162
@@ -2698,9 +2698,13 @@
 	if (!dev_open_quiet(dev))
 		return_0;
 
-	dev_set(dev, UINT64_C(0),
-		sectors ? (size_t) sectors << SECTOR_SHIFT : (size_t) 4096,
-		value);
+	if (!sectors)
+		sectors = UINT64_C(4096) >> SECTOR_SHIFT;
+
+	if (sectors > lv->size)
+		sectors = lv->size;
+
+	dev_set(dev, UINT64_C(0), (size_t) sectors << SECTOR_SHIFT, value);
 	dev_flush(dev);
 	dev_close_immediate(dev);
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2008-10-17 10:57 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2008-10-17 10:57 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-10-17 10:57:15

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Use temp table to set device size when converting mirrors.
	
	(Avoids having same mirror table loaded twice concurrently by first
	using a 'zero' table to set the size of the device so when mirror
	table is preloaded it doesn't have to be activated immediately.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.976&r2=1.977
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.156&r2=1.157

--- LVM2/WHATS_NEW	2008/10/17 10:50:14	1.976
+++ LVM2/WHATS_NEW	2008/10/17 10:57:14	1.977
@@ -1,5 +1,6 @@
 Version 2.02.41 -
 =====================================
+  Use temp table to set device size when converting mirrors.
   In resume_mirror_images replace activate_lv with resume_lv as workaround.
   Avoid overwriting in-use on-disk text metadata by forgetting MDA_HEADER_SIZE.
   Fix snapshot monitoring library to not cancel monitoring invalid snapshot.
--- LVM2/lib/metadata/lv_manip.c	2008/09/29 09:59:10	1.156
+++ LVM2/lib/metadata/lv_manip.c	2008/10/17 10:57:15	1.157
@@ -2360,11 +2360,7 @@
 	struct segment_type *segtype;
 	struct lv_segment *mapseg;
 
-	if (!(segtype = get_segtype_from_string(cmd, "striped")))
-		return_NULL;
-
 	/* create an empty layer LV */
-
 	len = strlen(lv_where->name) + 32;
 	if (!(name = alloca(len))) {
 		log_error("layer name allocation failed. "
@@ -2384,12 +2380,43 @@
 		return NULL;
 	}
 
+	if (strstr(name, "_mimagetmp")) {
+		log_very_verbose("Creating transient 'zero' LV"
+				 " for Mirror -> mirror up-convert.");
+
+		segtype = get_segtype_from_string(cmd, "zero");
+
+		if (!lv_add_virtual_segment(layer_lv, 0, lv_where->le_count, segtype)) {
+			log_error("Creation of intermediate layer LV failed.");
+			return NULL;
+		}
+
+		if (!vg_write(lv_where->vg)) {
+			log_error("Failed to write intermediate VG metadata");
+			return NULL;
+		}
+
+		if (!vg_commit(lv_where->vg)) {
+			log_error("Failed to commit intermediate VG metadata");
+			vg_revert(lv_where->vg);
+			return NULL;
+		}
+
+		if (!activate_lv(cmd, layer_lv)) {
+			log_error("Failed to resume intermediate 'zero' LV, %s", name);
+			return NULL;
+		}
+	}
+
 	log_very_verbose("Inserting layer %s for %s",
 			 layer_lv->name, lv_where->name);
 
 	if (!_move_lv_segments(layer_lv, lv_where, 0, 0))
 		return_NULL;
 
+	if (!(segtype = get_segtype_from_string(cmd, "striped")))
+		return_NULL;
+
 	/* allocate a new linear segment */
 	if (!(mapseg = alloc_lv_segment(cmd->mem, segtype,
 					lv_where, 0, layer_lv->le_count,


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2008-09-29  9:59 mbroz
  0 siblings, 0 replies; 45+ messages in thread
From: mbroz @ 2008-09-29  9:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2008-09-29 09:59:10

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix misleading error message when there is no allocatable extents in VG.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.967&r2=1.968
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.155&r2=1.156

--- LVM2/WHATS_NEW	2008/09/25 15:59:10	1.967
+++ LVM2/WHATS_NEW	2008/09/29 09:59:10	1.968
@@ -1,5 +1,6 @@
 Version 2.02.41 -
 =====================================
+  Fix misleading error message when there is no allocatable extents in VG.
   Fix handling of PVs which reappeared with old metadata version.
   Fix mirror DSO to call vgreduce with proper parameters.
   Fix validation of --minor and --major in lvcreate to require -My always.
--- LVM2/lib/metadata/lv_manip.c	2008/08/05 12:05:25	1.155
+++ LVM2/lib/metadata/lv_manip.c	2008/09/29 09:59:10	1.156
@@ -1169,7 +1169,7 @@
 		stack;
 
 	areas_size = list_size(pvms);
-	if (areas_size < ah->area_count + ah->log_count) {
+	if (areas_size && areas_size < (ah->area_count + ah->log_count)) {
 		if (ah->alloc != ALLOC_ANYWHERE) {
 			log_error("Not enough PVs with free space available "
 				  "for parallel allocation.");


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2008-02-22 13:22 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2008-02-22 13:22 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-02-22 13:22:21

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Add missing no-longer-used segs_using_this_lv test to check_lv_segments.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.795&r2=1.796
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.150&r2=1.151

--- LVM2/WHATS_NEW	2008/02/15 14:12:32	1.795
+++ LVM2/WHATS_NEW	2008/02/22 13:22:19	1.796
@@ -1,17 +1,18 @@
 Version 2.02.34 -
 ===================================
-  Remove redundant if-before-free tests in clvmd.c.
-  Avoid a compiler warning: make is_orphan's parameter "const".
+  Add missing no-longer-used segs_using_this_lv test to check_lv_segments.
+  Remove redundant non-NULL tests before calling free in clvmd.c.
+  Avoid a compiler warning: make is_orphan's parameter const.
   Fix lvconvert detection of mirror conversion in progress. (2.02.30)
   Avoid automatic lvconvert polldaemon invocation when -R specified. (2.02.30)
   Fix 'pvs -a' to detect VGs of PVs without metadata areas.
   Divide up internal orphan volume group by format type.
   Update usage message for clvmd.
-  Fix clvmd man page printing <br>, clarified debug options.
-  Fix lvresize to support /dev/mapper prefix in the lvname
-  Fix unfilled paramater passed to fsadm from lvresize
-  Update fsadm to call lvresize if the partition size differs (with option -l)
-  Fix fsadm to support vg/lv name (like the rest of lv-tools)
+  Fix clvmd man page not to print <br> and clarified debug options.
+  Fix lvresize to support /dev/mapper prefix in the LV name.
+  Fix unfilled parameter passed to fsadm from lvresize.
+  Update fsadm to call lvresize if the partition size differs (with option -l).
+  Fix fsadm to support VG/LV names.
 
 Version 2.02.33 - 31st January 2008
 ===================================
--- LVM2/lib/metadata/lv_manip.c	2008/01/30 14:17:29	1.150
+++ LVM2/lib/metadata/lv_manip.c	2008/02/22 13:22:21	1.151
@@ -2308,6 +2308,9 @@
 	    parent->le_count != layer_lv->le_count)
 		return_0;
 
+	if (!lv_empty(parent))
+		return_0;
+
 	if (!_move_lv_segments(parent, layer_lv, 0, 0))
 		return_0;
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2007-01-05 15:53 mbroz
  0 siblings, 0 replies; 45+ messages in thread
From: mbroz @ 2007-01-05 15:53 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2007-01-05 15:53:41

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix create mirror with name longer than 22 chars.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.525&r2=1.526
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.114&r2=1.115

--- LVM2/WHATS_NEW	2006/12/20 16:19:01	1.525
+++ LVM2/WHATS_NEW	2007/01/05 15:53:40	1.526
@@ -1,5 +1,6 @@
 Version 2.02.18 -
 ====================================
+  Fix create mirror with name longer than 22 chars.
   Fix some activate.c prototypes when compiled without devmapper.
   Fix dmeventd mirror to cope if monitored device disappears.
 
--- LVM2/lib/metadata/lv_manip.c	2006/12/13 03:39:58	1.114
+++ LVM2/lib/metadata/lv_manip.c	2007/01/05 15:53:40	1.115
@@ -1493,7 +1493,7 @@
 	struct cmd_context *cmd = vg->cmd;
 	struct lv_list *ll = NULL;
 	struct logical_volume *lv;
-	char dname[32];
+	char dname[NAME_LEN];
 
 	if (vg->max_lv && (vg->max_lv == vg->lv_count)) {
 		log_error("Maximum number of logical volumes (%u) reached "


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2006-12-12 19:30 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2006-12-12 19:30 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-12-12 19:30:10

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix detection of smallest area in _alloc_parallel_area() for cling policy.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.518&r2=1.519
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.112&r2=1.113

--- LVM2/WHATS_NEW	2006/12/11 14:06:25	1.518
+++ LVM2/WHATS_NEW	2006/12/12 19:30:10	1.519
@@ -1,5 +1,6 @@
 Version 2.02.17 -
 ===================================
+  Fix detection of smallest area in _alloc_parallel_area() for cling policy.
   Add manpage entry for clvmd -T
   Fix gulm operation of clvmd, including a hang when doing lvchange -aey
   Fix hang in clvmd if a pre-command failed.
--- LVM2/lib/metadata/lv_manip.c	2006/10/30 16:10:55	1.112
+++ LVM2/lib/metadata/lv_manip.c	2006/12/12 19:30:10	1.113
@@ -628,17 +628,17 @@
 				struct pv_area **areas,
 				uint32_t *ix, struct pv_area *log_area)
 {
-	uint32_t area_len, smallest, remaining;
+	uint32_t area_len, remaining;
 	uint32_t s;
 	struct alloced_area *aa;
 
 	remaining = needed - *ix;
 	area_len = remaining / ah->area_multiple;
 
-	smallest = areas[ah->area_count - 1]->count;
-
-	if (area_len > smallest)
-		area_len = smallest;
+	/* Reduce area_len to the smallest of the areas */
+	for (s = 0; s < ah->area_count; s++)
+		if (area_len > areas[s]->count)
+			area_len = areas[s]->count;
 
 	if (!(aa = dm_pool_alloc(ah->mem, sizeof(*aa) *
 			      (ah->area_count + (log_area ? 1 : 0))))) {


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2006-10-30 16:10 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2006-10-30 16:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-30 16:10:56

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix high-level free space check for partial allocations.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.486&r2=1.487
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.111&r2=1.112

--- LVM2/WHATS_NEW	2006/10/27 15:37:02	1.486
+++ LVM2/WHATS_NEW	2006/10/30 16:10:55	1.487
@@ -1,5 +1,6 @@
 Version 2.02.14 - 
 ===================================
+  Fix high-level free space check for partial allocations.
 
 Version 2.02.13 - 27th October 2006
 ===================================
--- LVM2/lib/metadata/lv_manip.c	2006/10/23 15:54:51	1.111
+++ LVM2/lib/metadata/lv_manip.c	2006/10/30 16:10:55	1.112
@@ -894,10 +894,10 @@
 
 	/* Is there enough total space? */
 	free_pes = pv_maps_size(pvms);
-	if (needed > free_pes) {
+	if (needed - *allocated > free_pes) {
 		log_error("Insufficient free space: %" PRIu32 " extents needed,"
-			  " but only %" PRIu32 " available", needed,
-			  free_pes);
+			  " but only %" PRIu32 " available",
+			  needed - *allocated, free_pes);
 		return 0;
 	}
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2006-10-07 23:40 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2006-10-07 23:40 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-07 23:40:36

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	check_contiguous to use for_each_pv

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.460&r2=1.461
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109

--- LVM2/WHATS_NEW	2006/10/07 12:41:06	1.460
+++ LVM2/WHATS_NEW	2006/10/07 23:40:36	1.461
@@ -7,6 +7,7 @@
   Add report columns with underscore before field names ending 'size'.
   Correct regionsize default on lvcreate man page (MB).
   Fix clvmd bug that could cause it to die when a node with a long name crashed.
+  Add device size to text metadata.
   Fix format_text mda_setup pv->size and pv_setup pe_count calculations.
   Fix _for_each_pv() for mirror with core log.
   Add lvm_dump.sh script to create a tarball of debugging info from a system.
--- LVM2/lib/metadata/lv_manip.c	2006/10/07 16:00:28	1.108
+++ LVM2/lib/metadata/lv_manip.c	2006/10/07 23:40:36	1.109
@@ -398,6 +398,7 @@
  * Details of an allocation attempt
  */
 struct alloc_handle {
+	struct cmd_context *cmd;
 	struct dm_pool *mem;
 
 	alloc_policy_t alloc;		/* Overall policy */
@@ -417,7 +418,8 @@
 /*
  * Preparation for a specific allocation attempt
  */
-static struct alloc_handle *_alloc_init(struct dm_pool *mem,
+static struct alloc_handle *_alloc_init(struct cmd_context *cmd,
+					struct dm_pool *mem,
 					const struct segment_type *segtype,
 					alloc_policy_t alloc,
 					uint32_t mirrors,
@@ -464,6 +466,8 @@
 	if (segtype_is_virtual(segtype))
 		return ah;
 
+	ah->cmd = cmd;
+
 	if (!(ah->mem = dm_pool_create("allocation", 1024))) {
 		log_error("allocation pool creation failed");
 		return NULL;
@@ -675,7 +679,12 @@
  */
 static int _for_each_pv(struct cmd_context *cmd, struct logical_volume *lv,
 			uint32_t le, uint32_t len, uint32_t *max_seg_len,
-			int (*fn)(struct cmd_context *cmd, struct pv_segment *peg, void *data),
+			uint32_t first_area, uint32_t max_areas,
+			int top_level_area_index,
+			int only_single_area_segments,
+			int (*fn)(struct cmd_context *cmd,
+				  struct pv_segment *peg, uint32_t s,
+				  void *data),
 			void *data)
 {
 	struct lv_segment *seg;
@@ -701,24 +710,32 @@
 	area_multiple = segtype_is_striped(seg->segtype) ? seg->area_count : 1;
 	area_len = remaining_seg_len / area_multiple ? : 1;
 
-	for (s = 0; s < seg->area_count; s++) {
+	for (s = first_area;
+	     s < seg->area_count && (!max_areas || s <= max_areas);
+	     s++) {
 		if (seg_type(seg, s) == AREA_LV) {
 			if (!(r = _for_each_pv(cmd, seg_lv(seg, s),
 					       seg_le(seg, s) +
 					       (le - seg->le) / area_multiple,
-					       area_len, max_seg_len, fn,
+					       area_len, max_seg_len,
+					       only_single_area_segments ? 0 : 0,
+					       only_single_area_segments ? 1 : 0,
+					       top_level_area_index != -1 ? top_level_area_index : s,
+					       only_single_area_segments, fn,
 					       data)))
 				stack;
 		} else if (seg_type(seg, s) == AREA_PV)
-			if (!(r = fn(cmd, seg_pvseg(seg, s), data)))
+			if (!(r = fn(cmd, seg_pvseg(seg, s), top_level_area_index != -1 ? top_level_area_index : s, data)))
 				stack;
 		if (r != 1)
 			return r;
 	}
 
-	if (seg_is_mirrored(seg) && seg->log_lv) {
+	/* FIXME only_single_area_segments used as workaround to skip log LV - needs new param? */
+	if (!only_single_area_segments && seg_is_mirrored(seg) && seg->log_lv) {
 		if (!(r = _for_each_pv(cmd, seg->log_lv, 0, MIRROR_LOG_SIZE,
-				       NULL, fn, data)))
+				       NULL, 0, 0, 0, only_single_area_segments,
+				       fn, data)))
 			stack;
 		if (r != 1)
 			return r;
@@ -744,6 +761,18 @@
 }
 
 /*
+ * Search for pvseg that matches condition
+ */
+struct pv_match {
+	int (*condition)(struct pv_segment *pvseg, struct pv_area *pva);
+
+	struct pv_area **areas;
+	struct pv_area *pva;
+	uint32_t areas_size;
+	int s;	/* Area index of match */
+};
+
+/*
  * Is PV area contiguous to PV segment?
  */
 static int _is_contiguous(struct pv_segment *pvseg, struct pv_area *pva)
@@ -757,50 +786,49 @@
 	return 1;
 }
 
-static int _check_pv_contiguous(struct logical_volume *prev_lv, uint32_t prev_le, struct pv_area *pva,
-				struct pv_area **areas, uint32_t areas_size)
+static int _is_contiguous_condition(struct cmd_context *cmd,
+				    struct pv_segment *pvseg, uint32_t s,
+				    void *data)
 {
-	struct lv_segment *seg;
-	uint32_t s;
-	int r;
+	struct pv_match *pvmatch = data;
 
-	if (!(seg = find_seg_by_le(prev_lv, prev_le))) {
-		log_error("Failed to find segment for %s extent %" PRIu32,
-			  prev_lv->name, prev_le);
-		return 0;
-	}
+	if (!pvmatch->condition(pvseg, pvmatch->pva))
+		return 1;	/* Continue */
 
-	for (s = 0; s < seg->area_count && s < areas_size; s++) {
-		if (seg_type(seg, s) == AREA_LV) {
-			/* FIXME For more areas supply flattened seg to ensure consistency */
-			if (seg->area_count == 1) {
-				if (!(r = _check_pv_contiguous(seg->lv, seg->le + seg->len - 1, pva, &areas[s], 1)))
-					stack;
-				if (r != 1)
-					return r;
-			}
-		} else if (seg_type(seg, s) == AREA_PV)
-			if (_is_contiguous(seg_pvseg(seg, s), pva)) {
-				areas[s] = pva;
-				return 2; /* Finished */
-			}
-	}
+	if (s >= pvmatch->areas_size)
+		return 1;
+
+	pvmatch->areas[s] = pvmatch->pva;
 
-	return 1; /* Continue search */
+	return 2;	/* Finished */
 }
 
 /*
  * Is pva contiguous to any existing areas or on the same PV?
  */
-static int _check_contiguous(struct lv_segment *prev_lvseg, struct pv_area *pva,
+static int _check_contiguous(struct cmd_context *cmd,
+			     struct lv_segment *prev_lvseg, struct pv_area *pva,
 			     struct pv_area **areas, uint32_t areas_size)
 {
+	struct pv_match pvmatch;
 	int r;
 
-	if (!(r = _check_pv_contiguous(prev_lvseg->lv, prev_lvseg->le + prev_lvseg->len - 1, pva, areas, areas_size)))
+	pvmatch.condition = _is_contiguous;
+	pvmatch.areas = areas;
+	pvmatch.areas_size = areas_size;
+	pvmatch.pva = pva;
+
+	/* FIXME Cope with stacks by flattening */
+	if (!(r = _for_each_pv(cmd, prev_lvseg->lv,
+			       prev_lvseg->le + prev_lvseg->len - 1, 1, NULL,
+			       0, 0, -1, 1,
+			       _is_contiguous_condition, &pvmatch)))
 		stack;
 
-	return r ? 1 : 0;
+	if (r != 2)
+		return 0;
+
+	return 1;
 }
 
 /*
@@ -888,7 +916,8 @@
 			list_iterate_items(pva, &pvm->areas) {
 				if (contiguous) {
 					if (prev_lvseg &&
-					    _check_contiguous(prev_lvseg,
+					    _check_contiguous(ah->cmd,
+							      prev_lvseg,
 							      pva, areas,
 							      areas_size)) {
 						contiguous_count++;
@@ -1124,7 +1153,7 @@
 	if (alloc == ALLOC_INHERIT)
 		alloc = vg->alloc;
 
-	if (!(ah = _alloc_init(vg->cmd->mem, segtype, alloc, mirrors,
+	if (!(ah = _alloc_init(vg->cmd, vg->cmd->mem, segtype, alloc, mirrors,
 			       stripes, log_count, mirrored_pv,
 			       mirrored_pe, parallel_areas))) {
 		stack;
@@ -1468,7 +1497,8 @@
 	return lv;
 }
 
-static int _add_pvs(struct cmd_context *cmd, struct pv_segment *peg, void *data)
+static int _add_pvs(struct cmd_context *cmd, struct pv_segment *peg,
+		    uint32_t s __attribute((unused)), void *data)
 {
 	struct seg_pvs *spvs = (struct seg_pvs *) data;
 	struct pv_list *pvl;
@@ -1522,7 +1552,8 @@
 
 		/* Find next segment end */
 		/* FIXME Unnecessary nesting! */
-		if (!_for_each_pv(cmd, lv, current_le, spvs->len, &spvs->len, _add_pvs, (void *) spvs)) {
+		if (!_for_each_pv(cmd, lv, current_le, spvs->len, &spvs->len,
+				  0, 0, -1, 0, _add_pvs, (void *) spvs)) {
 			stack;
 			return NULL;
 		}


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2006-10-07 12:41 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2006-10-07 12:41 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-07 12:41:06

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Extend _for_each_pv() to allow termination without error.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.459&r2=1.460
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.106&r2=1.107

--- LVM2/WHATS_NEW	2006/10/07 11:00:09	1.459
+++ LVM2/WHATS_NEW	2006/10/07 12:41:06	1.460
@@ -1,5 +1,7 @@
 Version 2.02.11 - 
 =====================================
+  Extend _for_each_pv() to allow termination without error.
+  Abstract _is_contiguous().
   Remove duplicated pv arg from _check_contiguous().
   Accept regionsize with lvconvert.
   Add report columns with underscore before field names ending 'size'.
--- LVM2/lib/metadata/lv_manip.c	2006/10/07 11:34:53	1.106
+++ LVM2/lib/metadata/lv_manip.c	2006/10/07 12:41:06	1.107
@@ -670,6 +670,8 @@
  * Call fn for each AREA_PV used by the LV segment at lv:le of length *max_seg_len.
  * If any constituent area contains more than one segment, max_seg_len is
  * reduced to cover only the first.
+ * fn should return 0 on error, 1 to continue scanning or >1 to terminate without error.
+ * In the last case, this function passes on the return code.
  */
 static int _for_each_pv(struct cmd_context *cmd, struct logical_volume *lv,
 			uint32_t le, uint32_t len, uint32_t *max_seg_len,
@@ -679,6 +681,7 @@
 	struct lv_segment *seg;
 	uint32_t s;
 	uint32_t remaining_seg_len, area_len, area_multiple;
+	int r;
 
 	if (!(seg = find_seg_by_le(lv, le))) {
 		log_error("Failed to find segment for %s extent %" PRIu32,
@@ -698,20 +701,29 @@
 	area_multiple = segtype_is_striped(seg->segtype) ? seg->area_count : 1;
 	area_len = remaining_seg_len / area_multiple ? : 1;
 
-	for (s = 0; s < seg->area_count; s++)
+	for (s = 0; s < seg->area_count; s++) {
 		if (seg_type(seg, s) == AREA_LV) {
-			if (!_for_each_pv(cmd, seg_lv(seg, s),
-					  seg_le(seg, s) + (le - seg->le) / area_multiple,
-					  area_len, max_seg_len, fn, data))
-				return_0;
-		} else if ((seg_type(seg, s) == AREA_PV) &&
-			   !fn(cmd, seg_pvseg(seg, s), data))
-			return_0;
-
-	if (seg_is_mirrored(seg) && seg->log_lv &&
-	    !_for_each_pv(cmd, seg->log_lv, 0, MIRROR_LOG_SIZE,
-			  NULL, fn, data))
-		return_0;
+			if (!(r = _for_each_pv(cmd, seg_lv(seg, s),
+					       seg_le(seg, s) +
+					       (le - seg->le) / area_multiple,
+					       area_len, max_seg_len, fn,
+					       data)))
+				stack;
+		} else if (seg_type(seg, s) == AREA_PV)
+			if (!(r = fn(cmd, seg_pvseg(seg, s), data)))
+				stack;
+
+		if (r != 1)
+			return r;
+	}
+
+	if (seg_is_mirrored(seg) && seg->log_lv) {
+		if (!(r = _for_each_pv(cmd, seg->log_lv, 0, MIRROR_LOG_SIZE,
+				       NULL, fn, data)))
+			stack;
+		if (r != 1)
+			return r;
+	}
 
 	/* FIXME Add snapshot cow LVs etc. */
 


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2006-10-07 11:00 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2006-10-07 11:00 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-07 11:00:10

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Remove duplicated pv arg from _check_contiguous().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.458&r2=1.459
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104

--- LVM2/WHATS_NEW	2006/10/07 10:47:05	1.458
+++ LVM2/WHATS_NEW	2006/10/07 11:00:09	1.459
@@ -1,5 +1,6 @@
 Version 2.02.11 - 
 =====================================
+  Remove duplicated pv arg from _check_contiguous().
   Accept regionsize with lvconvert.
   Add report columns with underscore before field names ending 'size'.
   Correct regionsize default on lvcreate man page (MB).
--- LVM2/lib/metadata/lv_manip.c	2006/10/05 21:24:48	1.103
+++ LVM2/lib/metadata/lv_manip.c	2006/10/07 11:00:09	1.104
@@ -683,8 +683,7 @@
 /*
  * Is pva contiguous to any existing areas or on the same PV?
  */
-static int _check_contiguous(struct lv_segment *prev_lvseg,
-			     struct physical_volume *pv, struct pv_area *pva,
+static int _check_contiguous(struct lv_segment *prev_lvseg, struct pv_area *pva,
 			     struct pv_area **areas, uint32_t areas_size)
 {
 	struct pv_segment *prev_pvseg;
@@ -696,7 +695,7 @@
 			lastseg = list_item(list_last(&seg_lv(prev_lvseg, s)->segments), struct lv_segment);
 			/* FIXME For more areas supply flattened prev_lvseg to ensure consistency */
 			if (lastseg->area_count == 1 &&
-			    _check_contiguous(lastseg, pv, pva, &areas[s], 1))
+			    _check_contiguous(lastseg, pva, &areas[s], 1))
 				return 1;
 			continue;
 		}
@@ -704,7 +703,7 @@
 		if (!(prev_pvseg = seg_pvseg(prev_lvseg, s)))
 			continue; /* FIXME Broken */
 
-		if ((prev_pvseg->pv != pv))
+		if ((prev_pvseg->pv != pva->map->pv))
 			continue;
 
 		if (prev_pvseg->pe + prev_pvseg->len == pva->start) {
@@ -802,7 +801,6 @@
 				if (contiguous) {
 					if (prev_lvseg &&
 					    _check_contiguous(prev_lvseg,
-							      pvm->pv,
 							      pva, areas,
 							      areas_size)) {
 						contiguous_count++;


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2006-10-05 21:24 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2006-10-05 21:24 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-05 21:24:48

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix _for_each_pv() for mirror with core log.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.453&r2=1.454
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.102&r2=1.103

--- LVM2/WHATS_NEW	2006/10/05 18:42:33	1.453
+++ LVM2/WHATS_NEW	2006/10/05 21:24:46	1.454
@@ -1,5 +1,6 @@
 Version 2.02.11 - 
 =====================================
+  Fix _for_each_pv() for mirror with core log.
   Add lvm_dump.sh script to create a tarball of debugging info from a system.
   Capture error messages in clvmd and pass them back to the user.
   Remove unused #defines from filter-md.c.
--- LVM2/lib/metadata/lv_manip.c	2006/09/11 21:14:56	1.102
+++ LVM2/lib/metadata/lv_manip.c	2006/10/05 21:24:48	1.103
@@ -1424,7 +1424,7 @@
 			   !fn(cmd, seg_pvseg(seg, s), data))
 			return_0;
 
-	if (seg_is_mirrored(seg) && 
+	if (seg_is_mirrored(seg) && seg->log_lv &&
 	    !_for_each_pv(cmd, seg->log_lv, 0, MIRROR_LOG_SIZE,
 			  NULL, fn, data))
 		return_0;


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2005-11-28 20:01 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2005-11-28 20:01 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-11-28 20:01:00

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Determine parallel PVs to avoid with ALLOC_NORMAL allocation. (untested)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.330&r2=1.331
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.93&r2=1.94


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2005-11-24 18:46 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2005-11-24 18:46 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-11-24 18:46:51

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Fix lv_empty.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.329&r2=1.330
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.90&r2=1.91


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2005-07-12 14:50 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2005-07-12 14:50 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-07-12 14:50:46

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Only make one attempt at contiguous allocation.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.264&r2=1.265
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.80&r2=1.81


^ permalink raw reply	[flat|nested] 45+ messages in thread
* LVM2 ./WHATS_NEW lib/metadata/lv_manip.c
@ 2005-06-03 18:07 agk
  0 siblings, 0 replies; 45+ messages in thread
From: agk @ 2005-06-03 18:07 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-06-03 18:07:13

Modified files:
	.              : WHATS_NEW 
	lib/metadata   : lv_manip.c 

Log message:
	Allow mirror images to have more than one segment.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.249&r2=1.250
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77


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

end of thread, other threads:[~2012-05-11 22:19 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-23 11:21 LVM2 ./WHATS_NEW lib/metadata/lv_manip.c agk
  -- strict thread matches above, loose matches on Subject: below --
2012-05-11 22:19 agk
2012-05-11 18:59 agk
2012-05-09 12:12 zkabelac
2012-03-05 14:13 zkabelac
2012-02-29 22:09 zkabelac
2012-02-22 17:14 jbrassow
2012-02-09 15:13 prajnoha
2012-02-08 13:02 zkabelac
2012-01-20 22:04 snitzer
2011-11-15 17:32 zkabelac
2011-11-15 17:28 zkabelac
2011-10-28 20:23 zkabelac
2011-10-28 20:17 zkabelac
2011-09-14 14:20 mbroz
2011-09-13 18:43 jbrassow
2011-06-29 17:05 agk
2011-04-07 21:49 jbrassow
2011-02-27  1:16 agk
2011-01-28  2:58 snitzer
2010-12-20 14:38 zkabelac
2010-12-01 12:56 zkabelac
2010-03-29 17:59 agk
2010-03-25 18:16 agk
2010-03-23 15:07 agk
2010-01-12 20:53 agk
2010-01-05 15:58 mbroz
2009-05-30  0:09 agk
2009-05-28  1:59 agk
2009-05-28  0:29 agk
2008-12-19 15:26 mbroz
2008-10-17 10:57 agk
2008-09-29  9:59 mbroz
2008-02-22 13:22 agk
2007-01-05 15:53 mbroz
2006-12-12 19:30 agk
2006-10-30 16:10 agk
2006-10-07 23:40 agk
2006-10-07 12:41 agk
2006-10-07 11:00 agk
2006-10-05 21:24 agk
2005-11-28 20:01 agk
2005-11-24 18:46 agk
2005-07-12 14:50 agk
2005-06-03 18:07 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).