public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/lib/metadata mirror.c
@ 2011-04-12 14:13 zkabelac
  0 siblings, 0 replies; 31+ messages in thread
From: zkabelac @ 2011-04-12 14:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-04-12 14:13:18

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Replace dm_snprintf with strncpy
	
	My previous patch fixed incorrect error check for dm_snprintf.
	However in this particular case - dm_snprintf has been used differently -
	just like strncpy + setting last char with '\0' - so the code had to return
	error - because the buffer was to short for whole string.
	
	Patch replaces it with real strncpy.
	Also test for alloca() failure is removed - as the program behaviour
	is rather undefined in this case - it never returns NULL.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.149&r2=1.150

--- LVM2/lib/metadata/mirror.c	2011/04/09 19:05:24	1.149
+++ LVM2/lib/metadata/mirror.c	2011/04/12 14:13:17	1.150
@@ -1785,13 +1785,10 @@
 		lv_name = lv->name;
 		suffix = "_mlogtmp_%d";
 	} else if ((lv_name = strstr(lv->name, MIRROR_SYNC_LAYER))) {
-		len = lv_name - lv->name + 1;
-		if (!(tmp_name = alloca(len)) ||
-		    (dm_snprintf(tmp_name, len, "%s", lv->name) < 0)) {
-			log_error("mirror log name allocation failed");
-			return 0;
-		}
-		lv_name = tmp_name;
+		len = lv_name - lv->name;
+		tmp_name = alloca(len + 1);
+		tmp_name[len] = '\0';
+		lv_name = strncpy(tmp_name, lv->name, len);
 		suffix = "_mlog";
 	} else {
 		lv_name = lv->name;


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

* LVM2/lib/metadata mirror.c
@ 2012-02-01 15:05 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2012-02-01 15:05 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-02-01 15:05:53

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Adjust comments

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

--- LVM2/lib/metadata/mirror.c	2012/02/01 13:50:37	1.175
+++ LVM2/lib/metadata/mirror.c	2012/02/01 15:05:53	1.176
@@ -325,8 +325,9 @@
 
 	backup(log_lv->vg);
 
-	// FIXME: Wait here explicitly, so deactivation of log_lv is finished
+	/* Wait for events following any deactivation before reactivating */
 	sync_local_dev_names(cmd);
+
 	if (!activate_lv(cmd, log_lv)) {
 		log_error("Aborting. Failed to activate mirror log.");
 		goto revert_new_lv;
@@ -439,8 +440,9 @@
 	if (!_activate_lv_like_model(lv, lv))
 		return_0;
 
-	// FIXME: Wait here should not be need
+	/* FIXME Is this superfluous now? */
 	sync_local_dev_names(cmd);
+
 	if (!deactivate_lv(cmd, lv))
 		return_0;
 


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

* LVM2/lib/metadata mirror.c
@ 2011-09-19 14:28 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2011-09-19 14:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-09-19 14:28:24

Modified files:
	lib/metadata   : mirror.c 

Log message:
	fix compiler warning.
	
	Compiler says variable may be used uninitialized.  It can't be, but we
	initialize the variable to NULL anyway.  Also, remove the double initialization
	of another variable.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.170&r2=1.171

--- LVM2/lib/metadata/mirror.c	2011/09/16 16:41:37	1.170
+++ LVM2/lib/metadata/mirror.c	2011/09/19 14:28:23	1.171
@@ -584,7 +584,7 @@
 	struct logical_volume *detached_log_lv = NULL;
 	struct lv_segment *mirrored_seg = first_seg(lv);
 	struct dm_list split_images;
-	struct lv_list *lvl, *new_lvl;
+	struct lv_list *lvl, *new_lvl = NULL;
 	struct cmd_context *cmd = lv->vg->cmd;
 
 	if (!(lv->status & MIRRORED)) {
@@ -748,7 +748,6 @@
 	 *   - activate the new LV
 	 */
 	sync_local_dev_names(lv->vg->cmd);
-	new_lv = NULL;
 	dm_list_iterate_items(lvl, &split_images) {
 		if (!new_lv) {
 			/* Grab 1st sub-LV for later */


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

* LVM2/lib/metadata mirror.c
@ 2011-09-16 16:41 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2011-09-16 16:41 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-09-16 16:41:37

Modified files:
	lib/metadata   : mirror.c 

Log message:
	After suspend/resume following a splitmirror op, call sync_local_dev_names
	to settle udev before calling deactivate_lv.
	
	This is an intra-release regression (no WHATS_NEW entry required).  It is
	part of the fix for the current WHATS_NEW entry:
	Work around resume_lv causing error LV scanning during splitmirror operation.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.169&r2=1.170

--- LVM2/lib/metadata/mirror.c	2011/09/14 09:54:21	1.169
+++ LVM2/lib/metadata/mirror.c	2011/09/16 16:41:37	1.170
@@ -747,6 +747,7 @@
 	 *   - commit VG changes
 	 *   - activate the new LV
 	 */
+	sync_local_dev_names(lv->vg->cmd);
 	new_lv = NULL;
 	dm_list_iterate_items(lvl, &split_images) {
 		if (!new_lv) {


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

* LVM2/lib/metadata mirror.c
@ 2011-09-14  9:54 zkabelac
  0 siblings, 0 replies; 31+ messages in thread
From: zkabelac @ 2011-09-14  9:54 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-09-14 09:54:21

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Add missing underscores to local static functions

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.168&r2=1.169

--- LVM2/lib/metadata/mirror.c	2011/09/14 04:10:26	1.168
+++ LVM2/lib/metadata/mirror.c	2011/09/14 09:54:21	1.169
@@ -81,7 +81,7 @@
  *
  * Returns: 1 if available, 0 otherwise
  */
-static int cluster_mirror_is_available(struct logical_volume *lv)
+static int _cluster_mirror_is_available(struct logical_volume *lv)
 {
        unsigned attr = 0;
        struct cmd_context *cmd = lv->vg->cmd;
@@ -1256,7 +1256,7 @@
 	return 1;
 }
 
-static int get_mirror_fault_policy(struct cmd_context *cmd __attribute__((unused)),
+static int _get_mirror_fault_policy(struct cmd_context *cmd __attribute__((unused)),
 				   int log_policy)
 {
 	const char *policy;
@@ -1287,14 +1287,14 @@
 	return MIRROR_REMOVE;
 }
 
-static int get_mirror_log_fault_policy(struct cmd_context *cmd)
+static int _get_mirror_log_fault_policy(struct cmd_context *cmd)
 {
-	return get_mirror_fault_policy(cmd, 1);
+	return _get_mirror_fault_policy(cmd, 1);
 }
 
-static int get_mirror_device_fault_policy(struct cmd_context *cmd)
+static int _get_mirror_device_fault_policy(struct cmd_context *cmd)
 {
-	return get_mirror_fault_policy(cmd, 0);
+	return _get_mirror_fault_policy(cmd, 0);
 }
 
 /*
@@ -1310,7 +1310,7 @@
  *
  * Returns: 0 on failure, 1 on reconfig, -1 if no reconfig done
  */
-static int replace_mirror_images(struct lv_segment *mirrored_seg,
+static int _replace_mirror_images(struct lv_segment *mirrored_seg,
 				 uint32_t num_mirrors,
 				 int log_policy, int in_sync)
 {
@@ -1381,10 +1381,10 @@
 	log_warn("WARNING: Bad device removed from mirror volume, %s/%s",
 		  mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
 
-	log_policy = get_mirror_log_fault_policy(mirrored_seg->lv->vg->cmd);
-	dev_policy = get_mirror_device_fault_policy(mirrored_seg->lv->vg->cmd);
+	log_policy = _get_mirror_log_fault_policy(mirrored_seg->lv->vg->cmd);
+	dev_policy = _get_mirror_device_fault_policy(mirrored_seg->lv->vg->cmd);
 
-	r = replace_mirror_images(mirrored_seg,
+	r = _replace_mirror_images(mirrored_seg,
 				  (dev_policy != MIRROR_REMOVE) ?
 				  old_num_mirrors : num_mirrors,
 				  log_policy, in_sync);
@@ -2103,7 +2103,7 @@
 
 	if (vg_is_clustered(lv->vg)) {
 		/* FIXME: review check of lv_is_active_remotely */
-		if (!cluster_mirror_is_available(lv)) {
+		if (!_cluster_mirror_is_available(lv)) {
 			log_error("Shared cluster mirrors are not available.");
 			return 0;
 		}


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

* LVM2/lib/metadata mirror.c
@ 2011-09-14  4:10 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2011-09-14  4:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-09-14 04:10:27

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Additional fixes for lv_mirror_count.
	
	Changing lv_mirror_count to only count the AREA_LVs made the function
	stop working for PVMOVE mirrors.  A conditional has been added to fix
	that problem.  Additionally, when counting the images in a mirror stack,
	we don't need to subtract 1 from the count we get back from the
	lv_mirror_count call on the temporary mirror layer.  (This is because we
	are no falsely counting the top layer of the temporary mirror.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.167&r2=1.168

--- LVM2/lib/metadata/mirror.c	2011/09/14 02:45:37	1.167
+++ LVM2/lib/metadata/mirror.c	2011/09/14 04:10:26	1.168
@@ -114,13 +114,17 @@
 		return 1;
 
 	seg = first_seg(lv);
+
+	if (lv->status & PVMOVE)
+		return seg->area_count;
+
 	mirrors = 0;
 
 	for (s = 0; s < seg->area_count; s++) {
 		if (seg_type(seg, s) != AREA_LV)
 			continue;
 		if (is_temporary_mirror_layer(seg_lv(seg, s)))
-			mirrors += lv_mirror_count(seg_lv(seg, s)) - 1;
+			mirrors += lv_mirror_count(seg_lv(seg, s));
 		else
 			mirrors++;
 	}


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

* LVM2/lib/metadata mirror.c
@ 2011-09-13 18:11 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2011-09-13 18:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Better fix for bug 737125 - unable to create mirror on 1K extent size VG
	
	WHATS_NEW entry:
	Fix log size calculation when only a log is being added to a mirror.
	
	The original fix pass the mirror LV to allocate_extents (rather than
	passing NULL) so that _alloc_init could correctly determine the necessary
	size of the mirror log.  In the previous check-in, I noted:
	In order to get a decent value computed, we need to pass in the 'lv' argument
	to allocate_extents.  This would normally imply a desire for cling/contiguous
	allocation to the given LV, but since we are not allocating any parallel
	extents and only log extents, it works fine.
	However, passing in the LV did have unintended consequences on the placement of
	the log.  The better solution is to pass in the number of extext that are in
	the mirror LV instead of the LV itself.  This will not cause the allocator to
	reserve that number of extents, because 'stripes' and 'mirrors' are specified
	as 0.  Thus, 'extents' is used to calculate the size of the log, but won't
	affect how much is allocated.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.164&r2=1.165

--- LVM2/lib/metadata/mirror.c	2011/09/13 14:37:49	1.164
+++ LVM2/lib/metadata/mirror.c	2011/09/13 18:11:38	1.165
@@ -1966,9 +1966,10 @@
 	}
 
 	/* allocate destination extents */
-	ah = allocate_extents(lv->vg, lv, segtype,
-			      0, 0, log_count - old_log_count, region_size, 0,
-			      allocatable_pvs, alloc, parallel_areas);
+	ah = allocate_extents(lv->vg, NULL, segtype,
+			      0, 0, log_count - old_log_count, region_size,
+			      lv->le_count, allocatable_pvs,
+			      alloc, parallel_areas);
 	if (!ah) {
 		log_error("Unable to allocate extents for mirror log.");
 		return 0;


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

* LVM2/lib/metadata mirror.c
@ 2011-06-24 23:39 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2011-06-24 23:39 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-06-24 23:39:09

Modified files:
	lib/metadata   : mirror.c 

Log message:
	remove unused var after recent patch

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

--- LVM2/lib/metadata/mirror.c	2011/06/23 14:00:59	1.156
+++ LVM2/lib/metadata/mirror.c	2011/06/24 23:39:09	1.157
@@ -1853,7 +1853,6 @@
 	percent_t sync_percent;
 	int in_sync;
 	struct logical_volume *log_lv;
-	struct lvinfo info;
 	unsigned old_log_count;
 	int r = 0;
 


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

* LVM2/lib/metadata mirror.c
@ 2011-03-24 12:28 mornfall
  0 siblings, 0 replies; 31+ messages in thread
From: mornfall @ 2011-03-24 12:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2011-03-24 12:28:02

Modified files:
	lib/metadata   : mirror.c 

Log message:
	In some cases, we could end up with a mirrored LV without a MIRRORED flag. In
	other cases, the code could wind up removing wrong number of mirrors. In yet
	other cases, we could remove the right number of mirrors, but fail to respect
	the removal preferences (i.e. keep an image that was requested to be removed
	while removing an image that was requested to be kept). Under some
	circumstances, remove_mirror_images could also get stuck in an infinite loop.
	
	This patch should fix all of the above undesirable behaviours.
	
	Signed-off-by: Petr Rockai <prockai@redhat.com>
	Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.144&r2=1.145

--- LVM2/lib/metadata/mirror.c	2011/03/11 14:56:56	1.144
+++ LVM2/lib/metadata/mirror.c	2011/03/24 12:28:02	1.145
@@ -779,7 +779,7 @@
 				 int (*is_removable)(struct logical_volume *, void *),
 				 void *removable_baton,
 				 unsigned remove_log, unsigned collapse,
-				 uint32_t *removed)
+				 uint32_t *removed, int preferred_only)
 {
 	uint32_t m;
 	int32_t s;
@@ -791,12 +791,13 @@
 	uint32_t new_area_count = mirrored_seg->area_count;
 	struct lv_list *lvl;
 	struct dm_list tmp_orphan_lvs;
+	int orig_removed = num_removed;
 
 	if (removed)
 		*removed = 0;
 
-	log_very_verbose("Reducing mirror set from %" PRIu32 " to %"
-			 PRIu32 " image(s)%s.",
+	log_very_verbose("Reducing mirror set %s from %" PRIu32 " to %"
+			 PRIu32 " image(s)%s.", lv->name,
 			 old_area_count, old_area_count - num_removed,
 			 remove_log ? " and no log volume" : "");
 
@@ -805,12 +806,14 @@
 		return 0;
 	}
 
+	num_removed = 0;
+
 	/* Move removable_pvs to end of array */
 	for (s = mirrored_seg->area_count - 1;
-	     s >= 0 && old_area_count - new_area_count < num_removed;
+	     s >= 0 && old_area_count - new_area_count < orig_removed;
 	     s--) {
 		sub_lv = seg_lv(mirrored_seg, s);
-		if (!is_temporary_mirror_layer(sub_lv) &&
+		if (!(is_temporary_mirror_layer(sub_lv) && lv_mirror_count(sub_lv) != 1) &&
 		    is_removable(sub_lv, removable_baton)) {
 			/*
 			 * Check if the user is trying to pull the
@@ -824,10 +827,14 @@
 			}
 			if (!shift_mirror_images(mirrored_seg, s))
 				return_0;
-			new_area_count--;
+			--new_area_count;
+			++num_removed;
 		}
 	}
 
+	if (!preferred_only)
+		num_removed = orig_removed;
+
 	/*
 	 * If removable_pvs were specified, then they have been shifted
 	 * to the end to ensure they are removed.  The remaining balance
@@ -864,12 +871,19 @@
 		detached_log_lv = detach_mirror_log(mirrored_seg);
 		if (!remove_layer_from_lv(lv, temp_layer_lv))
 			return_0;
-		lv->status &= ~MIRRORED;
-		lv->status &= ~MIRROR_NOTSYNCED;
 		if (collapse && !_merge_mirror_images(lv, &tmp_orphan_lvs)) {
 			log_error("Failed to add mirror images");
 			return 0;
 		}
+                /*
+                 * No longer a mirror? Even though new_area_count was 1,
+                 * _merge_mirror_images may have resulted into lv being still a
+                 * mirror. Fix up the flags if we only have one image left.
+                 */
+                if (lv_mirror_count(lv) == 1) {
+                    lv->status &= ~MIRRORED;
+                    lv->status &= ~MIRROR_NOTSYNCED;
+                }
 		mirrored_seg = first_seg(lv);
 		if (remove_log && !detached_log_lv)
 			detached_log_lv = detach_mirror_log(mirrored_seg);
@@ -1035,7 +1049,7 @@
 		*removed = old_area_count - new_area_count;
 
 	log_very_verbose("%" PRIu32 " image(s) removed from %s",
-			 old_area_count - num_removed, lv->name);
+			 old_area_count - new_area_count, lv->name);
 
 	return 1;
 }
@@ -1051,6 +1065,9 @@
 	uint32_t existing_mirrors = lv_mirror_count(lv);
 	struct logical_volume *next_lv = lv;
 
+	int preferred_only = 1;
+	int retries = 0;
+
 	num_removed = existing_mirrors - num_mirrors;
 
 	/* num_removed can be 0 if the function is called just to remove log */
@@ -1062,17 +1079,33 @@
 
 		if (!_remove_mirror_images(next_lv, removed_once,
 					   is_removable, removable_baton,
-					   remove_log, 0, &r))
+					   remove_log, 0, &r, preferred_only))
 			return_0;
 
-		if (r < removed_once) {
+		if (r < removed_once || !removed_once) {
 			/* Some mirrors are removed from the temporary mirror,
 			 * but the temporary layer still exists.
 			 * Down the stack and retry for remainder. */
 			next_lv = find_temporary_mirror(next_lv);
+			if (!next_lv) {
+				preferred_only = 0;
+				next_lv = lv;
+			}
 		}
 
 		num_removed -= r;
+
+		/*
+		 * if there are still images to be removed, try again; this is
+		 * required since some temporary layers may have been reduced
+		 * to 1, at which point they are made removable, just like
+		 * normal images
+		 */
+		if (!next_lv && !preferred_only && !retries && num_removed) {
+			++retries;
+			preferred_only = 1;
+		}
+
 	} while (next_lv && num_removed);
 
 	if (num_removed) {
@@ -1126,7 +1159,7 @@
 
 		if (!_remove_mirror_images(mirror_seg->lv,
 					   mirror_seg->area_count - 1,
-					   _no_removable_images, NULL, 0, 1, NULL)) {
+					   _no_removable_images, NULL, 0, 1, NULL, 0)) {
 			log_error("Failed to release mirror images");
 			return 0;
 		}
@@ -1252,7 +1285,7 @@
 
 	r = _remove_mirror_images(mirrored_seg->lv, old_num_mirrors - num_mirrors,
 				  is_mirror_image_removable, removable_pvs,
-				  remove_log, 0, NULL);
+				  remove_log, 0, NULL, 0);
 	if (!r)
 		/* Unable to remove bad devices */
 		return 0;


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

* LVM2/lib/metadata mirror.c
@ 2011-01-11 17:21 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2011-01-11 17:21 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-01-11 17:21:02

Modified files:
	lib/metadata   : mirror.c 

Log message:
	s/log_verbose/log_error/ - Increase log level on error message.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.139&r2=1.140

--- LVM2/lib/metadata/mirror.c	2011/01/11 17:05:09	1.139
+++ LVM2/lib/metadata/mirror.c	2011/01/11 17:21:01	1.140
@@ -1325,10 +1325,9 @@
 			first_area = m * stripes + (log - 1);
 
 			if (!lv_add_log_segment(ah, first_area, img_lvs[m], 0)) {
-				/* error msg already from lv_add_log_segment */
-				log_verbose("Failed to add mirror image segment"
-					    " to %s. Remove new LV and retry.",
-					    img_lvs[m]->name);
+				log_error("Failed to add mirror image segment"
+					  " to %s. Remove new LV and retry.",
+					  img_lvs[m]->name);
 				return 0;
 			}
 		} else {


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

* LVM2/lib/metadata mirror.c
@ 2010-07-09 17:57 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2010-07-09 17:57 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2010-07-09 17:57:52

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Failed to test for the case where a log was requested to be removed
	even though there was no log.  A simple run through the in-tree test
	suite would have caught this.  :(
	
	-               if (lv_is_mirrored(detached_log_lv) &&
	+               if (detached_log_lv && lv_is_mirrored(detached_log_lv) &&
	
	Also, made some cosmetic changes suggested by kabi after my last check-in
	(e.g. s/return 0/return_0/ and adding an error message).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.124&r2=1.125

--- LVM2/lib/metadata/mirror.c	2010/07/09 15:34:45	1.124
+++ LVM2/lib/metadata/mirror.c	2010/07/09 17:57:51	1.125
@@ -879,7 +879,7 @@
 		 * have failed, we must replace with error target - it is
 		 * the only way to release the pending writes.
 		 */
-		if (lv_is_mirrored(detached_log_lv) &&
+		if (detached_log_lv && lv_is_mirrored(detached_log_lv) &&
 		    (detached_log_lv->status & PARTIAL_LV)) {
 			struct lv_segment *seg = first_seg(detached_log_lv);
 
@@ -896,8 +896,10 @@
 				seg_lv(seg, m)->status &= ~MIRROR_IMAGE;
 				lv_set_visible(seg_lv(seg, m));
 				if (!(lvl = dm_pool_alloc(lv->vg->cmd->mem,
-							  sizeof(*lvl))))
+							  sizeof(*lvl)))) {
+					log_error("dm_pool_alloc failed");
 					return 0;
+				}
 				lvl->lv = seg_lv(seg, m);
 				dm_list_add(&tmp_orphan_lvs, &lvl->list);
 			}
@@ -905,7 +907,7 @@
 			if (!replace_lv_with_error_segment(detached_log_lv)) {
 				log_error("Failed error target substitution for %s",
 					  detached_log_lv->name);
-				return_0;
+				return 0;
 			}
 
 			if (!vg_write(detached_log_lv->vg)) {
@@ -926,7 +928,7 @@
 
 			if (!resume_lv(detached_log_lv->vg->cmd,
 				       detached_log_lv))
-					return 0;
+					return_0;
 		}
 	}
 


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

* LVM2/lib/metadata mirror.c
@ 2010-06-23 13:57 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2010-06-23 13:57 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2010-06-23 13:57:26

Modified files:
	lib/metadata   : mirror.c 

Log message:
	The function that runs to compress a stacked mirror after
	converting from 2-way to 3-way mirror (collapse_mirrored_lv)
	was calling '_remove_mirror_images' with the 'remove_log'
	parameter set.  When the code was put in to fix 599898 to
	honor log parameters during conversion, this argument was
	suddenly being honored.  Thus, when someone would convert from
	a 2-way to 3-way mirror, the log would get removed.
	
	'collapse_mirrored_lv' should not be calling '_remove_mirror_images'
	with 'remove_log' set.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.119&r2=1.120

--- LVM2/lib/metadata/mirror.c	2010/06/21 16:12:34	1.119
+++ LVM2/lib/metadata/mirror.c	2010/06/23 13:57:26	1.120
@@ -1038,7 +1038,7 @@
 
 		if (!_remove_mirror_images(mirror_seg->lv,
 					   mirror_seg->area_count - 1,
-					   _no_removable_images, NULL, 1, 1, NULL)) {
+					   _no_removable_images, NULL, 0, 1, NULL)) {
 			log_error("Failed to release mirror images");
 			return 0;
 		}


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

* LVM2/lib/metadata mirror.c
@ 2010-04-20 12:14 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2010-04-20 12:14 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-04-20 12:14:31

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Move function up file

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

--- LVM2/lib/metadata/mirror.c	2010/04/09 01:00:11	1.112
+++ LVM2/lib/metadata/mirror.c	2010/04/20 12:14:28	1.113
@@ -516,6 +516,21 @@
 	return !count;
 }
 
+static int _mirrored_lv_in_sync(struct logical_volume *lv)
+{
+	float sync_percent;
+	percent_range_t percent_range;
+
+	if (!lv_mirror_percent(lv->vg->cmd, lv, 0, &sync_percent,
+			       &percent_range, NULL)) {
+		log_error("Unable to determine mirror sync status of %s/%s.",
+			  lv->vg->name, lv->name);
+		return 0;
+	}
+
+	return (percent_range == PERCENT_100) ? 1 : 0;
+}
+
 /*
  * Split off 'split_count' legs from a mirror
  *
@@ -960,21 +975,6 @@
 	return 1;
 }
 
-static int _mirrored_lv_in_sync(struct logical_volume *lv)
-{
-	float sync_percent;
-	percent_range_t percent_range;
-
-	if (!lv_mirror_percent(lv->vg->cmd, lv, 0, &sync_percent,
-			       &percent_range, NULL)) {
-		log_error("Unable to determine mirror sync status of %s/%s.",
-			  lv->vg->name, lv->name);
-		return 0;
-	}
-
-	return (percent_range == PERCENT_100) ? 1 : 0;
-}
-
 /*
  * Collapsing temporary mirror layers.
  *


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

* LVM2/lib/metadata mirror.c
@ 2010-04-01 14:54 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2010-04-01 14:54 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-04-01 14:54:38

Modified files:
	lib/metadata   : mirror.c 

Log message:
	A few more log_error to log_warn changes for mirrors.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.109&r2=1.110

--- LVM2/lib/metadata/mirror.c	2010/03/26 22:15:43	1.109
+++ LVM2/lib/metadata/mirror.c	2010/04/01 14:54:37	1.110
@@ -1080,15 +1080,15 @@
 	/* FIXME: Use lvconvert rather than duplicating its code */
 
 	if (mirrored_seg->area_count < num_mirrors) {
-		log_error("WARNING: Failed to replace mirror device in %s/%s",
-			  mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
+		log_warn("WARNING: Failed to replace mirror device in %s/%s",
+			 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
 
 		if ((mirrored_seg->area_count > 1) && !mirrored_seg->log_lv)
-			log_error("WARNING: Use 'lvconvert -m %d %s/%s --corelog' to replace failed devices",
-				  num_mirrors - 1, lv->vg->name, lv->name);
+			log_warn("WARNING: Use 'lvconvert -m %d %s/%s --corelog' to replace failed devices",
+				 num_mirrors - 1, lv->vg->name, lv->name);
 		else
-			log_error("WARNING: Use 'lvconvert -m %d %s/%s' to replace failed devices",
-				  num_mirrors - 1, lv->vg->name, lv->name);
+			log_warn("WARNING: Use 'lvconvert -m %d %s/%s' to replace failed devices",
+				 num_mirrors - 1, lv->vg->name, lv->name);
 		r = 0;
 
 		/* REMEMBER/FIXME: set in_sync to 0 if a new mirror device was added */
@@ -1101,11 +1101,11 @@
 	 */
 	if ((mirrored_seg->area_count > 1) && !mirrored_seg->log_lv &&
 	    (log_policy != MIRROR_REMOVE)) {
-		log_error("WARNING: Failed to replace mirror log device in %s/%s",
-			  lv->vg->name, lv->name);
+		log_warn("WARNING: Failed to replace mirror log device in %s/%s",
+			 lv->vg->name, lv->name);
 
-		log_error("WARNING: Use 'lvconvert -m %d %s/%s' to replace failed devices",
-			  mirrored_seg->area_count - 1 , lv->vg->name, lv->name);
+		log_warn("WARNING: Use 'lvconvert -m %d %s/%s' to replace failed devices",
+			 mirrored_seg->area_count - 1 , lv->vg->name, lv->name);
 		r = 0;
 	}
 
@@ -1150,8 +1150,8 @@
 
 	if (!r)
 		/* Failed to replace device(s) */
-		log_error("WARNING: Unable to find substitute device for mirror volume, %s/%s",
-			  mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
+		log_warn("WARNING: Unable to find substitute device for mirror volume, %s/%s",
+			 mirrored_seg->lv->vg->name, mirrored_seg->lv->name);
 	else if (r > 0)
 		/* Success in replacing device(s) */
 		log_warn("WARNING: Mirror volume, %s/%s restored - substitute for failed device found.",


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

* LVM2/lib/metadata mirror.c
@ 2010-01-08 10:50 zkabelac
  0 siblings, 0 replies; 31+ messages in thread
From: zkabelac @ 2010-01-08 10:50 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-01-08 10:50:12

Modified files:
	lib/metadata   : mirror.c 

Log message:
	orig_status preserves 64bit status.

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

--- LVM2/lib/metadata/mirror.c	2010/01/06 13:27:07	1.103
+++ LVM2/lib/metadata/mirror.c	2010/01/08 10:50:11	1.104
@@ -244,7 +244,7 @@
 {
 	struct str_list *sl;
 	struct lvinfo info;
-	uint32_t orig_status = log_lv->status;
+	uint64_t orig_status = log_lv->status;
 	int was_active = 0;
 
 	if (!activation() && in_sync) {


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

* LVM2/lib/metadata mirror.c
@ 2009-12-17 15:59 mornfall
  0 siblings, 0 replies; 31+ messages in thread
From: mornfall @ 2009-12-17 15:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2009-12-17 15:59:54

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Revert another unintended change that snuck in.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.100&r2=1.101

--- LVM2/lib/metadata/mirror.c	2009/12/17 15:38:29	1.100
+++ LVM2/lib/metadata/mirror.c	2009/12/17 15:59:53	1.101
@@ -784,7 +784,7 @@
 					 DEFAULT_MIRROR_LOG_FAULT_POLICY);
 	else
 		policy = find_config_str(NULL, "activation/mirror_device_fault_policy",
-					 DEFAULT_MIRROR_IMAGE_FAULT_POLICY);
+					 DEFAULT_MIRROR_DEV_FAULT_POLICY);
 
 	if (!strcmp(policy, "remove"))
 		return MIRROR_REMOVE;


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

* LVM2/lib/metadata mirror.c
@ 2009-12-09 19:43 mbroz
  0 siblings, 0 replies; 31+ messages in thread
From: mbroz @ 2009-12-09 19:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-12-09 19:43:39

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Use more descriptive variable name for temporary layer lv.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.97&r2=1.98

--- LVM2/lib/metadata/mirror.c	2009/12/09 18:09:52	1.97
+++ LVM2/lib/metadata/mirror.c	2009/12/09 19:43:39	1.98
@@ -502,7 +502,7 @@
 	uint32_t s;
 	struct logical_volume *sub_lv;
 	struct logical_volume *detached_log_lv = NULL;
-	struct logical_volume *lv1 = NULL;
+	struct logical_volume *temp_layer_lv = NULL;
 	struct lv_segment *mirrored_seg = first_seg(lv);
 	uint32_t old_area_count = mirrored_seg->area_count;
 	uint32_t new_area_count = mirrored_seg->area_count;
@@ -561,11 +561,11 @@
 	 * leave the LV as mirrored and let the lvconvert completion
 	 * to remove the layer. */
 	if (new_area_count == 1 && !is_temporary_mirror_layer(lv)) {
-		lv1 = seg_lv(mirrored_seg, 0);
-		lv1->status &= ~MIRROR_IMAGE;
-		lv_set_visible(lv1);
+		temp_layer_lv = seg_lv(mirrored_seg, 0);
+		temp_layer_lv->status &= ~MIRROR_IMAGE;
+		lv_set_visible(temp_layer_lv);
 		detached_log_lv = detach_mirror_log(mirrored_seg);
-		if (!remove_layer_from_lv(lv, lv1))
+		if (!remove_layer_from_lv(lv, temp_layer_lv))
 			return_0;
 		lv->status &= ~MIRRORED;
 		lv->status &= ~MIRROR_NOTSYNCED;
@@ -616,9 +616,9 @@
 	 * As it's now detached from mirrored_seg->lv we must resume it
 	 * explicitly.
 	 */
-	if (lv1) {
-		if (!resume_lv(lv1->vg->cmd, lv1)) {
-			log_error("Problem resuming temporary LV, %s", lv1->name);
+	if (temp_layer_lv) {
+		if (!resume_lv(temp_layer_lv->vg->cmd, temp_layer_lv)) {
+			log_error("Problem resuming temporary LV, %s", temp_layer_lv->name);
 			return 0;
 		}
 
@@ -647,7 +647,7 @@
 				return_0;
 	}
 
-	if (lv1 && !_delete_lv(lv, lv1))
+	if (temp_layer_lv && !_delete_lv(lv, temp_layer_lv))
 		return_0;
 
 	if (detached_log_lv && !_delete_lv(lv, detached_log_lv))


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

* LVM2/lib/metadata mirror.c
@ 2009-11-19 13:42 mornfall
  0 siblings, 0 replies; 31+ messages in thread
From: mornfall @ 2009-11-19 13:42 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2009-11-19 13:42:39

Modified files:
	lib/metadata   : mirror.c 

Log message:
	The double resume in remove_mirror_images does not happen *always*. Only call
	memlock_inc() when it actually does happen.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.94&r2=1.95

--- LVM2/lib/metadata/mirror.c	2009/11/19 12:09:53	1.94
+++ LVM2/lib/metadata/mirror.c	2009/11/19 13:42:38	1.95
@@ -608,21 +608,24 @@
 	 * As it's now detached from mirrored_seg->lv we must resume it
 	 * explicitly.
 	 */
-	if (lv1 && !resume_lv(lv1->vg->cmd, lv1)) {
-		log_error("Problem resuming temporary LV, %s", lv1->name);
-		return 0;
-	}
+	if (lv1) {
+		if (!resume_lv(lv1->vg->cmd, lv1)) {
+			log_error("Problem resuming temporary LV, %s", lv1->name);
+			return 0;
+		}
 
-	/*
-	 * The code above calls a suspend_lv once, however we now need to
-	 * resume 2 LVs, due to image removal: the mirror image itself above,
-	 * and now the remaining mirror LV. Since suspend_lv/resume_lv call
-	 * memlock_inc/memlock_dec and these need to be balanced, we need to
-	 * call an extra memlock_inc() here to balance for the second resume,
-	 * which could otherwise either deadlock due to suspended devices, or
-	 * alternatively drop memlock_count below 0.
-	 */
-	memlock_inc();
+		/*
+		 * The code above calls a suspend_lv once, however we now need
+		 * to resume 2 LVs, due to image removal: the mirror image
+		 * itself here, and now the remaining mirror LV. Since
+		 * suspend_lv/resume_lv call memlock_inc/memlock_dec and these
+		 * need to be balanced, we need to call an extra memlock_inc()
+		 * here to balance for the this extra resume -- the following
+		 * one could otherwise either deadlock due to suspended
+		 * devices, or alternatively drop memlock_count below 0.
+		 */
+		memlock_inc();
+	}
 
 	if (!resume_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) {
 		log_error("Problem reactivating %s", mirrored_seg->lv->name);


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

* LVM2/lib/metadata mirror.c
@ 2009-11-19 12:09 mornfall
  0 siblings, 0 replies; 31+ messages in thread
From: mornfall @ 2009-11-19 12:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2009-11-19 12:09:53

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Add a missing #include (fix compiler warning).

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

--- LVM2/lib/metadata/mirror.c	2009/11/18 18:23:46	1.93
+++ LVM2/lib/metadata/mirror.c	2009/11/19 12:09:53	1.94
@@ -24,6 +24,7 @@
 #include "lvm-string.h"
 #include "str_list.h"
 #include "locking.h"	/* FIXME Should not be used in this file */
+#include "memlock.h"
 
 #include "defaults.h" /* FIXME: should this be defaults.h? */
 


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

* LVM2/lib/metadata mirror.c
@ 2009-11-18 18:23 mornfall
  0 siblings, 0 replies; 31+ messages in thread
From: mornfall @ 2009-11-18 18:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2009-11-18 18:23:46

Modified files:
	lib/metadata   : mirror.c 

Log message:
	Add an extra memlock_inc() to _remove_mirror_images to properly balance
	reference counting (see code comment for details).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93

--- LVM2/lib/metadata/mirror.c	2009/10/14 14:55:44	1.92
+++ LVM2/lib/metadata/mirror.c	2009/11/18 18:23:46	1.93
@@ -612,6 +612,17 @@
 		return 0;
 	}
 
+	/*
+	 * The code above calls a suspend_lv once, however we now need to
+	 * resume 2 LVs, due to image removal: the mirror image itself above,
+	 * and now the remaining mirror LV. Since suspend_lv/resume_lv call
+	 * memlock_inc/memlock_dec and these need to be balanced, we need to
+	 * call an extra memlock_inc() here to balance for the second resume,
+	 * which could otherwise either deadlock due to suspended devices, or
+	 * alternatively drop memlock_count below 0.
+	 */
+	memlock_inc();
+
 	if (!resume_lv(mirrored_seg->lv->vg->cmd, mirrored_seg->lv)) {
 		log_error("Problem reactivating %s", mirrored_seg->lv->name);
 		return 0;


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

* LVM2/lib/metadata mirror.c
@ 2009-10-14 14:55 jbrassow
  0 siblings, 0 replies; 31+ messages in thread
From: jbrassow @ 2009-10-14 14:55 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2009-10-14 14:55:45

Modified files:
	lib/metadata   : mirror.c 

Log message:
	I saw this in a bug report:
	[root@xxxx-01 ~]# lvconvert -m 1 --corelog VG/cmirror
	Unable to convert the log of inactive cluster mirror cmirror
	
	I've tried to clean-up the message a little more, so the name
	of the mirror stands out more while preserving the sense that
	it's not a problem with the specific device, but the fact that
	it is inactive that is causing the problem.
	
	New msg:
	Unable to convert the log of an inactive cluster mirror, cmirror

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.91&r2=1.92

--- LVM2/lib/metadata/mirror.c	2009/10/01 01:04:27	1.91
+++ LVM2/lib/metadata/mirror.c	2009/10/14 14:55:44	1.92
@@ -1228,8 +1228,8 @@
 			return 0;
 		}
 	} else if (vg_is_clustered(vg)) {
-		log_error("Unable to convert the log of inactive "
-			  "cluster mirror %s", lv->name);
+		log_error("Unable to convert the log of an inactive "
+			  "cluster mirror, %s", lv->name);
 		return 0;
 	} else if (yes_no_prompt("Full resync required to convert "
 				 "inactive mirror %s to core log. "


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

* LVM2/lib/metadata mirror.c
@ 2009-04-23 16:43 mornfall
  0 siblings, 0 replies; 31+ messages in thread
From: mornfall @ 2009-04-23 16:43 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2009-04-23 16:43:01

Modified files:
	lib/metadata   : mirror.c 

Log message:
	A more thorough PV equality test (that also copes better with MISSING_PVs) in
	_is_mirror_image_removable.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85

--- LVM2/lib/metadata/mirror.c	2009/04/21 14:31:58	1.84
+++ LVM2/lib/metadata/mirror.c	2009/04/23 16:43:01	1.85
@@ -440,7 +440,12 @@
 
 			pv_found = 0;
 			dm_list_iterate_items(pvl, removable_pvs) {
-				if (pv->dev->dev == pvl->pv->dev->dev) {
+				if (id_equal(&pv->id, &pvl->pv->id)) {
+					pv_found = 1;
+					break;
+				}
+				if (pvl->pv->dev && pv->dev &&
+				    pv->dev->dev == pvl->pv->dev->dev) {
 					pv_found = 1;
 					break;
 				}


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

* LVM2/lib/metadata mirror.c
@ 2008-09-19  4:30 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2008-09-19  4:30 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-09-19 04:30:02

Modified files:
	lib/metadata   : mirror.c 

Log message:
	remove unsed var

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.76&r2=1.77

--- LVM2/lib/metadata/mirror.c	2008/09/19 00:20:39	1.76
+++ LVM2/lib/metadata/mirror.c	2008/09/19 04:30:02	1.77
@@ -491,7 +491,6 @@
 	struct logical_volume *detached_log_lv = NULL;
 	struct logical_volume *lv1 = NULL;
 	struct lv_segment *mirrored_seg = first_seg(lv);
-	struct lv_segment_area area;
 	uint32_t old_area_count = mirrored_seg->area_count;
 	uint32_t new_area_count = mirrored_seg->area_count;
 	struct lv_list *lvl;


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

* LVM2/lib/metadata mirror.c
@ 2008-09-19  0:20 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2008-09-19  0:20 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-09-19 00:20:39

Modified files:
	lib/metadata   : mirror.c 

Log message:
	fix last patch return code

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76

--- LVM2/lib/metadata/mirror.c	2008/09/18 19:56:50	1.75
+++ LVM2/lib/metadata/mirror.c	2008/09/19 00:20:39	1.76
@@ -179,7 +179,7 @@
 	/* Place this one at the end */
 	mirrored_seg->areas[i-1] = area;
 
-	return 0;
+	return 1;
 }
 
 /*


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

* LVM2/lib/metadata mirror.c
@ 2008-01-17 13:37 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2008-01-17 13:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-17 13:37:52

Modified files:
	lib/metadata   : mirror.c 

Log message:
	mirror log stuff

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61

--- LVM2/lib/metadata/mirror.c	2008/01/17 13:13:54	1.60
+++ LVM2/lib/metadata/mirror.c	2008/01/17 13:37:51	1.61
@@ -192,9 +192,12 @@
  */
 static int _init_mirror_log(struct cmd_context *cmd,
 			    struct logical_volume *log_lv, int in_sync,
-			    struct list *tags)
+			    struct list *tags, int remove_on_failure)
 {
 	struct str_list *sl;
+	struct lvinfo info;
+	uint32_t orig_status = log_lv->status;
+	int was_active = 0;
 
 	if (!activation() && in_sync) {
 		log_error("Aborting. Unable to create in-sync mirror log "
@@ -202,21 +205,31 @@
 		return 0;
 	}
 
+	/* If the LV is active, deactivate it first. */
+	if (lv_info(cmd, log_lv, &info, 0, 0) && info.exists) {
+		if (!deactivate_lv(cmd, log_lv))
+			return_0;
+		was_active = 1;
+	}
+
+	/* Temporary make it visible for set_lv() */
+	log_lv->status |= VISIBLE_LV;
+
 	/* Temporary tag mirror log for activation */
 	list_iterate_items(sl, tags)
 		if (!str_list_add(cmd->mem, &log_lv->tags, sl->str)) {
 			log_error("Aborting. Unable to tag mirror log.");
-			return 0;
+			goto activate_lv;
 		}
 
 	/* store mirror log on disk(s) */
 	if (!vg_write(log_lv->vg))
-		return_0;
+		goto activate_lv;
 
 	backup(log_lv->vg);
 
 	if (!vg_commit(log_lv->vg))
-		return_0;
+		goto activate_lv;
 
 	if (!activate_lv(cmd, log_lv)) {
 		log_error("Aborting. Failed to activate mirror log.");
@@ -248,6 +261,9 @@
 
 	log_lv->status &= ~VISIBLE_LV;
 
+	if (was_active && !activate_lv(cmd, log_lv))
+		return_0;
+
 	return 1;
 
 deactivate_and_revert_new_lv:
@@ -258,10 +274,27 @@
 	}
 
 revert_new_lv:
-	if (!lv_remove(log_lv) || !vg_write(log_lv->vg) ||
-	    (backup(log_lv->vg), !vg_commit(log_lv->vg)))
+	log_lv->status = orig_status;
+
+	list_iterate_items(sl, tags)
+		if (!str_list_del(&log_lv->tags, sl->str))
+			log_error("Failed to remove tag %s from mirror log.",
+				  sl->str);
+
+	if (remove_on_failure && !lv_remove(log_lv)) {
 		log_error("Manual intervention may be required to remove "
 			  "abandoned log LV before retrying.");
+		return 0;
+	}
+
+	if (!vg_write(log_lv->vg) ||
+	    (backup(log_lv->vg), !vg_commit(log_lv->vg)))
+		log_error("Manual intervention may be required to "
+			  "remove/restore abandoned log LV before retrying.");
+activate_lv:
+	if (was_active && !remove_on_failure && !activate_lv(cmd, log_lv))
+		return_0;
+
 	return 0;
 }
 
@@ -1199,7 +1232,7 @@
 		return NULL;
 	}
 
-	if (!_init_mirror_log(cmd, log_lv, in_sync, &lv->tags)) {
+	if (!_init_mirror_log(cmd, log_lv, in_sync, &lv->tags, 1)) {
 		log_error("Failed to create mirror log.");
 		return NULL;
 	}


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

* LVM2/lib/metadata mirror.c
@ 2008-01-16 19:50 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2008-01-16 19:50 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-16 19:50:23

Modified files:
	lib/metadata   : mirror.c 

Log message:
	adjust mirror log error message

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59

--- LVM2/lib/metadata/mirror.c	2008/01/16 19:38:39	1.58
+++ LVM2/lib/metadata/mirror.c	2008/01/16 19:50:23	1.59
@@ -1187,7 +1187,7 @@
 			      0, 0, log_count, 0,
 			      allocatable_pvs, alloc, parallel_areas);
 	if (!ah) {
-		log_error("Unable to allocate temporary LV for pvmove.");
+		log_error("Unable to allocate extents for mirror log.");
 		return 0;
 	}
 


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

* LVM2/lib/metadata mirror.c
@ 2008-01-16 19:38 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2008-01-16 19:38 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-16 19:38:39

Modified files:
	lib/metadata   : mirror.c 

Log message:
	cope with stacked LVs as well as PVs when deciding which bits of mirrors to remove

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58

--- LVM2/lib/metadata/mirror.c	2008/01/16 19:18:51	1.57
+++ LVM2/lib/metadata/mirror.c	2008/01/16 19:38:39	1.58
@@ -347,9 +347,12 @@
 
 	list_iterate_items(seg, &mimage_lv->segments) {
 		for (s = 0; s < seg->area_count; s++) {
-			if (seg_type(seg, s) != AREA_PV)
-				/* FIXME Recurse for AREA_LV */
-				continue;
+			if (seg_type(seg, s) != AREA_PV) {
+				/* FIXME Recurse for AREA_LV? */
+				/* Structure of seg_lv is unknown.
+				 * Not removing this LV for safety. */
+				return 0;
+			}
 
 			pv = seg_pv(seg, s);
 


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

* LVM2/lib/metadata mirror.c
@ 2008-01-16 19:11 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2008-01-16 19:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-16 19:11:39

Modified files:
	lib/metadata   : mirror.c 

Log message:
	move removable_pvs checking

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55

--- LVM2/lib/metadata/mirror.c	2008/01/16 19:09:35	1.54
+++ LVM2/lib/metadata/mirror.c	2008/01/16 19:11:39	1.55
@@ -335,6 +335,39 @@
 	remove_seg_from_segs_using_this_lv(log_lv, mirrored_seg);
 }
 
+/* Check if mirror image LV is removable with regard to given removable_pvs */
+static int _is_mirror_image_removable(struct logical_volume *mimage_lv,
+				      struct list *removable_pvs)
+{
+	struct physical_volume *pv;
+	struct lv_segment *seg;
+	int pv_found;
+	struct pv_list *pvl;
+	uint32_t s;
+
+	list_iterate_items(seg, &mimage_lv->segments) {
+		for (s = 0; s < seg->area_count; s++) {
+			if (seg_type(seg, s) != AREA_PV)
+				/* FIXME Recurse for AREA_LV */
+				continue;
+
+			pv = seg_pv(seg, s);
+
+			pv_found = 0;
+			list_iterate_items(pvl, removable_pvs) {
+				if (pv->dev->dev == pvl->pv->dev->dev) {
+					pv_found = 1;
+					break;
+				}
+			}
+			if (!pv_found)
+				return 0;
+		}
+	}
+
+	return 1;
+}
+
 /*
  * Remove num_removed images from mirrored_seg
  */
@@ -344,15 +377,12 @@
 				 unsigned remove_log, unsigned collapse)
 {
 	uint32_t m;
-	uint32_t s, s1;
+	uint32_t s;
 	struct logical_volume *sub_lv;
 	struct logical_volume *log_lv = NULL;
 	struct logical_volume *lv1 = NULL;
-	struct physical_volume *pv;
-	struct lv_segment *seg, *mirrored_seg = first_seg(lv);
+	struct lv_segment *mirrored_seg = first_seg(lv);
 	struct lv_segment_area area;
-	int all_pvs_removable, pv_found;
-	struct pv_list *pvl;
 	uint32_t old_area_count = mirrored_seg->area_count;
 	uint32_t new_area_count = mirrored_seg->area_count;
 	struct lv_list *lvl;
@@ -373,32 +403,8 @@
 	if (removable_pvs) {
 		for (s = 0; s < mirrored_seg->area_count &&
 			    old_area_count - new_area_count < num_removed; s++) {
-			all_pvs_removable = 1;
 			sub_lv = seg_lv(mirrored_seg, s);
-			list_iterate_items(seg, &sub_lv->segments) {
-				for (s1 = 0; s1 < seg->area_count; s1++) {
-					if (seg_type(seg, s1) != AREA_PV)
-						/* FIXME Recurse for AREA_LV */
-						continue;
-
-					pv = seg_pv(seg, s1);
-
-					pv_found = 0;
-					list_iterate_items(pvl, removable_pvs) {
-						if (pv->dev->dev == pvl->pv->dev->dev) {
-							pv_found = 1;
-							break;
-						}
-					}
-					if (!pv_found) {
-						all_pvs_removable = 0;
-						break;
-					}
-				}
-				if (!all_pvs_removable)
-					break;
-			}
-			if (all_pvs_removable) {
+			if (_is_mirror_image_removable(sub_lv, removable_pvs)) {
 				/* Swap segment to end */
 				new_area_count--;
 				area = mirrored_seg->areas[new_area_count];


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

* LVM2/lib/metadata mirror.c
@ 2008-01-16 19:09 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2008-01-16 19:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-16 19:09:35

Modified files:
	lib/metadata   : mirror.c 

Log message:
	reorder funcs

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54

--- LVM2/lib/metadata/mirror.c	2008/01/16 19:00:59	1.53
+++ LVM2/lib/metadata/mirror.c	2008/01/16 19:09:35	1.54
@@ -51,6 +51,27 @@
 }
 
 /*
+ * Return a temporary LV for resyncing added mirror image.
+ * Add other mirror legs to lvs list.
+ */
+static struct logical_volume *_find_tmp_mirror(struct logical_volume *lv)
+{
+	struct lv_segment *seg;
+
+	if (!(lv->status & MIRRORED))
+		return NULL;
+
+	seg = first_seg(lv);
+
+	/* Temporary mirror is always area_num == 0 */
+	if (seg_type(seg, 0) == AREA_LV &&
+	    is_temporary_mirror_layer(seg_lv(seg, 0)))
+		return seg_lv(seg, 0);
+
+	return NULL;
+}
+
+/*
  * Returns the number of mirrors of the LV
  */
 uint32_t lv_mirror_count(const struct logical_volume *lv)
@@ -115,6 +136,136 @@
 }
 
 /*
+ * This function writes a new header to the mirror log header to the lv
+ *
+ * Returns: 1 on success, 0 on failure
+ */
+static int _write_log_header(struct cmd_context *cmd, struct logical_volume *lv)
+{
+	struct device *dev;
+	char *name;
+	struct { /* The mirror log header */
+		uint32_t magic;
+		uint32_t version;
+		uint64_t nr_regions;
+	} log_header;
+
+	log_header.magic = xlate32(MIRROR_MAGIC);
+	log_header.version = xlate32(MIRROR_DISK_VERSION);
+	log_header.nr_regions = xlate64((uint64_t)-1);
+
+	if (!(name = dm_pool_alloc(cmd->mem, PATH_MAX))) {
+		log_error("Name allocation failed - log header not written (%s)",
+			lv->name);
+		return 0;
+	}
+
+	if (dm_snprintf(name, PATH_MAX, "%s%s/%s", cmd->dev_dir,
+			 lv->vg->name, lv->name) < 0) {
+		log_error("Name too long - log header not written (%s)", lv->name);
+		return 0;
+	}
+
+	log_verbose("Writing log header to device, %s", lv->name);
+
+	if (!(dev = dev_cache_get(name, NULL))) {
+		log_error("%s: not found: log header not written", name);
+		return 0;
+	}
+
+	if (!dev_open_quiet(dev))
+		return 0;
+
+	if (!dev_write(dev, UINT64_C(0), sizeof(log_header), &log_header)) {
+		log_error("Failed to write log header to %s", name);
+		dev_close_immediate(dev);
+		return 0;
+	}
+
+	dev_close_immediate(dev);
+
+	return 1;
+}
+
+/*
+ * Initialize mirror log contents
+ */
+static int _init_mirror_log(struct cmd_context *cmd,
+			    struct logical_volume *log_lv, int in_sync,
+			    struct list *tags)
+{
+	struct str_list *sl;
+
+	if (!activation() && in_sync) {
+		log_error("Aborting. Unable to create in-sync mirror log "
+			  "while activation is disabled.");
+		return 0;
+	}
+
+	/* Temporary tag mirror log for activation */
+	list_iterate_items(sl, tags)
+		if (!str_list_add(cmd->mem, &log_lv->tags, sl->str)) {
+			log_error("Aborting. Unable to tag mirror log.");
+			return 0;
+		}
+
+	/* store mirror log on disk(s) */
+	if (!vg_write(log_lv->vg))
+		return_0;
+
+	backup(log_lv->vg);
+
+	if (!vg_commit(log_lv->vg))
+		return_0;
+
+	if (!activate_lv(cmd, log_lv)) {
+		log_error("Aborting. Failed to activate mirror log.");
+		goto revert_new_lv;
+	}
+
+	/* Remove the temporary tags */
+	list_iterate_items(sl, tags)
+		if (!str_list_del(&log_lv->tags, sl->str))
+			log_error("Failed to remove tag %s from mirror log.",
+				  sl->str);
+
+	if (activation() && !set_lv(cmd, log_lv, log_lv->size,
+				    in_sync ? -1 : 0)) {
+		log_error("Aborting. Failed to wipe mirror log.");
+		goto deactivate_and_revert_new_lv;
+	}
+
+	if (activation() && !_write_log_header(cmd, log_lv)) {
+		log_error("Aborting. Failed to write mirror log header.");
+		goto deactivate_and_revert_new_lv;
+	}
+
+	if (!deactivate_lv(cmd, log_lv)) {
+		log_error("Aborting. Failed to deactivate mirror log. "
+			  "Manual intervention required.");
+		return 0;
+	}
+
+	log_lv->status &= ~VISIBLE_LV;
+
+	return 1;
+
+deactivate_and_revert_new_lv:
+	if (!deactivate_lv(cmd, log_lv)) {
+		log_error("Unable to deactivate mirror log LV. "
+			  "Manual intervention required.");
+		return 0;
+	}
+
+revert_new_lv:
+	if (!lv_remove(log_lv) || !vg_write(log_lv->vg) ||
+	    (backup(log_lv->vg), !vg_commit(log_lv->vg)))
+		log_error("Manual intervention may be required to remove "
+			  "abandoned log LV before retrying.");
+	return 0;
+}
+
+/*
  * Delete independent/orphan LV, it must acquire lock.
  */
 static int _delete_lv(struct logical_volume *mirror_lv, struct logical_volume *lv)
@@ -390,27 +541,6 @@
 }
 
 /*
- * Return a temporary LV for resyncing added mirror image.
- * Add other mirror legs to lvs list.
- */
-static struct logical_volume *_find_tmp_mirror(struct logical_volume *lv)
-{
-	struct lv_segment *seg;
-
-	if (!(lv->status & MIRRORED))
-		return NULL;
-
-	seg = first_seg(lv);
-
-	/* Temporary mirror is always area_num == 0 */
-	if (seg_type(seg, 0) == AREA_LV &&
-	    is_temporary_mirror_layer(seg_lv(seg, 0)))
-		return seg_lv(seg, 0);
-
-	return NULL;
-}
-
-/*
  * Collapsing temporary mirror layers.
  *
  * When mirrors are added to already-mirrored LV, a temporary mirror layer
@@ -926,136 +1056,6 @@
 	return 1;
 }
 
-/*
- * This function writes a new header to the mirror log header to the lv
- *
- * Returns: 1 on success, 0 on failure
- */
-static int _write_log_header(struct cmd_context *cmd, struct logical_volume *lv)
-{
-	struct device *dev;
-	char *name;
-	struct { /* The mirror log header */
-		uint32_t magic;
-		uint32_t version;
-		uint64_t nr_regions;
-	} log_header;
-
-	log_header.magic = xlate32(MIRROR_MAGIC);
-	log_header.version = xlate32(MIRROR_DISK_VERSION);
-	log_header.nr_regions = xlate64((uint64_t)-1);
-
-	if (!(name = dm_pool_alloc(cmd->mem, PATH_MAX))) {
-		log_error("Name allocation failed - log header not written (%s)",
-			lv->name);
-		return 0;
-	}
-
-	if (dm_snprintf(name, PATH_MAX, "%s%s/%s", cmd->dev_dir,
-			 lv->vg->name, lv->name) < 0) {
-		log_error("Name too long - log header not written (%s)", lv->name);
-		return 0;
-	}
-
-	log_verbose("Writing log header to device, %s", lv->name);
-
-	if (!(dev = dev_cache_get(name, NULL))) {
-		log_error("%s: not found: log header not written", name);
-		return 0;
-	}
-
-	if (!dev_open_quiet(dev))
-		return 0;
-
-	if (!dev_write(dev, UINT64_C(0), sizeof(log_header), &log_header)) {
-		log_error("Failed to write log header to %s", name);
-		dev_close_immediate(dev);
-		return 0;
-	}
-
-	dev_close_immediate(dev);
-
-	return 1;
-}
-
-/*
- * Initialize mirror log contents
- */
-static int _init_mirror_log(struct cmd_context *cmd,
-			    struct logical_volume *log_lv, int in_sync,
-			    struct list *tags)
-{
-	struct str_list *sl;
-
-	if (!activation() && in_sync) {
-		log_error("Aborting. Unable to create in-sync mirror log "
-			  "while activation is disabled.");
-		return 0;
-	}
-
-	/* Temporary tag mirror log for activation */
-	list_iterate_items(sl, tags)
-		if (!str_list_add(cmd->mem, &log_lv->tags, sl->str)) {
-			log_error("Aborting. Unable to tag mirror log.");
-			return 0;
-		}
-
-	/* store mirror log on disk(s) */
-	if (!vg_write(log_lv->vg))
-		return_0;
-
-	backup(log_lv->vg);
-
-	if (!vg_commit(log_lv->vg))
-		return_0;
-
-	if (!activate_lv(cmd, log_lv)) {
-		log_error("Aborting. Failed to activate mirror log.");
-		goto revert_new_lv;
-	}
-
-	/* Remove the temporary tags */
-	list_iterate_items(sl, tags)
-		if (!str_list_del(&log_lv->tags, sl->str))
-			log_error("Failed to remove tag %s from mirror log.",
-				  sl->str);
-
-	if (activation() && !set_lv(cmd, log_lv, log_lv->size,
-				    in_sync ? -1 : 0)) {
-		log_error("Aborting. Failed to wipe mirror log.");
-		goto deactivate_and_revert_new_lv;
-	}
-
-	if (activation() && !_write_log_header(cmd, log_lv)) {
-		log_error("Aborting. Failed to write mirror log header.");
-		goto deactivate_and_revert_new_lv;
-	}
-
-	if (!deactivate_lv(cmd, log_lv)) {
-		log_error("Aborting. Failed to deactivate mirror log. "
-			  "Manual intervention required.");
-		return 0;
-	}
-
-	log_lv->status &= ~VISIBLE_LV;
-
-	return 1;
-
-deactivate_and_revert_new_lv:
-	if (!deactivate_lv(cmd, log_lv)) {
-		log_error("Unable to deactivate mirror log LV. "
-			  "Manual intervention required.");
-		return 0;
-	}
-
-revert_new_lv:
-	if (!lv_remove(log_lv) || !vg_write(log_lv->vg) ||
-	    (backup(log_lv->vg), !vg_commit(log_lv->vg)))
-		log_error("Manual intervention may be required to remove "
-			  "abandoned log LV before retrying.");
-	return 0;
-}
-
 static struct logical_volume *_create_mirror_log(struct logical_volume *lv,
 						 struct alloc_handle *ah,
 						 alloc_policy_t alloc,


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

* LVM2/lib/metadata mirror.c
@ 2006-11-10 20:15 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2006-11-10 20:15 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

Modified files:
	lib/metadata   : mirror.c 

Log message:
	fix cast

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36

--- LVM2/lib/metadata/mirror.c	2006/11/10 19:35:03	1.35
+++ LVM2/lib/metadata/mirror.c	2006/11/10 20:15:10	1.36
@@ -44,7 +44,7 @@
 {
 	uint64_t region_max;
 
-	region_max = (1 << (ffs((int)extents) - 1)) * extent_size;
+	region_max = (1 << (ffs((int)extents) - 1)) * (uint64_t) extent_size;
 
 	if (region_max < UINT32_MAX && region_size > region_max) {
 		region_size = (uint32_t) region_max;


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

* LVM2/lib/metadata mirror.c
@ 2004-05-05 18:35 agk
  0 siblings, 0 replies; 31+ messages in thread
From: agk @ 2004-05-05 18:35 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-05-05 18:35:05

Modified files:
	lib/metadata   : mirror.c 

Log message:
	comments

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6


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

end of thread, other threads:[~2012-02-01 15:05 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12 14:13 LVM2/lib/metadata mirror.c zkabelac
  -- strict thread matches above, loose matches on Subject: below --
2012-02-01 15:05 agk
2011-09-19 14:28 jbrassow
2011-09-16 16:41 jbrassow
2011-09-14  9:54 zkabelac
2011-09-14  4:10 jbrassow
2011-09-13 18:11 jbrassow
2011-06-24 23:39 agk
2011-03-24 12:28 mornfall
2011-01-11 17:21 jbrassow
2010-07-09 17:57 jbrassow
2010-06-23 13:57 jbrassow
2010-04-20 12:14 agk
2010-04-01 14:54 agk
2010-01-08 10:50 zkabelac
2009-12-17 15:59 mornfall
2009-12-09 19:43 mbroz
2009-11-19 13:42 mornfall
2009-11-19 12:09 mornfall
2009-11-18 18:23 mornfall
2009-10-14 14:55 jbrassow
2009-04-23 16:43 mornfall
2008-09-19  4:30 agk
2008-09-19  0:20 agk
2008-01-17 13:37 agk
2008-01-16 19:50 agk
2008-01-16 19:38 agk
2008-01-16 19:11 agk
2008-01-16 19:09 agk
2006-11-10 20:15 agk
2004-05-05 18:35 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).