public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2005-06-14 17:54 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2005-06-14 17:54 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-06-14 17:54:48

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/device     : dev-cache.c 
	lib/display    : display.c 
	lib/format1    : import-export.c 
	lib/format_text: export.c import_vsn1.c 
	lib/metadata   : lv_alloc.h lv_manip.c merge.c metadata.c 
	                 metadata.h mirror.c pv_manip.c 
	lib/report     : report.c 
	lib/striped    : striped.c 
	tools          : pvmove.c 

Log message:
	Various allocation-related pvmove fixes.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.259&r2=1.260
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.77&r2=1.78
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_alloc.h.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25


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

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-05 15:05:25

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/metadata   : lv_manip.c pv_manip.c 
	tools          : lvresize.c 

Log message:
	Some more missing supposedly 64bit operations.
	
	Avoid use 32bit math for extent_size.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2344&r2=1.2345
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.274&r2=1.275
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.371&r2=1.372
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.150&r2=1.151

--- LVM2/WHATS_NEW	2012/03/05 14:19:13	1.2344
+++ LVM2/WHATS_NEW	2012/03/05 15:05:24	1.2345
@@ -2,7 +2,7 @@
 ================================
   Try to fit thin pool metadata size into 128MB.
   Print just warning on thin pool check callback path for failing check.
-  Use 64bit math for verification of thin pool and snapshot chunk size.
+  Always use 64bit math with VG extent_size expression.
   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/activate/dev_manager.c	2012/03/05 14:15:50	1.274
+++ LVM2/lib/activate/dev_manager.c	2012/03/05 15:05:25	1.275
@@ -1412,7 +1412,7 @@
 	struct dm_tree_node *node;
 	struct lv_segment *seg_i;
 	int segno = -1, i = 0;
-	uint64_t size = seg->len * seg->lv->vg->extent_size;
+	uint64_t size = (uint64_t) seg->len * seg->lv->vg->extent_size;
 
 	dm_list_iterate_items(seg_i, &seg->lv->segments) {
 		if (seg == seg_i)
--- LVM2/lib/metadata/lv_manip.c	2012/03/05 14:12:57	1.371
+++ LVM2/lib/metadata/lv_manip.c	2012/03/05 15:05:25	1.372
@@ -3768,7 +3768,7 @@
 	/* add the new segment to the layer LV */
 	dm_list_add(&lv_where->segments, &mapseg->list);
 	lv_where->le_count = layer_lv->le_count;
-	lv_where->size = lv_where->le_count * lv_where->vg->extent_size;
+	lv_where->size = (uint64_t) lv_where->le_count * lv_where->vg->extent_size;
 
 	return layer_lv;
 }
@@ -3810,7 +3810,7 @@
 	/* add the new segment to the layer LV */
 	dm_list_add(&layer_lv->segments, &mapseg->list);
 	layer_lv->le_count += seg->area_len;
-	layer_lv->size += seg->area_len * layer_lv->vg->extent_size;
+	layer_lv->size += (uint64_t) seg->area_len * layer_lv->vg->extent_size;
 
 	/* map the original area to the new segment */
 	if (!set_lv_segment_area_lv(seg, s, layer_lv, mapseg->le, 0))
--- LVM2/lib/metadata/pv_manip.c	2012/03/01 21:49:32	1.32
+++ LVM2/lib/metadata/pv_manip.c	2012/03/05 15:05:25	1.33
@@ -210,7 +210,7 @@
 	    dev_discard_max_bytes(peg->pv->fmt->cmd->sysfs_dir, peg->pv->dev) &&
 	    dev_discard_granularity(peg->pv->fmt->cmd->sysfs_dir, peg->pv->dev)) {
 		discard_offset_sectors = (peg->pe + peg->lvseg->area_len - area_reduction) *
-			peg->pv->vg->extent_size + pe_start;
+			(uint64_t) peg->pv->vg->extent_size + pe_start;
 		if (!discard_offset_sectors) {
 			/*
 			 * pe_start=0 and the PV's first extent contains the label.
@@ -223,7 +223,7 @@
 			  discard_area_reduction, discard_offset_sectors, dev_name(peg->pv->dev));
 		if (discard_area_reduction &&
 		    !dev_discard_blocks(peg->pv->dev, discard_offset_sectors << SECTOR_SHIFT,
-					discard_area_reduction * peg->pv->vg->extent_size * SECTOR_SIZE))
+					discard_area_reduction * (uint64_t) peg->pv->vg->extent_size * SECTOR_SIZE))
 			return_0;
 	}
 
--- LVM2/tools/lvresize.c	2012/02/28 14:24:58	1.150
+++ LVM2/tools/lvresize.c	2012/03/05 15:05:25	1.151
@@ -63,7 +63,7 @@
 
 	if (!(vg->fid->fmt->features & FMT_SEGMENTS))
 		log_warn("Varied stripesize not supported. Ignoring.");
-	else if (arg_uint_value(cmd, stripesize_ARG, 0) > vg->extent_size * 2) {
+	else if (arg_uint_value(cmd, stripesize_ARG, 0) > (uint64_t) vg->extent_size * 2) {
 		log_error("Reducing stripe size %s to maximum, "
 			  "physical extent size %s",
 			  display_size(cmd,
@@ -463,7 +463,7 @@
 				    (lp->size % vg->extent_size);
 
 			log_print("Rounding up size to full physical extent %s",
-				  display_size(cmd, (uint64_t) lp->size));
+				  display_size(cmd, lp->size));
 		}
 
 		lp->extents = lp->size / vg->extent_size;


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

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

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/misc       : lvm-percent.h 
	lib/report     : report.c 
	lib/snapshot   : snapshot.c 
	liblvm         : lvm2app.h 
	tools          : lvconvert.c 

Log message:
	Differentiate between snapshot status of "Invalid" and "Merge failed".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2229&r2=1.2230
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.262&r2=1.263
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-percent.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.148&r2=1.149
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.58&r2=1.59
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/liblvm/lvm2app.h.diff?cvsroot=lvm2&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.177&r2=1.178

--- LVM2/WHATS_NEW	2012/01/20 21:56:01	1.2229
+++ LVM2/WHATS_NEW	2012/01/20 22:02:04	1.2230
@@ -1,6 +1,7 @@
 Version 2.02.89 - 
 ==================================
-  Lookup snapshot usage percent of origin when a snapshot is merging.
+  Differentiate between snapshot status of "Invalid" and "Merge failed".
+  Lookup snapshot usage percent of origin volume when a snapshot is merging.
   Update lvdisplay with backward compat. config opt. lvm1_compatible_display.
   Do not report linear segtype for non-striped targets.
   Keep info about creation host and time for each logical volume.
--- LVM2/lib/activate/dev_manager.c	2012/01/20 21:56:01	1.262
+++ LVM2/lib/activate/dev_manager.c	2012/01/20 22:02:04	1.263
@@ -482,6 +482,9 @@
 static percent_range_t _combine_percent(percent_t a, percent_t b,
                                         uint32_t numerator, uint32_t denominator)
 {
+	if (a == PERCENT_MERGE_FAILED || b == PERCENT_MERGE_FAILED)
+		return PERCENT_MERGE_FAILED;
+
 	if (a == PERCENT_INVALID || b == PERCENT_INVALID)
 		return PERCENT_INVALID;
 
--- LVM2/lib/misc/lvm-percent.h	2010/11/30 11:53:32	1.1
+++ LVM2/lib/misc/lvm-percent.h	2012/01/20 22:02:04	1.2
@@ -34,7 +34,8 @@
 	PERCENT_0 = 0,
 	PERCENT_1 = 1000000,
 	PERCENT_100 = 100 * PERCENT_1,
-	PERCENT_INVALID = -1
+	PERCENT_INVALID = -1,
+	PERCENT_MERGE_FAILED = -2
 } percent_range_t;
 
 float percent_to_float(percent_t v);
--- LVM2/lib/report/report.c	2012/01/19 15:34:33	1.148
+++ LVM2/lib/report/report.c	2012/01/20 22:02:04	1.149
@@ -836,7 +836,7 @@
 	}
 
 	if (!lv_snapshot_percent(lv, &snap_percent) ||
-				 (snap_percent == PERCENT_INVALID)) {
+	    (snap_percent == PERCENT_INVALID) || (snap_percent == PERCENT_MERGE_FAILED)) {
 		if (!lv_is_merging_origin(lv)) {
 			*sortval = UINT64_C(100);
 			dm_report_field_set_value(field, "100.00", sortval);
--- LVM2/lib/snapshot/snapshot.c	2011/08/30 14:55:18	1.58
+++ LVM2/lib/snapshot/snapshot.c	2012/01/20 22:02:04	1.59
@@ -136,9 +136,11 @@
 			*percent = PERCENT_100;
 		else
 			*percent = make_percent(*total_numerator, *total_denominator);
-	} else if (!strcmp(params, "Invalid") ||
-		   !strcmp(params, "Merge failed"))
+	}
+	else if (!strcmp(params, "Invalid"))
 		*percent = PERCENT_INVALID;
+	else if (!strcmp(params, "Merge failed"))
+		*percent = PERCENT_MERGE_FAILED;
 	else
 		return 0;
 
--- LVM2/liblvm/lvm2app.h	2010/12/14 23:20:58	1.31
+++ LVM2/liblvm/lvm2app.h	2012/01/20 22:02:04	1.32
@@ -1591,7 +1591,8 @@
 	PERCENT_0 = 0,
 	PERCENT_1 = 1000000,
 	PERCENT_100 = 100 * PERCENT_1,
-	PERCENT_INVALID = -1
+	PERCENT_INVALID = -1,
+	PERCENT_MERGE_FAILED = -2
 } percent_range_t;
 
 typedef int32_t percent_t;
--- LVM2/tools/lvconvert.c	2011/12/08 18:00:03	1.177
+++ LVM2/tools/lvconvert.c	2012/01/20 22:02:05	1.178
@@ -461,6 +461,9 @@
 	} else if (percent == PERCENT_INVALID) {
 		log_error("%s: Merging snapshot invalidated. Aborting merge.", lv->name);
 		return PROGRESS_CHECK_FAILED;
+	} else if (percent == PERCENT_MERGE_FAILED) {
+		log_error("%s: Merge failed. Retry merge or inspect manually.", lv->name);
+		return PROGRESS_CHECK_FAILED;
 	}
 
 	if (parms->progress_display)


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2011-10-14 13:23 zkabelac
  0 siblings, 0 replies; 25+ messages in thread
From: zkabelac @ 2011-10-14 13:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-14 13:23:48

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c fs.c fs.h 

Log message:
	Fix lv_info open_count test
	
	When verify_udev_operations was disable, code for stacking fs operation for
	lvm links was completely disable - but this code was also used for collecting
	information, that a new node is being created.
	
	Add a new flag which is set when a creation of lv symlinks is requested which
	should restore old behaviour of lv_info function, that has called fs_sync()
	before quere for open count on device.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2160&r2=1.2161
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.244&r2=1.245
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.h.diff?cvsroot=lvm2&r1=1.17&r2=1.18

--- LVM2/WHATS_NEW	2011/10/11 09:54:39	1.2160
+++ LVM2/WHATS_NEW	2011/10/14 13:23:47	1.2161
@@ -1,6 +1,7 @@
 Version 2.02.89 - 
 ==================================
-  Simplify code for lvm worker thread in clvmd.
+  Fix lv_info open_count test for disabled verify_udev_operations (2.02.86).
+  Simplify code for lvm worker thread in clvmd.                     
   Use pthread_barrier to synchronize clvmd threads at startup.
   Limit clvmd's thread size to 128KiB.
   Reduce default preallocated stack size to 64KiB.
--- LVM2/lib/activate/dev_manager.c	2011/10/11 10:02:28	1.244
+++ LVM2/lib/activate/dev_manager.c	2011/10/14 13:23:47	1.245
@@ -1746,8 +1746,10 @@
 	int r = 1;
 
 	/* Nothing to do if udev fallback is disabled. */
-	if (!dm->cmd->current_settings.udev_fallback)
+	if (!dm->cmd->current_settings.udev_fallback) {
+		fs_set_create();
 		return 1;
+	}
 
 	while ((child = dm_tree_next_child(&handle, root, 0))) {
 		if (!(lvlayer = dm_tree_node_get_context(child)))
--- LVM2/lib/activate/fs.c	2011/04/08 14:40:19	1.62
+++ LVM2/lib/activate/fs.c	2011/10/14 13:23:48	1.63
@@ -32,6 +32,7 @@
  * Supports to wait for udev device settle only when needed.
  */
 static uint32_t _fs_cookie = DM_COOKIE_AUTO_CREATE;
+static int _fs_create = 0;
 
 static int _mk_dir(const char *dev_dir, const char *vg_name)
 {
@@ -427,6 +428,8 @@
 			  fsp->dev, fsp->old_lv_name, fsp->check_udev);
 		_del_fs_op(fsp);
 	}
+
+	_fs_create = 0;
 }
 
 static int _fs_op(fs_op_t type, const char *dev_dir, const char *vg_name,
@@ -500,7 +503,12 @@
 	_fs_cookie = cookie;
 }
 
+void fs_set_create(void)
+{
+	_fs_create = 1;
+}
+
 int fs_has_non_delete_ops(void)
 {
-	return _other_fs_ops(FS_DEL);
+	return _fs_create || _other_fs_ops(FS_DEL);
 }
--- LVM2/lib/activate/fs.h	2011/02/03 01:16:35	1.17
+++ LVM2/lib/activate/fs.h	2011/10/14 13:23:48	1.18
@@ -32,6 +32,7 @@
 /* void fs_unlock(void);  moved to activate.h */
 uint32_t fs_get_cookie(void);
 void fs_set_cookie(uint32_t cookie);
+void fs_set_create(void);
 int fs_has_non_delete_ops(void);
 
 #endif


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2011-10-06 14:45 jbrassow
  0 siblings, 0 replies; 25+ messages in thread
From: jbrassow @ 2011-10-06 14:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-10-06 14:45:42

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	libdm          : libdevmapper.h libdm-deptree.c 

Log message:
	This patch fixes issues with improper udev flags on sub-LVs.
	
	The current code does not always assign proper udev flags to sub-LVs (e.g.
	mirror images and log LVs).  This shows up especially during a splitmirror
	operation in which an image is split off from a mirror to form a new LV.
	
	A mirror with a disk log is actually composed of 4 different LVs: the 2
	mirror images, the log, and the top-level LV that "glues" them all together.
	When a 2-way mirror is split into two linear LVs, two of those LVs must be
	removed.  The segments of the image which is not split off to form the new
	LV are transferred to the top-level LV.  This is done so that the original
	LV can maintain its major/minor, UUID, and name.  The sub-lv from which the
	segments were transferred gets an error segment as a transitory process
	before it is eventually removed.  (Note that if the error target was not put
	in place, a resume_lv would result in two LVs pointing to the same segment!
	If the machine crashes before the eventual removal of the sub-LV, the result
	would be a residual LV with the same mapping as the original (now linear) LV.)
	So, the two LVs that need to be removed are now the log device and the sub-LV
	with the error segment.  If udev_flags are not properly set, a resume will
	cause the error LV to come up and be scanned by udev.  This causes I/O errors.
	Additionally, when udev scans sub-LVs (or former sub-LVs), it can cause races
	when we are trying to remove those LVs.  This is especially bad during failure
	conditions.
	
	When the mirror is suspended, the top-level along with its sub-LVs are
	suspended.  The changes (now 2 linear devices and the yet-to-be-removed log
	and error LV) are committed.  When the resume takes place on the original
	LV, there are no longer links to the other sub-lvs through the LVM metadata.
	The links are implicitly handled by querying the kernel for a list of
	dependencies.  This is done in the '_add_dev' function (which is recursively
	called for each dependency found) - called through the following chain:
	_add_dev
	dm_tree_add_dev_with_udev_flags
	<*** DM / LVM divide ***>
	_add_dev_to_dtree
	_add_lv_to_dtree
	_create_partial_dtree
	_tree_action
	dev_manager_activate
	_lv_activate_lv
	_lv_resume
	lv_resume_if_active
	When udev flags are calculated by '_get_udev_flags', it is done by referencing
	the 'logical_volume' structure.  Those flags are then passed down into
	'dm_tree_add_dev_with_udev_flags', which in turn passes them to '_add_dev'.
	Unfortunately, when '_add_dev' is finding the dependencies, it has no way to
	calculate their proper udev_flags.  This is because it is below the DM/LVM
	divide - it doesn't have access to the logical_volume structure.  In fact,
	'_add_dev' simply reuses the udev_flags given for the initial device!  This
	virtually guarentees the udev_flags are wrong for all the dependencies unless
	they are reset by some other mechanism.  The current code provides no such
	mechanism.  Even if '_add_new_lv_to_dtree' were called on the sub-devices -
	which it isn't - entries already in the tree are simply passed over, failing
	to reset any udev_flags.  The solution must retain its implicit nature of
	discovering dependencies and be able to go back over the dependencies found
	to properly set the udev_flags.
	
	My solution simply calls a new function before leaving '_add_new_lv_to_dtree'
	that iterates over the dtree nodes to properly reset the udev_flags of any
	children.  It is important that this function occur after the '_add_dev' has
	done its job of querying the kernel for a list of dependencies.  It is this
	list of children that we use to look up their respective LVs and properly
	calculate the udev_flags.
	
	This solution has worked for single machine, cluster, and cluster w/ exclusive
	activation.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2146&r2=1.2147
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.236&r2=1.237
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.158&r2=1.159
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.121&r2=1.122

--- LVM2/WHATS_NEW	2011/10/06 14:17:45	1.2146
+++ LVM2/WHATS_NEW	2011/10/06 14:45:40	1.2147
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix improper udev settings during suspend/resume for mirror sub-LVs.
   Fix vgsplit when there are mirrors that have mirrored logs.
   Clarify multi-name device filter pattern matching explanation in lvm.conf.5.
   Introduce lv_send_message and dev_manager_send_message.
--- LVM2/lib/activate/dev_manager.c	2011/10/03 18:37:47	1.236
+++ LVM2/lib/activate/dev_manager.c	2011/10/06 14:45:41	1.237
@@ -1568,6 +1568,57 @@
 	return 1;
 }
 
+static int _set_udev_flags_for_children(struct dev_manager *dm,
+					struct volume_group *vg,
+					struct dm_tree_node *dnode)
+{
+	char *p;
+	const char *uuid;
+	void *handle = NULL;
+	struct dm_tree_node *child;
+	const struct dm_info *info;
+	struct lv_list *lvl;
+
+	while ((child = dm_tree_next_child(&handle, dnode, 0))) {
+		/* Ignore root node */
+		if (!(info  = dm_tree_node_get_info(child)) || !info->exists)
+			continue;
+
+		if (!(uuid = dm_tree_node_get_uuid(child))) {
+			log_error(INTERNAL_ERROR
+				  "Failed to get uuid for %" PRIu32 ":%" PRIu32,
+				  info->major, info->minor);
+			continue;
+		}
+
+		/* Ignore non-LVM devices */
+		if (!(p = strstr(uuid, UUID_PREFIX)))
+			continue;
+		p += strlen(UUID_PREFIX);
+
+		/* Ignore LVs that belong to different VGs (due to stacking) */
+		if (strncmp(p, (char *)vg->id.uuid, ID_LEN))
+			continue;
+
+		/* Ignore LVM devices with 'layer' suffixes */
+		if (strrchr(p, '-'))
+			continue;
+
+		if (!(lvl = find_lv_in_vg_by_lvid(vg, (const union lvid *)p))) {
+			log_error(INTERNAL_ERROR
+				  "%s (%" PRIu32 ":%" PRIu32 ") not found in VG",
+				  dm_tree_node_get_name(child),
+				  info->major, info->minor);
+			return 0;
+		}
+
+		dm_tree_node_set_udev_flags(child,
+					    _get_udev_flags(dm, lvl->lv, NULL));
+	}
+
+	return 1;
+}
+
 static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
 				struct logical_volume *lv, struct lv_activate_opts *laopts,
 				const char *layer)
@@ -1672,6 +1723,9 @@
 			if (!_add_new_lv_to_dtree(dm, dtree, sl->seg->lv, laopts, NULL))
 				return_0;
 
+	if (!_set_udev_flags_for_children(dm, lv->vg, dnode))
+		return_0;
+
 	return 1;
 }
 
--- LVM2/libdm/libdevmapper.h	2011/10/06 11:05:56	1.158
+++ LVM2/libdm/libdevmapper.h	2011/10/06 14:45:42	1.159
@@ -560,6 +560,8 @@
 				 const char *thin_pool_uuid,
 				 uint32_t device_id);
 
+void dm_tree_node_set_udev_flags(struct dm_tree_node *node, uint16_t udev_flags);
+
 void dm_tree_node_set_presuspend_node(struct dm_tree_node *node,
 				      struct dm_tree_node *presuspend_node);
 
--- LVM2/libdm/libdm-deptree.c	2011/10/06 11:05:56	1.121
+++ LVM2/libdm/libdm-deptree.c	2011/10/06 14:45:42	1.122
@@ -741,6 +741,18 @@
 	return node;
 }
 
+void dm_tree_node_set_udev_flags(struct dm_tree_node *dnode, uint16_t udev_flags)
+
+{
+	struct dm_info *dinfo = &dnode->info;
+
+	if (udev_flags != dnode->udev_flags)
+		log_debug("Resetting %s (%" PRIu32 ":%" PRIu32
+			  ") udev_flags from 0x%x to 0x%x",
+			  dnode->name, dinfo->major, dinfo->minor,
+			  dnode->udev_flags, udev_flags);
+	dnode->udev_flags = udev_flags;
+}
 
 void dm_tree_node_set_read_ahead(struct dm_tree_node *dnode,
 				 uint32_t read_ahead,


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2011-08-18 19:38 jbrassow
  0 siblings, 0 replies; 25+ messages in thread
From: jbrassow @ 2011-08-18 19:38 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-08-18 19:38:27

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/metadata   : metadata-exported.h raid_manip.c 
	libdm          : libdevmapper.h libdm-deptree.c 
	man            : lvconvert.8.in 
	tools          : args.h commands.h lvconvert.c 

Log message:
	Add the ability to split an image from the mirror and track changes.
	
	~> lvconvert --splitmirrors 1 --trackchanges vg/lv
	The '--trackchanges' option allows a user the ability to use an image of
	a RAID1 array for the purposes of temporary read-only access.  The image
	can be merged back into the array at a later time and only the blocks that
	have changed in the array since the split will be resync'ed.  This
	operation can be thought of as a partial split.  The image is never completely
	extracted from the array, in that the array reserves the position the device
	occupied and tracks the differences between the array and the split image via
	a bitmap.  The image itself is rendered read-only and the name (<LV>_rimage_*)
	cannot be changed.  The user can complete the split (permanently splitting the
	image from the array) by re-issuing the 'lvconvert' command without the
	'--trackchanges' argument and specifying the '--name' argument.
	~> lvconvert --splitmirrors 1 --name my_split vg/lv
	Merging the tracked image back into the array is done with the '--merge'
	option (included in a follow-on patch).
	~> lvconvert --merge vg/lv_rimage_<n>
	
	The internal mechanics of this are relatively simple.  The 'raid' device-
	mapper target allows for the specification of an empty slot in an array
	via '- -'.  This is what will be used if a partial activation of an array
	is ever required.  (It would also be possible to use 'error' targets in
	place of the '- -'.)  If a RAID image is found to be both read-only and
	visible, then it is considered separate from the array and '- -' is used
	to hold it's position in the array.  So, all that needs to be done to
	temporarily split an image from the array /and/ cause the kernel target's
	bitmap to track (aka "mark") changes made is to make the specified image
	visible and read-only.  To merge the device back into the array, the image
	needs to be returned to the read/write state of the top-level LV and made
	invisible.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2076&r2=1.2077
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.229&r2=1.230
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.199&r2=1.200
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/raid_manip.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.141&r2=1.142
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.104&r2=1.105
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvconvert.8.in.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/args.h.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.160&r2=1.161
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.169&r2=1.170

--- LVM2/WHATS_NEW	2011/08/18 19:34:18	1.2076
+++ LVM2/WHATS_NEW	2011/08/18 19:38:26	1.2077
@@ -1,5 +1,6 @@
 Version 2.02.88 - 
 ==================================
+  Add --trackchanges support to --splitmirrors option for RAID1
   Add --splitmirrors support for RAID1 (1 image only)
   When down-converting RAID1, don't activate sub-lvs between suspend/resume
   Add -V as short form of --virtualsize in lvcreate.
--- LVM2/lib/activate/dev_manager.c	2011/08/11 19:38:00	1.229
+++ LVM2/lib/activate/dev_manager.c	2011/08/18 19:38:26	1.230
@@ -1226,17 +1226,39 @@
 			if (!dm_tree_node_add_target_area(node, dev_name(seg_dev(seg, s)), NULL,
 				    (seg_pv(seg, s)->pe_start + (extent_size * seg_pe(seg, s)))))
 				return_0;
-		} else if (seg_type(seg, s) == AREA_LV) {
-			if (seg_is_raid(seg)) {
-				dlid = build_dm_uuid(dm->mem,
-						     seg_metalv(seg, s)->lvid.s,
-						     NULL);
-				if (!dlid)
-					return_0;
-				if (!dm_tree_node_add_target_area(node, NULL, dlid,
-								  extent_size * seg_metale(seg, s)))
+		} else if (seg_is_raid(seg)) {
+			/*
+			 * RAID can handle unassigned areas.  It simple puts
+			 * '- -' in for the metadata/data device pair.  This
+			 * is a valid way to indicate to the RAID target that
+			 * the device is missing.
+			 *
+			 * If an image is marked as VISIBLE_LV and !LVM_WRITE,
+			 * it means the device has temporarily been extracted
+			 * from the array.  It may come back at a future date,
+			 * so the bitmap must track differences.  Again, '- -'
+			 * is used in the CTR table.
+			 */
+			if ((seg_type(seg, s) == AREA_UNASSIGNED) ||
+			    ((seg_lv(seg, s)->status & VISIBLE_LV) &&
+			     !(seg_lv(seg, s)->status & LVM_WRITE))) {
+				/* One each for metadata area and data area */
+				if (!dm_tree_node_add_null_area(node, 0) ||
+				    !dm_tree_node_add_null_area(node, 0))
 					return_0;
+				continue;
 			}
+			if (!(dlid = build_dm_uuid(dm->mem, seg_metalv(seg, s)->lvid.s, NULL)))
+				return_0;
+			if (!dm_tree_node_add_target_area(node, NULL, dlid, extent_size * seg_metale(seg, s)))
+				return_0;
+
+			if (!(dlid = build_dm_uuid(dm->mem, seg_lv(seg, s)->lvid.s, NULL)))
+				return_0;
+			if (!dm_tree_node_add_target_area(node, NULL, dlid, extent_size * seg_le(seg, s)))
+				return_0;
+		} else if (seg_type(seg, s) == AREA_LV) {
+
 			if (!(dlid = build_dm_uuid(dm->mem, seg_lv(seg, s)->lvid.s, NULL)))
 				return_0;
 			if (!dm_tree_node_add_target_area(node, NULL, dlid, extent_size * seg_le(seg, s)))
--- LVM2/lib/metadata/metadata-exported.h	2011/08/18 19:34:18	1.199
+++ LVM2/lib/metadata/metadata-exported.h	2011/08/18 19:38:27	1.200
@@ -744,6 +744,8 @@
 			       uint32_t new_count, struct dm_list *pvs);
 int lv_raid_split(struct logical_volume *lv, const char *split_name,
 		  uint32_t new_count, struct dm_list *splittable_pvs);
+int lv_raid_split_and_track(struct logical_volume *lv,
+			    struct dm_list *splittable_pvs);
 
 /* --  metadata/raid_manip.c */
 
--- LVM2/lib/metadata/raid_manip.c	2011/08/18 19:34:18	1.6
+++ LVM2/lib/metadata/raid_manip.c	2011/08/18 19:38:27	1.7
@@ -34,6 +34,22 @@
 	return seg->area_count;
 }
 
+static int _activate_sublv_preserving_excl(struct logical_volume *top_lv,
+					   struct logical_volume *sub_lv)
+{
+	struct cmd_context *cmd = top_lv->vg->cmd;
+
+	/* If top RAID was EX, use EX */
+	if (lv_is_active_exclusive_locally(top_lv)) {
+		if (!activate_lv_excl(cmd, sub_lv))
+			return_0;
+	} else {
+		if (!activate_lv(cmd, sub_lv))
+			return_0;
+	}
+	return 1;
+}
+
 /*
  * lv_is_on_pv
  * @lv:
@@ -623,3 +639,83 @@
 
 	return 1;
 }
+
+/*
+ * lv_raid_split_and_track
+ * @lv
+ * @splittable_pvs
+ *
+ * Only allows a single image to be split while tracking.  The image
+ * never actually leaves the mirror.  It is simply made visible.  This
+ * action triggers two things: 1) users are able to access the (data) image
+ * and 2) lower layers replace images marked with a visible flag with
+ * error targets.
+ *
+ * Returns: 1 on success, 0 on error
+ */
+int lv_raid_split_and_track(struct logical_volume *lv,
+			    struct dm_list *splittable_pvs)
+{
+	int s;
+	struct lv_segment *seg = first_seg(lv);
+
+	if (!seg_is_mirrored(seg)) {
+		log_error("Unable to split images from non-mirrored RAID");
+		return 0;
+	}
+
+	if (!raid_in_sync(lv)) {
+		log_error("Unable to split image from %s/%s while not in-sync",
+			  lv->vg->name, lv->name);
+		return 0;
+	}
+
+	for (s = seg->area_count - 1; s >= 0; s--) {
+		if (!lv_is_on_pvs(seg_lv(seg, s), splittable_pvs))
+			continue;
+		lv_set_visible(seg_lv(seg, s));
+		seg_lv(seg, s)->status &= ~LVM_WRITE;
+		break;
+	}
+
+	if (s >= seg->area_count) {
+		log_error("Unable to find image to satisfy request");
+		return 0;
+	}
+
+	if (!vg_write(lv->vg)) {
+		log_error("Failed to write changes to %s in %s",
+			  lv->name, lv->vg->name);
+		return 0;
+	}
+
+	if (!suspend_lv(lv->vg->cmd, lv)) {
+		log_error("Failed to suspend %s/%s before committing changes",
+			  lv->vg->name, lv->name);
+		return 0;
+	}
+
+	if (!vg_commit(lv->vg)) {
+		log_error("Failed to commit changes to %s in %s",
+			  lv->name, lv->vg->name);
+		return 0;
+	}
+
+	log_print("%s split from %s for read-only purposes.",
+		  seg_lv(seg, s)->name, lv->name);
+
+	/* Resume original LV */
+	if (!resume_lv(lv->vg->cmd, lv)) {
+		log_error("Failed to resume %s/%s after committing changes",
+			  lv->vg->name, lv->name);
+		return 0;
+	}
+
+	/* Activate the split (and tracking) LV */
+	if (!_activate_sublv_preserving_excl(lv, seg_lv(seg, s)))
+		return 0;
+
+	log_print("Use 'lvconvert --merge %s/%s' to merge back into %s",
+		  lv->vg->name, seg_lv(seg, s)->name, lv->name);
+	return 1;
+}
--- LVM2/libdm/libdevmapper.h	2011/08/11 17:29:04	1.141
+++ LVM2/libdm/libdevmapper.h	2011/08/18 19:38:27	1.142
@@ -516,6 +516,7 @@
 				    const char *dev_name,
 				    const char *dlid,
 				    uint64_t offset);
+int dm_tree_node_add_null_area(struct dm_tree_node *node, uint64_t offset);
 
 /*
  * Set readahead (in sectors) after loading the node.
--- LVM2/libdm/libdm-deptree.c	2011/08/11 19:17:10	1.104
+++ LVM2/libdm/libdm-deptree.c	2011/08/18 19:38:27	1.105
@@ -1484,11 +1484,11 @@
 	unsigned log_parm_count;
 
 	dm_list_iterate_items(area, &seg->areas) {
-		if (!_build_dev_string(devbuf, sizeof(devbuf), area->dev_node))
-			return_0;
-
 		switch (seg->type) {
 		case SEG_REPLICATOR_DEV:
+			if (!_build_dev_string(devbuf, sizeof(devbuf), area->dev_node))
+				return_0;
+
 			EMIT_PARAMS(*pos, " %d 1 %s", area->rsite_index, devbuf);
 			if (first_time)
 				EMIT_PARAMS(*pos, " nolog 0");
@@ -1530,9 +1530,19 @@
 		case SEG_RAID6_ZR:
 		case SEG_RAID6_NR:
 		case SEG_RAID6_NC:
+			if (!area->dev_node) {
+				EMIT_PARAMS(*pos, " -");
+				break;
+			}
+			if (!_build_dev_string(devbuf, sizeof(devbuf), area->dev_node))
+				return_0;
+
 			EMIT_PARAMS(*pos, " %s", devbuf);
 			break;
 		default:
+			if (!_build_dev_string(devbuf, sizeof(devbuf), area->dev_node))
+				return_0;
+
 			EMIT_PARAMS(*pos, "%s%s %" PRIu64, first_time ? "" : " ",
 				    devbuf, area->offset);
 		}
@@ -2571,7 +2581,7 @@
 		if (!_link_tree_nodes(node, dev_node))
 			return_0;
 	} else {
-        	if (stat(dev_name, &info) < 0) {
+		if (stat(dev_name, &info) < 0) {
 			log_error("Device %s not found.", dev_name);
 			return 0;
 		}
@@ -2600,6 +2610,18 @@
 	return 1;
 }
 
+int dm_tree_node_add_null_area(struct dm_tree_node *node, uint64_t offset)
+{
+	struct load_segment *seg;
+
+	seg = dm_list_item(dm_list_last(&node->props.segs), struct load_segment);
+
+	if (!_add_area(node, seg, NULL, offset))
+		return_0;
+
+	return 1;
+}
+
 void dm_tree_set_cookie(struct dm_tree_node *node, uint32_t cookie)
 {
 	node->dtree->cookie = cookie;
--- LVM2/man/lvconvert.8.in	2011/01/04 21:41:35	1.19
+++ LVM2/man/lvconvert.8.in	2011/08/18 19:38:27	1.20
@@ -17,7 +17,7 @@
 
 .br
 .B lvconvert
-\-\-splitmirrors Images \-\-name SplitLogicalVolumeName
+\-\-splitmirrors Images [\-\-name SplitLogicalVolumeName] [\-\-trackchanges]
 .br
 MirrorLogicalVolume[Path] [SplittablePhysicalVolume[Path][:PE[-PE]]...]
 .br
@@ -114,7 +114,8 @@
 .I \-\-splitmirrors Images
 The number of redundant Images of a mirror to be split off and used
 to form a new logical volume.  A name must be supplied for the
-newly-split-off logical volume using the \-\-name argument.
+newly-split-off logical volume using the \-\-name argument, unless
+the \-\-trackchanges argument is given.
 
 .TP
 .I \-n Name
@@ -122,6 +123,15 @@
 a mirror logical volume.
 .br
 
+.TP
+.I \-\-trackchanges
+This argument is used along with \-\-splitmirrors when the intention
+is to use the split-off image temporarily in a read-only fashion.  Splitting
+off an image in this way allows it to be merged back into the mirror later
+- only resynchronizing those portions of the image that have changed since
+the split occurred.  This option is only available to the "raid1" segment
+type.
+.br
 
 .TP
 .I \-s, \-\-snapshot
--- LVM2/tools/args.h	2011/08/17 15:15:37	1.82
+++ LVM2/tools/args.h	2011/08/18 19:38:27	1.83
@@ -54,6 +54,7 @@
 arg(corelog_ARG, '\0', "corelog", NULL, 0)
 arg(mirrorlog_ARG, '\0', "mirrorlog", string_arg, 0)
 arg(splitmirrors_ARG, '\0', "splitmirrors", int_arg, 0)
+arg(trackchanges_ARG, '\0', "trackchanges", NULL, 0)
 arg(repair_ARG, '\0', "repair", NULL, 0)
 arg(use_policies_ARG, '\0', "use-policies", NULL, 0)
 arg(monitor_ARG, '\0', "monitor", yes_no_arg, 0)
--- LVM2/tools/commands.h	2011/08/17 15:15:37	1.160
+++ LVM2/tools/commands.h	2011/08/18 19:38:27	1.161
@@ -114,6 +114,7 @@
    "\tLogicalVolume[Path] [PhysicalVolume[Path]...]\n\n"
 
    "lvconvert "
+   "[--splitmirrors Images --trackchanges]\n"
    "[--splitmirrors Images --name SplitLogicalVolumeName]\n"
    "\tLogicalVolume[Path] [SplittablePhysicalVolume[Path]...]\n\n"
 
@@ -139,7 +140,7 @@
 
    alloc_ARG, background_ARG, chunksize_ARG, corelog_ARG, interval_ARG,
    merge_ARG, mirrorlog_ARG, mirrors_ARG, name_ARG, noudevsync_ARG,
-   regionsize_ARG, repair_ARG, snapshot_ARG, splitmirrors_ARG,
+   regionsize_ARG, repair_ARG, snapshot_ARG, splitmirrors_ARG, trackchanges_ARG,
    stripes_long_ARG, stripesize_ARG, test_ARG,
    use_policies_ARG, yes_ARG, force_ARG, zero_ARG)
 
--- LVM2/tools/lvconvert.c	2011/08/18 19:34:18	1.169
+++ LVM2/tools/lvconvert.c	2011/08/18 19:38:27	1.170
@@ -158,13 +158,15 @@
 	 * discarding it.
 	 */
 	if (arg_count(cmd, splitmirrors_ARG)) {
-		if (!arg_count(cmd, name_ARG)) {
+		if (!arg_count(cmd, name_ARG) &&
+		    !arg_count(cmd, trackchanges_ARG)) {
 			log_error("Please name the new logical volume using '--name'");
 			return 0;
 		}
 
 		lp->lv_split_name = arg_value(cmd, name_ARG);
-		if (!apply_lvname_restrictions(lp->lv_split_name))
+		if (lp->lv_split_name &&
+		    !apply_lvname_restrictions(lp->lv_split_name))
 			return_0;
 
 		lp->keep_mimages = 1;
@@ -1146,6 +1148,11 @@
 
 		/* Reduce number of mirrors */
 		if (lp->keep_mimages) {
+			if (arg_count(cmd, trackchanges_ARG)) {
+				log_error("--trackchanges is not available "
+					  "to 'mirror' segment type");
+				return 0;
+			}
 			if (!lv_split_mirror_images(lv, lp->lv_split_name,
 						    nmc, operable_pvs))
 				return 0;
@@ -1417,7 +1424,9 @@
 			return 0;
 		}
 
-		if (arg_count(cmd, splitmirrors_ARG))
+		if (arg_count(cmd, trackchanges_ARG))
+			return lv_raid_split_and_track(lv, lp->pvh);
+		else if (arg_count(cmd, splitmirrors_ARG))
 			return lv_raid_split(lv, lp->lv_split_name,
 					     image_count, lp->pvh);
 		else


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2010-10-13 21:26 snitzer
  0 siblings, 0 replies; 25+ messages in thread
From: snitzer @ 2010-10-13 21:26 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-10-13 21:26:38

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/metadata   : segtype.h 
	lib/snapshot   : snapshot.c 
	man            : lvconvert.8.in 
	tools          : lvconvert.c 

Log message:
	Convey need for snapshot-merge target in lvconvert error message and man
	page.
	
	Add ->target_name to segtype_handler to allow a more specific target
	name to be returned based on the state of the segment.
	
	Result of trying to merge a snapshot using a kernel that doesn't have
	the snapshot-merge target:
	
	Before:
	# lvconvert --merge vg/snap
	Can't expand LV lv: snapshot target support missing from kernel?
	Failed to suspend origin lv
	
	After:
	# lvconvert --merge vg/snap
	Can't process LV lv: snapshot-merge target support missing from kernel?
	Failed to suspend origin lv
	Unable to merge LV "snap" into it's origin.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1760&r2=1.1761
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.202&r2=1.203
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/lvconvert.8.in.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.147&r2=1.148

--- LVM2/WHATS_NEW	2010/10/13 15:50:34	1.1760
+++ LVM2/WHATS_NEW	2010/10/13 21:26:37	1.1761
@@ -1,5 +1,6 @@
 Version 2.02.75 - 
 =====================================
+  Convey need for snapshot-merge target in lvconvert error message and man page.
   Add "devices/disable_after_error_count" to lvm.conf.
   Give correct error message when creating a too-small snapshot.
   Implement vgextend --restoremissing.
--- LVM2/lib/activate/dev_manager.c	2010/08/26 14:21:51	1.202
+++ LVM2/lib/activate/dev_manager.c	2010/10/13 21:26:37	1.203
@@ -1350,19 +1350,23 @@
 	uint32_t s;
 	struct dm_list *snh;
 	struct lv_segment *seg_present;
+	const char *target_name;
 
 	/* Ensure required device-mapper targets are loaded */
 	seg_present = find_cow(seg->lv) ? : seg;
+	target_name = (seg_present->segtype->ops->target_name ?
+		       seg_present->segtype->ops->target_name(seg_present) :
+		       seg_present->segtype->name);
 
 	log_debug("Checking kernel supports %s segment type for %s%s%s",
-		  seg_present->segtype->name, seg->lv->name,
+		  target_name, seg->lv->name,
 		  layer ? "-" : "", layer ? : "");
 
 	if (seg_present->segtype->ops->target_present &&
 	    !seg_present->segtype->ops->target_present(seg_present->lv->vg->cmd,
 						       seg_present, NULL)) {
-		log_error("Can't expand LV %s: %s target support missing "
-			  "from kernel?", seg->lv->name, seg_present->segtype->name);
+		log_error("Can't process LV %s: %s target support missing "
+			  "from kernel?", seg->lv->name, target_name);
 		return 0;
 	}
 
--- LVM2/lib/metadata/segtype.h	2010/05/24 15:32:21	1.30
+++ LVM2/lib/metadata/segtype.h	2010/10/13 21:26:37	1.31
@@ -66,6 +66,7 @@
 
 struct segtype_handler {
 	const char *(*name) (const struct lv_segment * seg);
+	const char *(*target_name) (const struct lv_segment * seg);
 	void (*display) (const struct lv_segment * seg);
 	int (*text_export) (const struct lv_segment * seg,
 			    struct formatter * f);
--- LVM2/lib/snapshot/snapshot.c	2010/08/17 01:16:41	1.49
+++ LVM2/lib/snapshot/snapshot.c	2010/10/13 21:26:37	1.50
@@ -28,6 +28,14 @@
 	return seg->segtype->name;
 }
 
+static const char *_snap_target_name(const struct lv_segment *seg)
+{
+	if (seg->status & MERGING)
+		return "snapshot-merge";
+
+	return _snap_name(seg);
+}
+
 static int _snap_text_import(struct lv_segment *seg, const struct config_node *sn,
 			struct dm_hash_table *pv_hash __attribute__((unused)))
 {
@@ -217,6 +225,7 @@
 
 static struct segtype_handler _snapshot_ops = {
 	.name = _snap_name,
+	.target_name = _snap_target_name,
 	.text_import = _snap_text_import,
 	.text_export = _snap_text_export,
 	.target_status_compatible = _snap_target_status_compatible,
--- LVM2/man/lvconvert.8.in	2010/04/13 16:13:08	1.17
+++ LVM2/man/lvconvert.8.in	2010/10/13 21:26:38	1.18
@@ -135,8 +135,10 @@
 If the volume is read-only the snapshot will not be zeroed.
 .TP
 .I \-\-merge
-Merges a snapshot into its origin volume. If both the origin and snapshot volume
-are not open the merge will start immediately.  Otherwise, the merge will start
+Merges a snapshot into its origin volume.  To check if your kernel
+supports this feature, look for 'snapshot-merge' in the output
+of 'dmsetup targets'.  If both the origin and snapshot volume are not
+open the merge will start immediately.  Otherwise, the merge will start
 the first time either the origin or snapshot are activated and both are closed.
 Merging a snapshot into an origin that cannot be closed, for example a root
 filesystem, is deferred until the next time the origin volume is activated.
--- LVM2/tools/lvconvert.c	2010/10/12 16:41:18	1.147
+++ LVM2/tools/lvconvert.c	2010/10/13 21:26:38	1.148
@@ -1563,7 +1563,7 @@
 			return ECMD_FAILED;
 		}
 		if (!lvconvert_merge(cmd, lv, lp)) {
-			stack;
+			log_error("Unable to merge LV \"%s\" into it's origin.", lv->name);
 			return ECMD_FAILED;
 		}
 	} else if (lp->snapshot) {


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2010-04-23 14:16 prajnoha
  0 siblings, 0 replies; 25+ messages in thread
From: prajnoha @ 2010-04-23 14:16 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2010-04-23 14:16:33

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/misc       : lvm-string.c lvm-string.h 
	tools          : toollib.c 

Log message:
	Set appropriate udev flags for reserved LVs.
	
	There's no need for foreign udev rules to touch LVM reserved devices
	(snapshot, pvmove, _mlog, _mimage, _vorigin) even if they happen to
	be visible. The same applies for /dev/disk content - no need to create
	any content for these devices (and so no need to run any "blkid" etc.).
	This also prevents setting any inotify "watch" from udev rules on such
	devices that is a source of race conditions (the rules need to honor
	DM_UDEV_DISABLE_OTHER_RULES_FLAG for this to work though).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1535&r2=1.1536
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.186&r2=1.187
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.h.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.194&r2=1.195

--- LVM2/WHATS_NEW	2010/04/23 02:57:39	1.1535
+++ LVM2/WHATS_NEW	2010/04/23 14:16:32	1.1536
@@ -1,5 +1,6 @@
 Version 2.02.64 -
 =================================
+  Set appropriate udev flags for reserved LVs.
   Don't preload the origin when removing a snapshot whose merge is pending.
   Disallow the addition of mirror images while a conversion is happening.
   Disallow primary mirror image removal when mirror is not in-sync.
--- LVM2/lib/activate/dev_manager.c	2010/04/23 02:57:41	1.186
+++ LVM2/lib/activate/dev_manager.c	2010/04/23 14:16:33	1.187
@@ -751,12 +751,55 @@
 	return r;
 }
 
+static uint16_t _get_udev_flags(struct dev_manager *dm, struct logical_volume *lv,
+				const char *layer)
+{
+	uint16_t udev_flags = 0;
+
+	/*
+	 * Is this top-level and visible device?
+	 * If not, create just the /dev/mapper content.
+	 */
+	if (layer || !lv_is_visible(lv))
+		udev_flags |= DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG |
+			      DM_UDEV_DISABLE_DISK_RULES_FLAG |
+			      DM_UDEV_DISABLE_OTHER_RULES_FLAG;
+	/*
+	 * There's no need for other udev rules to touch special LVs with
+	 * reserved names. We don't need to populate /dev/disk here either.
+	 * Even if they happen to be visible and top-level.
+	 */
+	else if (is_reserved_lvname(lv->name))
+		udev_flags |= DM_UDEV_DISABLE_DISK_RULES_FLAG |
+			      DM_UDEV_DISABLE_OTHER_RULES_FLAG;
+
+	/*
+	 * Snapshots and origins could have the same rule applied that will
+	 * give symlinks exactly the same name (e.g. a name based on
+	 * filesystem UUID). We give preference to origins to make such
+	 * naming deterministic (e.g. symlinks in /dev/disk/by-uuid).
+	 */
+	if (lv_is_cow(lv))
+		udev_flags |= DM_UDEV_LOW_PRIORITY_FLAG;
+
+	/*
+	 * Finally, add flags to disable /dev/mapper and /dev/<vgname> content
+	 * to be created by udev if it is requested by user's configuration.
+	 * This is basically an explicit fallback to old node/symlink creation
+	 * without udev.
+	 */
+	if (!dm->cmd->current_settings.udev_rules)
+		udev_flags |= DM_UDEV_DISABLE_DM_RULES_FLAG |
+			      DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG;
+
+	return udev_flags;
+}
+
 static int _add_dev_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
 			       struct logical_volume *lv, const char *layer)
 {
 	char *dlid, *name;
 	struct dm_info info, info2;
-	uint16_t udev_flags = 0;
 
 	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, layer)))
 		return_0;
@@ -794,20 +837,8 @@
 		}
 	}
 
-	if (layer || !lv_is_visible(lv))
-		udev_flags |= DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG |
-			      DM_UDEV_DISABLE_DISK_RULES_FLAG |
-			      DM_UDEV_DISABLE_OTHER_RULES_FLAG;
-
-	if (lv_is_cow(lv))
-		udev_flags |= DM_UDEV_LOW_PRIORITY_FLAG;
-
-	if (!dm->cmd->current_settings.udev_rules)
-		udev_flags |= DM_UDEV_DISABLE_DM_RULES_FLAG |
-			      DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG;
-
-	if (info.exists && !dm_tree_add_dev_with_udev_flags(dtree, info.major,
-							    info.minor, udev_flags)) {
+	if (info.exists && !dm_tree_add_dev_with_udev_flags(dtree, info.major, info.minor,
+							_get_udev_flags(dm, lv, layer))) {
 		log_error("Failed to add device (%" PRIu32 ":%" PRIu32") to dtree",
 			  info.major, info.minor);
 		return 0;
@@ -1164,7 +1195,6 @@
 	uint32_t max_stripe_size = UINT32_C(0);
 	uint32_t read_ahead = lv->read_ahead;
 	uint32_t read_ahead_flags = UINT32_C(0);
-	uint16_t udev_flags = 0;
 
 	/* FIXME Seek a simpler way to lay out the snapshot-merge tree. */
 
@@ -1205,18 +1235,6 @@
 
 	lvlayer->lv = lv;
 
-	if (layer || !lv_is_visible(lv))
-		udev_flags |= DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG |
-			      DM_UDEV_DISABLE_DISK_RULES_FLAG |
-			      DM_UDEV_DISABLE_OTHER_RULES_FLAG;
-
-	if (lv_is_cow(lv))
-		udev_flags |= DM_UDEV_LOW_PRIORITY_FLAG;
-
-	if (!dm->cmd->current_settings.udev_rules)
-		udev_flags |= DM_UDEV_DISABLE_DM_RULES_FLAG |
-			      DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG;
-
 	/*
 	 * Add LV to dtree.
 	 * If we're working with precommitted metadata, clear any
@@ -1229,7 +1247,7 @@
 					     _read_only_lv(lv),
 					     (lv->vg->status & PRECOMMITTED) ? 1 : 0,
 					     lvlayer,
-					     udev_flags)))
+					     _get_udev_flags(dm, lv, layer))))
 		return_0;
 
 	/* Store existing name so we can do rename later */
--- LVM2/lib/misc/lvm-string.c	2010/04/14 13:01:43	1.19
+++ LVM2/lib/misc/lvm-string.c	2010/04/23 14:16:33	1.20
@@ -242,3 +242,49 @@
 
 	return 1;
 }
+
+int apply_lvname_restrictions(const char *name)
+{
+	if (!strncmp(name, "snapshot", 8)) {
+		log_error("Names starting \"snapshot\" are reserved. "
+			  "Please choose a different LV name.");
+		return 0;
+	}
+
+	if (!strncmp(name, "pvmove", 6)) {
+		log_error("Names starting \"pvmove\" are reserved. "
+			  "Please choose a different LV name.");
+		return 0;
+	}
+
+	if (strstr(name, "_mlog")) {
+		log_error("Names including \"_mlog\" are reserved. "
+			  "Please choose a different LV name.");
+		return 0;
+	}
+
+	if (strstr(name, "_mimage")) {
+		log_error("Names including \"_mimage\" are reserved. "
+			  "Please choose a different LV name.");
+		return 0;
+	}
+
+	if (strstr(name, "_vorigin")) {
+		log_error("Names including \"_vorigin\" are reserved. "
+			  "Please choose a different LV name.");
+		return 0;
+	}
+
+	return 1;
+}
+
+int is_reserved_lvname(const char *name)
+{
+	int rc, old_suppress;
+
+	old_suppress = log_suppress(2);
+	rc = !apply_lvname_restrictions(name);
+	log_suppress(old_suppress);
+
+	return rc;
+}
--- LVM2/lib/misc/lvm-string.h	2010/04/14 13:01:43	1.19
+++ LVM2/lib/misc/lvm-string.h	2010/04/23 14:16:33	1.20
@@ -34,6 +34,9 @@
 
 int validate_name(const char *n);
 
+int apply_lvname_restrictions(const char *name);
+int is_reserved_lvname(const char *name);
+
 /*
  * Returns number of occurrences of c in first len characters of str.
  */
--- LVM2/tools/toollib.c	2010/04/14 02:19:49	1.194
+++ LVM2/tools/toollib.c	2010/04/23 14:16:33	1.195
@@ -1125,52 +1125,6 @@
 	return r;
 }
 
-int apply_lvname_restrictions(const char *name)
-{
-	if (!strncmp(name, "snapshot", 8)) {
-		log_error("Names starting \"snapshot\" are reserved. "
-			  "Please choose a different LV name.");
-		return 0;
-	}
-
-	if (!strncmp(name, "pvmove", 6)) {
-		log_error("Names starting \"pvmove\" are reserved. "
-			  "Please choose a different LV name.");
-		return 0;
-	}
-
-	if (strstr(name, "_mlog")) {
-		log_error("Names including \"_mlog\" are reserved. "
-			  "Please choose a different LV name.");
-		return 0;
-	}
-
-	if (strstr(name, "_mimage")) {
-		log_error("Names including \"_mimage\" are reserved. "
-			  "Please choose a different LV name.");
-		return 0;
-	}
-
-	if (strstr(name, "_vorigin")) {
-		log_error("Names including \"_vorigin\" are reserved. "
-			  "Please choose a different LV name.");
-		return 0;
-	}
-
-	return 1;
-}
-
-int is_reserved_lvname(const char *name)
-{
-	int rc, old_suppress;
-
-	old_suppress = log_suppress(2);
-	rc = !apply_lvname_restrictions(name);
-	log_suppress(old_suppress);
-
-	return rc;
-}
-
 void vgcreate_params_set_defaults(struct vgcreate_params *vp_def,
 				  struct volume_group *vg)
 {


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2010-02-17 22:59 snitzer
  0 siblings, 0 replies; 25+ messages in thread
From: snitzer @ 2010-02-17 22:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-02-17 22:59:46

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/metadata   : lv_manip.c snapshot_manip.c 
	tools          : lvconvert.c 

Log message:
	Refactor snapshot-merge deptree and device removal to support info-by-uuid
	
	Add a merging snapshot to the deptree, using the "error" target, rather
	than avoid adding it entirely.  This allows proper cleanup of the -cow
	device without having to rename the -cow to use the origin's name as a
	prefix.
	
	Move the preloading of the origin LV, after a merge, from
	lv_remove_single() to vg_remove_snapshot().  Having vg_remove_snapshot()
	preload the origin allows the -cow device to be released so that it can
	be removed via deactivate_lv().  lv_remove_single()'s deactivate_lv()
	reliably removes the -cow device because the associated snapshot LV,
	that is to be removed when a snapshot-merge completes, is always added
	to the deptree (and kernel -- via "error" target).
	
	Now when the snapshot LV is removed both the -cow and -real devices
	get removed using uuid rather than device name.  This paves the way
	for us to switch over to info-by-uuid queries.
	
	Signed-off-by: Mike Snitzer <snitzer@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1435&r2=1.1436
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.180&r2=1.181
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.207&r2=1.208
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.120&r2=1.121

--- LVM2/WHATS_NEW	2010/02/16 01:14:34	1.1435
+++ LVM2/WHATS_NEW	2010/02/17 22:59:46	1.1436
@@ -1,5 +1,6 @@
 Version 2.02.62 -
 ====================================
+  Refactor snapshot-merge deptree and device removal to support info-by-uuid.
 
 Version 2.02.61 - 15th February 2010
 ====================================
--- LVM2/lib/activate/dev_manager.c	2010/02/10 14:38:24	1.180
+++ LVM2/lib/activate/dev_manager.c	2010/02/17 22:59:46	1.181
@@ -1035,10 +1035,6 @@
 		return 0;
 	}
 
-	/* cow is to be merged so skip adding it */
-	if (lv_is_merging_cow(lv))
-		return 1;
-
 	if (!(origin_dlid = build_dlid(dm, snap_seg->origin->lvid.s, "real")))
 		return_0;
 
@@ -1047,7 +1043,13 @@
 
 	size = (uint64_t) snap_seg->len * snap_seg->origin->vg->extent_size;
 
-	if (!dm_tree_node_add_snapshot_target(dnode, size, origin_dlid, cow_dlid, 1, snap_seg->chunk_size))
+	if (lv_is_merging_cow(lv)) {
+		/* cow is to be merged so load the error target */
+		if (!dm_tree_node_add_error_target(dnode, size))
+			return_0;
+	}
+	else if (!dm_tree_node_add_snapshot_target(dnode, size, origin_dlid,
+						   cow_dlid, 1, snap_seg->chunk_size))
 		return_0;
 
 	return 1;
@@ -1166,7 +1168,7 @@
 	struct lv_layer *lvlayer;
 	struct dm_tree_node *dnode;
 	const struct dm_info *dinfo;
-	char *name, *dlid, *lv_name;
+	char *name, *dlid;
 	uint32_t max_stripe_size = UINT32_C(0);
 	uint32_t read_ahead = lv->read_ahead;
 	uint32_t read_ahead_flags = UINT32_C(0);
@@ -1192,22 +1194,7 @@
 		}
 	}
 
-	lv_name = lv->name;
-	if (lv_is_cow(lv) && lv_is_merging_cow(lv)) {
-		if (layer) {
-			/*
-			 * use origin's name as basis for snapshot-merge device names;
-			 * this allows _clean_tree to automatically cleanup "-cow"
-			 * when the origin is resumed (after merge completes)
-			 */
-			lv_name = origin_from_cow(lv)->name;
-		} else {
-			/* top-level snapshot device is not needed during merge */
-			return 1;
-		}
-	}
-
-	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv_name, layer)))
+	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, layer)))
 		return_0;
 
 	if (!(dlid = build_dlid(dm, lv->lvid.s, layer)))
@@ -1220,7 +1207,7 @@
 
 	if (!(lvlayer = dm_pool_alloc(dm->mem, sizeof(*lvlayer)))) {
 		log_error("_add_new_lv_to_dtree: pool alloc failed for %s %s.",
-			  lv_name, layer);
+			  lv->name, layer);
 		return 0;
 	}
 
--- LVM2/lib/metadata/lv_manip.c	2010/01/20 21:53:10	1.207
+++ LVM2/lib/metadata/lv_manip.c	2010/02/17 22:59:46	1.208
@@ -2064,7 +2064,6 @@
 	struct volume_group *vg;
 	struct lvinfo info;
 	struct logical_volume *origin = NULL;
-	int was_merging = 0, preload_origin = 0;
 
 	vg = lv->vg;
 
@@ -2117,24 +2116,18 @@
 	if (!archive(vg))
 		return 0;
 
-	/* FIXME Snapshot commit out of sequence if it fails after here? */
-	if (!deactivate_lv(cmd, lv)) {
-		log_error("Unable to deactivate logical volume \"%s\"",
-			  lv->name);
-		return 0;
-	}
-
 	if (lv_is_cow(lv)) {
 		origin = origin_from_cow(lv);
-		was_merging = lv_is_merging_origin(origin);
 		log_verbose("Removing snapshot %s", lv->name);
+		/* vg_remove_snapshot() will preload origin if it was merging */
 		if (!vg_remove_snapshot(lv))
 			return_0;
-		if (was_merging && lv_is_origin(origin)) {
-			/* snapshot(s) still exist. preload new origin prior to suspend. */
-			/* FIXME Seek a simpler way of dealing with this within the tree. */
-			preload_origin = 1;
-		}
+	}
+
+	if (!deactivate_lv(cmd, lv)) {
+		log_error("Unable to deactivate logical volume \"%s\"",
+			  lv->name);
+		return 0;
 	}
 
 	log_verbose("Releasing logical volume \"%s\"", lv->name);
@@ -2144,20 +2137,15 @@
 	}
 
 	/* store it on disks */
-	if (!vg_write(vg))
-		return_0;
-
-	if (!preload_origin && !vg_commit(vg))
+	if (!vg_write(vg) || !vg_commit(vg))
 		return_0;
 
-	/* If no snapshots left or if we stopped merging, reload */
-	if (origin && (!lv_is_origin(origin) || was_merging)) {
+	/* If no snapshots left, reload without -real. */
+	if (origin && (!lv_is_origin(origin))) {
 		if (!suspend_lv(cmd, origin)) {
 			log_error("Failed to refresh %s without snapshot.", origin->name);
 			return 0;
 		}
-		if (preload_origin && !vg_commit(vg))
-			return_0;
 		if (!resume_lv(cmd, origin)) {
 			log_error("Failed to resume %s.", origin->name);
 			return 0;
--- LVM2/lib/metadata/snapshot_manip.c	2010/01/13 01:56:18	1.47
+++ LVM2/lib/metadata/snapshot_manip.c	2010/02/17 22:59:46	1.48
@@ -15,6 +15,7 @@
 
 #include "lib.h"
 #include "metadata.h"
+#include "locking.h"
 #include "toolcontext.h"
 #include "lv_alloc.h"
 
@@ -58,9 +59,9 @@
 
 struct lv_segment *find_merging_cow(const struct logical_volume *origin)
 {
-	/* FIXME: eliminate this wrapper and just use find_cow()?
-	 * - find_merging_cow() adds to code clarity in caller
-	 */
+	if (!lv_is_merging_origin(origin))
+		return NULL;
+
 	return find_cow(origin);
 }
 
@@ -170,12 +171,22 @@
 
 int vg_remove_snapshot(struct logical_volume *cow)
 {
+	int preload_origin = 0;
 	struct logical_volume *origin = origin_from_cow(cow);
 
 	dm_list_del(&cow->snapshot->origin_list);
 	origin->origin_count--;
-	if (find_merging_cow(origin) == find_cow(cow))
-		clear_snapshot_merge(origin_from_cow(cow));
+	if (find_merging_cow(origin) == find_cow(cow)) {
+		clear_snapshot_merge(origin);
+		/*
+		 * preload origin to:
+		 * - allow proper release of -cow
+		 * - avoid allocations with other devices suspended
+		 *   when transitioning from "snapshot-merge" to
+		 *   "snapshot-origin after a merge completes.
+		 */
+		preload_origin = 1;
+	}
 
 	if (!lv_remove(cow->snapshot->lv)) {
 		log_error("Failed to remove internal snapshot LV %s",
@@ -186,5 +197,21 @@
 	cow->snapshot = NULL;
 	lv_set_visible(cow);
 
+	if (preload_origin) {
+		if (!vg_write(origin->vg))
+			return_0;
+		if (!suspend_lv(origin->vg->cmd, origin)) {
+			log_error("Failed to refresh %s without snapshot.",
+				  origin->name);
+			return 0;
+		}
+		if (!vg_commit(origin->vg))
+			return_0;
+		if (!resume_lv(origin->vg->cmd, origin)) {
+			log_error("Failed to resume %s.", origin->name);
+			return 0;
+		}
+	}
+
 	return 1;
 }
--- LVM2/tools/lvconvert.c	2010/02/06 07:44:16	1.120
+++ LVM2/tools/lvconvert.c	2010/02/17 22:59:46	1.121
@@ -1210,11 +1210,6 @@
 		goto out;
 	}
 
-	if (!deactivate_lv(cmd, lv)) {
-		log_warn("WARNING: Unable to deactivate merging snapshot %s", lv->name);
-		/* merge is running regardless of this deactivation failure */
-	}
-
 	lp->need_polling = 1;
 	lp->lv_to_poll = origin;
 


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2010-01-15 16:35 snitzer
  0 siblings, 0 replies; 25+ messages in thread
From: snitzer @ 2010-01-15 16:35 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-01-15 16:35:26

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/metadata   : segtype.h 
	lib/snapshot   : snapshot.c 

Log message:
	Improve target type compatibility checking in _percent_run().
	Add 'target_status_compatible' method to 'struct segtype_handler'.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1389&r2=1.1390
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.173&r2=1.174
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44

--- LVM2/WHATS_NEW	2010/01/15 16:18:14	1.1389
+++ LVM2/WHATS_NEW	2010/01/15 16:35:26	1.1390
@@ -1,5 +1,7 @@
 Version 2.02.59 - 
 ===================================
+  Improve target type compatibility checking in _percent_run().
+  Add 'target_status_compatible' method to 'struct segtype_handler'.
   Fix difference between CTR table built and expected for cluster log.
 
 Version 2.02.58 - 14th January 2010
--- LVM2/lib/activate/dev_manager.c	2010/01/14 14:39:57	1.173
+++ LVM2/lib/activate/dev_manager.c	2010/01/15 16:35:26	1.174
@@ -443,19 +443,19 @@
 			seg = dm_list_item(segh, struct lv_segment);
 		}
 
-                /*
-                 * If target status doesn't have 'params' or 'type' is not in the same
-                 * target base class as 'target_type' (e.g. snapshot*, mirror*) skip it
-                 * - allows the situation when 'type' is "snapshot-merge" and
-                 *   'target_type' is "snapshot"
-                 */
-		/* FIXME Do this properly - relying on target prefixes is incorrect. (E.g. snapshot-origin)*/
-		if (!type || !params || strncmp(type, target_type, strlen(target_type)))
+		if (!type || !params)
 			continue;
 
 		if (!(segtype = get_segtype_from_string(dm->cmd, target_type)))
 			continue;
 
+		if (strcmp(type, target_type)) {
+			/* If kernel's type isn't an exact match is it compatible? */
+			if (!segtype->ops->target_status_compatible ||
+			    !segtype->ops->target_status_compatible(type))
+				continue;
+		}
+
 		if (segtype->ops->target_percent &&
 		    !segtype->ops->target_percent(&dm->target_state,
 						  &percent_range, dm->mem,
--- LVM2/lib/metadata/segtype.h	2009/10/16 17:41:52	1.26
+++ LVM2/lib/metadata/segtype.h	2010/01/15 16:35:26	1.27
@@ -77,6 +77,7 @@
                                 struct lv_segment *seg,
                                 struct dm_tree_node *node, uint64_t len,
                                 uint32_t *pvmove_mirror_count);
+	int (*target_status_compatible) (const char *type);
 	int (*target_percent) (void **target_state,
 			       percent_range_t *percent_range,
 			       struct dm_pool * mem,
--- LVM2/lib/snapshot/snapshot.c	2010/01/14 14:39:58	1.43
+++ LVM2/lib/snapshot/snapshot.c	2010/01/15 16:35:26	1.44
@@ -92,6 +92,11 @@
 	return 1;
 }
 
+static int _snap_target_status_compatible(const char *type)
+{
+	return (strcmp(type, "snapshot-merge") == 0);
+}
+
 #ifdef DEVMAPPER_SUPPORT
 static int _snap_target_percent(void **target_state __attribute((unused)),
 				percent_range_t *percent_range,
@@ -303,6 +308,7 @@
 	.name = _snap_name,
 	.text_import = _snap_text_import,
 	.text_export = _snap_text_export,
+	.target_status_compatible = _snap_target_status_compatible,
 #ifdef DEVMAPPER_SUPPORT
 	.target_percent = _snap_target_percent,
 	.target_present = _snap_target_present,


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2009-10-26 10:02 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2009-10-26 10:02 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-10-26 10:01:58

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/display    : display.c 
	lib/metadata   : lv_manip.c 
	lib/report     : report.c 
	tools          : lvconvert.c vgsplit.c 

Log message:
	Permit snapshots of mirrors.  (brassow)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1302&r2=1.1303
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.160&r2=1.161
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.105&r2=1.106
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.184&r2=1.185
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.104&r2=1.105
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.94&r2=1.95

--- LVM2/WHATS_NEW	2009/10/23 01:24:17	1.1302
+++ LVM2/WHATS_NEW	2009/10/26 10:01:56	1.1303
@@ -1,5 +1,6 @@
 Version 2.02.54 -
 =====================================
+  Permit snapshots of mirrors.
   Cleanup mimagetmp LV if allocation fails for new lvconvert mimage.
   Fix clvmd segfault when refresh_toolcontext fails.
   Remember to clear 'global lock held during cache refresh' state after use.
--- LVM2/lib/activate/dev_manager.c	2009/10/22 13:00:07	1.160
+++ LVM2/lib/activate/dev_manager.c	2009/10/26 10:01:57	1.161
@@ -551,16 +551,17 @@
 {
 	char *name;
 	const char *dlid;
+	const char *suffix = (lv_is_origin(lv)) ? "real" : NULL;
 
 	/*
 	 * Build a name for the top layer.
 	 */
-	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, NULL)))
+	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, suffix)))
 		return_0;
 
 	/* FIXME dm_pool_free ? */
 
-	if (!(dlid = build_dlid(dm, lv->lvid.s, NULL))) {
+	if (!(dlid = build_dlid(dm, lv->lvid.s, suffix))) {
 		log_error("dlid build failed for %s", lv->name);
 		return 0;
 	}
--- LVM2/lib/display/display.c	2009/10/01 00:35:29	1.105
+++ LVM2/lib/display/display.c	2009/10/26 10:01:57	1.106
@@ -480,7 +480,7 @@
 	struct lvinfo info;
 	int inkernel, snap_active = 0;
 	char uuid[64] __attribute((aligned(8)));
-	struct lv_segment *snap_seg = NULL;
+	struct lv_segment *snap_seg = NULL, *mirror_seg = NULL;
 	float snap_percent;	/* fused, fsize; */
 	percent_range_t percent_range;
 
@@ -563,6 +563,13 @@
 			  display_size(cmd, (uint64_t) snap_seg->chunk_size));
 	}
 
+	if (lv->status & MIRRORED) {
+ 		mirror_seg = first_seg(lv);
+		log_print("Mirrored volumes       %" PRIu32, mirror_seg->area_count);
+		if (lv->status & CONVERTING)
+			log_print("LV type        Mirror undergoing conversion");
+	}
+
 	log_print("Segments               %u", dm_list_size(&lv->segments));
 
 /********* FIXME Stripes & stripesize for each segment
--- LVM2/lib/metadata/lv_manip.c	2009/09/28 17:46:16	1.184
+++ LVM2/lib/metadata/lv_manip.c	2009/10/26 10:01:57	1.185
@@ -2936,11 +2936,12 @@
 					  "supported yet");
 				return 0;
 			}
-			if (org->status & MIRROR_IMAGE ||
-			    org->status & MIRROR_LOG ||
-			    org->status & MIRRORED) {
-				log_error("Snapshots and mirrors may not yet "
-					  "be mixed.");
+			if ((org->status & MIRROR_IMAGE) ||
+			    (org->status & MIRROR_LOG)) {
+				log_error("Snapshots of mirror %ss "
+					  "are not supported",
+					  (org->status & MIRROR_LOG) ?
+					  "log" : "image");
 				return 0;
 			}
 
--- LVM2/lib/report/report.c	2009/10/01 01:04:27	1.104
+++ LVM2/lib/report/report.c	2009/10/26 10:01:57	1.105
@@ -311,6 +311,11 @@
 		repstr[0] = 'p';
 	else if (lv->status & CONVERTING)
 		repstr[0] = 'c';
+	else if (lv->status & VIRTUAL)
+		repstr[0] = 'v';
+	/* Origin takes precedence over Mirror */
+	else if (lv_is_origin(lv))
+		repstr[0] = 'o';
 	else if (lv->status & MIRRORED) {
 		if (lv->status & MIRROR_NOTSYNCED)
 			repstr[0] = 'M';
@@ -323,10 +328,6 @@
 			repstr[0] = 'I';
 	else if (lv->status & MIRROR_LOG)
 		repstr[0] = 'l';
-	else if (lv->status & VIRTUAL)
-		repstr[0] = 'v';
-	else if (lv_is_origin(lv))
-		repstr[0] = 'o';
 	else if (lv_is_cow(lv))
 		repstr[0] = 's';
 	else
--- LVM2/tools/lvconvert.c	2009/10/23 01:24:17	1.95
+++ LVM2/tools/lvconvert.c	2009/10/26 10:01:57	1.96
@@ -713,6 +713,20 @@
 				  "LV: use lvchange --resync first.");
 			return 0;
 		}
+
+		/*
+		 * We allow snapshots of mirrors, but for now, we
+		 * do not allow up converting mirrors that are under
+		 * snapshots.  The layering logic is somewhat complex,
+		 * and preliminary test show that the conversion can't
+		 * seem to get the correct %'age of completion.
+		 */
+		if (lv_is_origin(lv)) {
+			log_error("Can't add additional mirror images to "
+				  "mirrors that are under snapshots");
+			return 0;
+		}
+
 		/*
 		 * Log addition/removal should be done before the layer
 		 * insertion to make the end result consistent with
@@ -891,12 +905,6 @@
 		return ECMD_FAILED;
 	}
 
-	if (lv_is_origin(lv)) {
-		log_error("Can't convert logical volume \"%s\" under snapshot",
-			  lv->name);
-		return ECMD_FAILED;
-	}
-
 	if (lv_is_cow(lv)) {
 		log_error("Can't convert snapshot logical volume \"%s\"",
 			  lv->name);
--- LVM2/tools/vgsplit.c	2009/09/14 22:47:50	1.94
+++ LVM2/tools/vgsplit.c	2009/10/26 10:01:57	1.95
@@ -411,14 +411,15 @@
 	if (!(_move_lvs(vg_from, vg_to)))
 		goto_bad;
 
-	/* Move required snapshots across */
-	if (!(_move_snapshots(vg_from, vg_to)))
-		goto_bad;
-
+	/* FIXME Separate the 'move' from the 'validation' to fix dev stacks */
 	/* Move required mirrors across */
 	if (!(_move_mirrors(vg_from, vg_to)))
 		goto_bad;
 
+	/* Move required snapshots across */
+	if (!(_move_snapshots(vg_from, vg_to)))
+		goto_bad;
+
 	/* Split metadata areas and check if both vgs have at least one area */
 	if (!(vg_split_mdas(cmd, vg_from, vg_to)) && vg_from->pv_count) {
 		log_error("Cannot split: Nowhere to store metadata for new Volume Group");


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2009-10-22 13:00 prajnoha
  0 siblings, 0 replies; 25+ messages in thread
From: prajnoha @ 2009-10-22 13:00 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	prajnoha@sourceware.org	2009-10-22 13:00:08

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	libdm          : .exported_symbols libdevmapper.h 
	                 libdm-deptree.c 

Log message:
	Use udev flags support in LVM and provide dm_tree_add_new_dev_with_udev_flags wrapper for dm_tree_add_new_dev.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1298&r2=1.1299
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.159&r2=1.160
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/.exported_symbols.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdevmapper.h.diff?cvsroot=lvm2&r1=1.98&r2=1.99
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-deptree.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60

--- LVM2/WHATS_NEW	2009/10/22 11:25:46	1.1298
+++ LVM2/WHATS_NEW	2009/10/22 13:00:07	1.1299
@@ -1,5 +1,6 @@
 Version 2.02.54 -
 =====================================
+  Use udev flags support in LVM.
   Delay announcing mirror monitoring to syslog until initialisation succeeded.
   Handle metadata with unknown segment types more gracefully.
   Set default owner and group to null.
--- LVM2/lib/activate/dev_manager.c	2009/10/01 00:35:29	1.159
+++ LVM2/lib/activate/dev_manager.c	2009/10/22 13:00:07	1.160
@@ -1003,6 +1003,7 @@
 	uint32_t max_stripe_size = UINT32_C(0);
 	uint32_t read_ahead = lv->read_ahead;
 	uint32_t read_ahead_flags = UINT32_C(0);
+	uint16_t udev_flags = 0;
 
 	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, layer)))
 		return_0;
@@ -1022,18 +1023,26 @@
 
 	lvlayer->lv = lv;
 
+	if (layer || !lv_is_visible(lv))
+		udev_flags |= DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG |
+			      DM_UDEV_DISABLE_DISK_RULES_FLAG;
+
+	if (lv_is_cow(lv))
+		udev_flags |= DM_UDEV_LOW_PRIORITY_FLAG;
+
 	/*
 	 * Add LV to dtree.
 	 * If we're working with precommitted metadata, clear any
 	 * existing inactive table left behind.
 	 * Major/minor settings only apply to the visible layer.
 	 */
-	if (!(dnode = dm_tree_add_new_dev(dtree, name, dlid,
+	if (!(dnode = dm_tree_add_new_dev_with_udev_flags(dtree, name, dlid,
 					     layer ? UINT32_C(0) : (uint32_t) lv->major,
 					     layer ? UINT32_C(0) : (uint32_t) lv->minor,
 					     _read_only_lv(lv),
 					     (lv->vg->status & PRECOMMITTED) ? 1 : 0,
-					     lvlayer)))
+					     lvlayer,
+					     udev_flags)))
 		return_0;
 
 	/* Store existing name so we can do rename later */
--- LVM2/libdm/.exported_symbols	2009/08/06 17:08:01	1.43
+++ LVM2/libdm/.exported_symbols	2009/10/22 13:00:07	1.44
@@ -50,6 +50,7 @@
 dm_tree_free
 dm_tree_add_dev
 dm_tree_add_new_dev
+dm_tree_add_new_dev_with_udev_flags
 dm_tree_node_get_name
 dm_tree_node_get_uuid
 dm_tree_node_get_info
--- LVM2/libdm/libdevmapper.h	2009/10/22 12:55:47	1.98
+++ LVM2/libdm/libdevmapper.h	2009/10/22 13:00:07	1.99
@@ -277,6 +277,15 @@
 					 int read_only,
 					 int clear_inactive,
 					 void *context);
+struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *tree,
+							 const char *name,
+							 const char *uuid,
+							 uint32_t major,
+							 uint32_t minor,
+							 int read_only,
+							 int clear_inactive,
+							 void *context,
+							 uint16_t udev_flags);
 
 /*
  * Search for a node in the tree.
--- LVM2/libdm/libdm-deptree.c	2009/10/22 12:55:48	1.59
+++ LVM2/libdm/libdm-deptree.c	2009/10/22 13:00:07	1.60
@@ -130,6 +130,8 @@
 
 	int activation_priority;	/* 0 gets activated first */
 
+	uint16_t udev_flags;		/* Udev control flags */
+
 	void *context;			/* External supplied context */
 
 	struct load_properties props;	/* For creation/table (re)load */
@@ -301,7 +303,8 @@
 						 const char *name,
 						 const char *uuid,
 						 struct dm_info *info,
-						 void *context)
+						 void *context,
+						 uint16_t udev_flags)
 {
 	struct dm_tree_node *node;
 	uint64_t dev;
@@ -317,6 +320,7 @@
 	node->uuid = uuid;
 	node->info = *info;
 	node->context = context;
+	node->udev_flags = udev_flags;
 	node->activation_priority = 0;
 
 	dm_list_init(&node->uses);
@@ -466,8 +470,8 @@
 		if (!_deps(&dmt, dtree->mem, major, minor, &name, &uuid, &info, &deps))
 			return_NULL;
 
-		if (!(node = _create_dm_tree_node(dtree, name, uuid,
-						  &info, NULL)))
+		if (!(node = _create_dm_tree_node(dtree, name, uuid, &info,
+						  NULL, 0)))
 			goto_out;
 		new = 1;
 	}
@@ -585,8 +589,8 @@
 		info.inactive_table = 0;
 		info.read_only = 0;
 
-		if (!(dnode = _create_dm_tree_node(dtree, name2, uuid2,
-						   &info, context)))
+		if (!(dnode = _create_dm_tree_node(dtree, name2, uuid2, &info,
+						   context, 0)))
 			return_NULL;
 
 		/* Attach to root node until a table is supplied */
@@ -613,10 +617,31 @@
 		return_NULL;
 
 	dnode->context = context;
+	dnode->udev_flags = 0;
 
 	return dnode;
 }
 
+struct dm_tree_node *dm_tree_add_new_dev_with_udev_flags(struct dm_tree *dtree,
+							 const char *name,
+							 const char *uuid,
+							 uint32_t major,
+							 uint32_t minor,
+							 int read_only,
+							 int clear_inactive,
+							 void *context,
+							 uint16_t udev_flags)
+{
+	struct dm_tree_node *node;
+
+	if ((node = dm_tree_add_new_dev(dtree, name, uuid, major, minor, read_only,
+				       clear_inactive, context)))
+		node->udev_flags = udev_flags;
+
+	return node;
+}
+
+
 void dm_tree_node_set_read_ahead(struct dm_tree_node *dnode,
 				 uint32_t read_ahead,
 				 uint32_t read_ahead_flags)
@@ -821,7 +846,8 @@
 	return r;
 }
 
-static int _deactivate_node(const char *name, uint32_t major, uint32_t minor, uint32_t *cookie)
+static int _deactivate_node(const char *name, uint32_t major, uint32_t minor,
+			    uint32_t *cookie, uint16_t udev_flags)
 {
 	struct dm_task *dmt;
 	int r = 0;
@@ -841,7 +867,7 @@
 	if (!dm_task_no_open_count(dmt))
 		log_error("Failed to disable open_count");
 
-	if (!dm_task_set_cookie(dmt, cookie, 0))
+	if (!dm_task_set_cookie(dmt, cookie, udev_flags))
 		goto out;
 
 	r = dm_task_run(dmt);
@@ -858,7 +884,7 @@
 }
 
 static int _rename_node(const char *old_name, const char *new_name, uint32_t major,
-			uint32_t minor, uint32_t *cookie)
+			uint32_t minor, uint32_t *cookie, uint16_t udev_flags)
 {
 	struct dm_task *dmt;
 	int r = 0;
@@ -881,7 +907,7 @@
 	if (!dm_task_no_open_count(dmt))
 		log_error("Failed to disable open_count");
 
-	if (!dm_task_set_cookie(dmt, cookie, 0))
+	if (!dm_task_set_cookie(dmt, cookie, udev_flags))
 		goto out;
 
 	r = dm_task_run(dmt);
@@ -895,7 +921,8 @@
 /* FIXME Merge with _suspend_node? */
 static int _resume_node(const char *name, uint32_t major, uint32_t minor,
 			uint32_t read_ahead, uint32_t read_ahead_flags,
-			struct dm_info *newinfo, uint32_t *cookie)
+			struct dm_info *newinfo, uint32_t *cookie,
+			uint16_t udev_flags)
 {
 	struct dm_task *dmt;
 	int r = 0;
@@ -924,7 +951,7 @@
 	if (!dm_task_set_read_ahead(dmt, read_ahead, read_ahead_flags))
 		log_error("Failed to set read ahead");
 
-	if (!dm_task_set_cookie(dmt, cookie, 0))
+	if (!dm_task_set_cookie(dmt, cookie, udev_flags))
 		goto out;
 
 	if ((r = dm_task_run(dmt)))
@@ -1011,7 +1038,8 @@
 		    !info.exists || info.open_count)
 			continue;
 
-		if (!_deactivate_node(name, info.major, info.minor, &dnode->dtree->cookie)) {
+		if (!_deactivate_node(name, info.major, info.minor,
+				      &dnode->dtree->cookie, dnode->udev_flags)) {
 			log_error("Unable to deactivate %s (%" PRIu32
 				  ":%" PRIu32 ")", name, info.major,
 				  info.minor);
@@ -1156,7 +1184,8 @@
 			/* Rename? */
 			if (child->props.new_name) {
 				if (!_rename_node(name, child->props.new_name, child->info.major,
-						  child->info.minor, &child->dtree->cookie)) {
+						  child->info.minor, &child->dtree->cookie,
+						  child->udev_flags)) {
 					log_error("Failed to rename %s (%" PRIu32
 						  ":%" PRIu32 ") to %s", name, child->info.major,
 						  child->info.minor, child->props.new_name);
@@ -1171,7 +1200,7 @@
 
 			if (!_resume_node(child->name, child->info.major, child->info.minor,
 					  child->props.read_ahead, child->props.read_ahead_flags,
-					  &newinfo, &child->dtree->cookie)) {
+					  &newinfo, &child->dtree->cookie, child->udev_flags)) {
 				log_error("Unable to resume %s (%" PRIu32
 					  ":%" PRIu32 ")", child->name, child->info.major,
 					  child->info.minor);
@@ -1622,7 +1651,7 @@
 
 		if (!_resume_node(child->name, child->info.major, child->info.minor,
 				  child->props.read_ahead, child->props.read_ahead_flags,
-				  &newinfo, &child->dtree->cookie)) {
+				  &newinfo, &child->dtree->cookie, child->udev_flags)) {
 			log_error("Unable to resume %s (%" PRIu32
 				  ":%" PRIu32 ")", child->name, child->info.major,
 				  child->info.minor);


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2008-07-15  0:25 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2008-07-15  0:25 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-07-15 00:25:52

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/metadata   : segtype.h 
	lib/mirror     : mirrored.c 
	lib/snapshot   : snapshot.c 

Log message:
	Cease recognising snapshot-in-use percentages returned by early development kernels.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.928&r2=1.929
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.138&r2=1.139
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31

--- LVM2/WHATS_NEW	2008/07/10 11:30:57	1.928
+++ LVM2/WHATS_NEW	2008/07/15 00:25:51	1.929
@@ -1,6 +1,7 @@
 Version 2.02.40 - 
 ================================
-  Add "flags" metadata field (akin to "status") for backward-compatible flags.
+  Cease recognising snapshot-in-use percentages returned by early devt kernels.
+  Add backward-compatible flags field to on-disk format_text metadata.
   Fix dmeventd monitoring libraries to link against liblvm2cmd again. (2.02.39)
 
 Version 2.02.39 - 27th June 2008
--- LVM2/lib/activate/dev_manager.c	2008/06/18 11:32:14	1.138
+++ LVM2/lib/activate/dev_manager.c	2008/07/15 00:25:51	1.139
@@ -379,8 +379,7 @@
 		    !segtype->ops->target_percent(&dm->target_state, dm->mem,
 						  dm->cmd, seg, params,
 						  &total_numerator,
-						  &total_denominator,
-						  percent))
+						  &total_denominator))
 			goto_out;
 
 	} while (next);
@@ -393,7 +392,7 @@
 
 	if (total_denominator)
 		*percent = (float) total_numerator *100 / total_denominator;
-	else if (*percent < 0)
+	else
 		*percent = 100;
 
 	log_debug("LV percent: %f", *percent);
--- LVM2/lib/metadata/segtype.h	2008/06/25 16:52:26	1.20
+++ LVM2/lib/metadata/segtype.h	2008/07/15 00:25:51	1.21
@@ -77,7 +77,7 @@
 			       struct cmd_context *cmd,
 			       struct lv_segment *seg, char *params,
 			       uint64_t *total_numerator,
-			       uint64_t *total_denominator, float *percent);
+			       uint64_t *total_denominator);
 	int (*target_present) (const struct lv_segment *seg,
 			       unsigned *attributes);
 	int (*modules_needed) (struct dm_pool *mem,
--- LVM2/lib/mirror/mirrored.c	2008/04/10 18:53:36	1.55
+++ LVM2/lib/mirror/mirrored.c	2008/07/15 00:25:51	1.56
@@ -176,8 +176,7 @@
 static int _mirrored_target_percent(void **target_state, struct dm_pool *mem,
 			   struct cmd_context *cmd, struct lv_segment *seg,
 			   char *params, uint64_t *total_numerator,
-			   uint64_t *total_denominator,
-			   float *percent __attribute((unused)))
+			   uint64_t *total_denominator)
 {
 	struct mirror_state *mirr_state;
 	uint64_t numerator, denominator;
--- LVM2/lib/snapshot/snapshot.c	2008/04/07 10:23:47	1.30
+++ LVM2/lib/snapshot/snapshot.c	2008/07/15 00:25:52	1.31
@@ -95,20 +95,14 @@
 			   struct cmd_context *cmd __attribute((unused)),
 			   struct lv_segment *seg __attribute((unused)),
 			   char *params, uint64_t *total_numerator,
-			   uint64_t *total_denominator, float *percent)
+			   uint64_t *total_denominator)
 {
-	float percent2;
 	uint64_t numerator, denominator;
 
-	if (strchr(params, '/')) {
-		if (sscanf(params, "%" PRIu64 "/%" PRIu64,
-			   &numerator, &denominator) == 2) {
-			*total_numerator += numerator;
-			*total_denominator += denominator;
-		}
-	} else if (sscanf(params, "%f", &percent2) == 1) {
-		*percent += percent2;
-		*percent /= 2;
+	if (sscanf(params, "%" PRIu64 "/%" PRIu64,
+		   &numerator, &denominator) == 2) {
+		*total_numerator += numerator;
+		*total_denominator += denominator;
 	}
 
 	return 1;


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2008-04-10 17:09 wysochanski
  0 siblings, 0 replies; 25+ messages in thread
From: wysochanski @ 2008-04-10 17:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	wysochanski@sourceware.org	2008-04-10 17:09:32

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/display    : display.c 
	lib/format1    : import-export.c 
	lib/locking    : locking.h 
	lib/metadata   : lv_manip.c metadata-exported.h metadata.c 
	lib/mirror     : mirrored.c 
	lib/report     : report.c 
	tools          : lvchange.c lvcreate.c pvmove.c vgchange.c 
	                 vgsplit.c 

Log message:
	Add vg_is_clustered() helper function.
	
	Should be no functional change.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.841&r2=1.842
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.135&r2=1.136
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.87&r2=1.88
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.95&r2=1.96
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.152&r2=1.153
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata-exported.h.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.167&r2=1.168
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.77&r2=1.78
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.89&r2=1.90
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.173&r2=1.174
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.63&r2=1.64
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61

--- LVM2/WHATS_NEW	2008/04/09 20:56:05	1.841
+++ LVM2/WHATS_NEW	2008/04/10 17:09:29	1.842
@@ -1,5 +1,6 @@
 Version 2.02.34 -
 ===================================
+  Add vg_is_clustered() helper function.
   Fix vgsplit to only move hidden 'snapshotN' LVs when necessary.
   Update vgsplit tests for lvnames on the cmdline.
   Update vgsplit man page to reflect lvnames on the cmdline.
--- LVM2/lib/activate/dev_manager.c	2008/04/07 10:23:46	1.135
+++ LVM2/lib/activate/dev_manager.c	2008/04/10 17:09:30	1.136
@@ -836,7 +836,7 @@
 
 	/* If this is a snapshot origin, add real LV */
 	if (lv_is_origin(seg->lv) && !layer) {
-		if (seg->lv->vg->status & CLUSTERED) {
+		if (vg_is_clustered(seg->lv->vg)) {
 			log_error("Clustered snapshots are not yet supported");
 			return 0;
 		}
--- LVM2/lib/display/display.c	2008/03/26 16:48:10	1.87
+++ LVM2/lib/display/display.c	2008/04/10 17:09:31	1.88
@@ -602,7 +602,7 @@
 	/* vg number not part of LVM2 design
 	   log_print ("VG #                  %u\n", vg->vg_number);
 	 */
-	if (vg->status & CLUSTERED) {
+	if (vg_is_clustered(vg)) {
 		log_print("Clustered             yes");
 		log_print("Shared                %s",
 			  vg->status & SHARED ? "yes" : "no");
--- LVM2/lib/format1/import-export.c	2008/02/06 15:47:27	1.95
+++ LVM2/lib/format1/import-export.c	2008/04/10 17:09:31	1.96
@@ -271,7 +271,7 @@
 	if (vg->status & LVM_WRITE)
 		vgd->vg_access |= VG_WRITE;
 
-	if (vg->status & CLUSTERED)
+	if (vg_is_clustered(vg))
 		vgd->vg_access |= VG_CLUSTERED;
 
 	if (vg->status & SHARED)
--- LVM2/lib/locking/locking.h	2008/04/09 12:56:34	1.38
+++ LVM2/lib/locking/locking.h	2008/04/10 17:09:31	1.39
@@ -99,7 +99,7 @@
 #define LCK_LV_DEACTIVATE	(LCK_LV | LCK_NULL | LCK_NONBLOCK)
 
 #define LCK_LV_CLUSTERED(lv)	\
-	(((lv)->vg->status & CLUSTERED) ? LCK_CLUSTER_VG : 0)
+	(vg_is_clustered((lv)->vg) ? LCK_CLUSTER_VG : 0)
 
 #define lock_lv_vol(cmd, lv, flags)	\
 	lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv))
--- LVM2/lib/metadata/lv_manip.c	2008/03/28 19:08:23	1.152
+++ LVM2/lib/metadata/lv_manip.c	2008/04/10 17:09:31	1.153
@@ -1983,7 +1983,7 @@
 		 * 1) Clustered VG, and some remote nodes have the LV active
 		 * 2) Non-clustered VG, but LV active locally
 		 */
-		if ((vg_status(vg) & CLUSTERED) && !activate_lv_excl(cmd, lv) &&
+		if (vg_is_clustered(vg) && !activate_lv_excl(cmd, lv) &&
 		    (force == PROMPT)) {
 			if (yes_no_prompt("Logical volume \"%s\" is active on other "
 					  "cluster nodes.  Really remove? [y/n]: ",
--- LVM2/lib/metadata/metadata-exported.h	2008/03/26 16:48:10	1.46
+++ LVM2/lib/metadata/metadata-exported.h	2008/04/10 17:09:31	1.47
@@ -544,6 +544,7 @@
 uint32_t pv_pe_alloc_count(const pv_t *pv);
 
 uint32_t vg_status(const vg_t *vg);
+#define vg_is_clustered(vg) (vg_status((vg)) & CLUSTERED)
 
 struct vgcreate_params {
 	char *vg_name;
--- LVM2/lib/metadata/metadata.c	2008/04/08 12:49:20	1.167
+++ LVM2/lib/metadata/metadata.c	2008/04/10 17:09:31	1.168
@@ -1124,7 +1124,7 @@
 	}
 
 	/* Clustering attribute must be the same */
-	if ((vg_to->status & CLUSTERED) != (vg_from->status & CLUSTERED)) {
+	if (vg_is_clustered(vg_to) != vg_is_clustered(vg_from)) {
 		log_error("Clustered attribute differs for \"%s\" and \"%s\"",
 			  vg_to->name, vg_from->name);
 		return 0;
@@ -2102,7 +2102,7 @@
 int vg_check_status(const struct volume_group *vg, uint32_t status)
 {
 	if ((status & CLUSTERED) &&
-	    (vg->status & CLUSTERED) && !locking_is_clustered() &&
+	    (vg_is_clustered(vg)) && !locking_is_clustered() &&
 	    !lockingfailed()) {
 		log_error("Skipping clustered volume group %s", vg->name);
 		return 0;
@@ -2240,7 +2240,6 @@
 	return vg->status;
 }
 
-
 /**
  * pv_by_path - Given a device path return a PV handle if it is a PV
  * @cmd - handle to the LVM command instance
--- LVM2/lib/mirror/mirrored.c	2008/04/07 10:23:46	1.53
+++ LVM2/lib/mirror/mirrored.c	2008/04/10 17:09:31	1.54
@@ -237,7 +237,7 @@
 	 * in clustered VG.
 	 */
 	if ((!(seg->lv->status & ACTIVATE_EXCL) &&
-	      (seg->lv->vg->status & CLUSTERED)))
+	      (vg_is_clustered(seg->lv->vg))))
 		clustered = 1;
 
 	if (seg->log_lv) {
@@ -519,7 +519,7 @@
 	    !list_segment_modules(mem, first_seg(seg->log_lv), modules))
 		return_0;
 
-	if ((seg->lv->vg->status & CLUSTERED) &&
+	if (vg_is_clustered(seg->lv->vg) &&
 	    !str_list_add(mem, modules, "clog")) {
 		log_error("cluster log string list allocation failed");
 		return 0;
--- LVM2/lib/report/report.c	2008/02/06 15:47:28	1.77
+++ LVM2/lib/report/report.c	2008/04/10 17:09:32	1.78
@@ -439,7 +439,7 @@
 
 	repstr[4] = _alloc_policy_char(vg->alloc);
 
-	if (vg->status & CLUSTERED)
+	if (vg_is_clustered(vg))
 		repstr[5] = 'c';
 	else
 		repstr[5] = '-';
--- LVM2/tools/lvchange.c	2008/01/30 14:00:01	1.89
+++ LVM2/tools/lvchange.c	2008/04/10 17:09:32	1.90
@@ -35,7 +35,7 @@
 		return 0;
 	}
 
-	if ((lv->status & MIRRORED) && (lv->vg->status & CLUSTERED) &&
+	if ((lv->status & MIRRORED) && (vg_is_clustered(lv->vg)) &&
 	    lv_info(cmd, lv, &info, 0, 0) && info.exists) {
 		log_error("Cannot change permissions of mirror \"%s\" "
 			  "while active.", lv->name);
@@ -119,7 +119,7 @@
 		if (!deactivate_lv(cmd, lv))
 			return_0;
 	} else {
-		if (lockingfailed() && (lv->vg->status & CLUSTERED)) {
+		if (lockingfailed() && (vg_is_clustered(lv->vg))) {
 			log_verbose("Locking failed: ignoring clustered "
 				    "logical volume %s", lv->name);
 			return 0;
@@ -221,7 +221,7 @@
 		}
 	}
 
-	if ((lv->vg->status & CLUSTERED) && !activate_lv_excl(cmd, lv)) {
+	if (vg_is_clustered(lv->vg) && !activate_lv_excl(cmd, lv)) {
 		log_error("Can't get exclusive access to clustered volume %s",
 			  lv->name);
 		return ECMD_FAILED;
@@ -236,7 +236,7 @@
 
 	log_very_verbose("Starting resync of %s%s%s mirror \"%s\"",
 			 (active) ? "active " : "",
-			 (lv->vg->status & CLUSTERED) ? "clustered " : "",
+			 vg_is_clustered(lv->vg) ? "clustered " : "",
 			 (log_lv) ? "disk-logged" : "core-logged",
 			 lv->name);
 
--- LVM2/tools/lvcreate.c	2008/04/07 10:23:47	1.173
+++ LVM2/tools/lvcreate.c	2008/04/10 17:09:32	1.174
@@ -638,7 +638,7 @@
 			return 0;
 		}
 		/* FIXME Allow exclusive activation. */
-		if (vg_status(vg) & CLUSTERED) {
+		if (vg_is_clustered(vg)) {
 			log_error("Clustered snapshots are not yet supported.");
 			return 0;
 		}
--- LVM2/tools/pvmove.c	2008/04/09 12:56:34	1.52
+++ LVM2/tools/pvmove.c	2008/04/10 17:09:32	1.53
@@ -49,7 +49,7 @@
 static unsigned _pvmove_is_exclusive(struct cmd_context *cmd,
 				     struct volume_group *vg)
 {
-	if (vg_status(vg) & CLUSTERED)
+	if (vg_is_clustered(vg))
 		if (!_pvmove_target_present(cmd, 1))
 			return 1;
 
--- LVM2/tools/vgchange.c	2008/01/30 14:00:02	1.63
+++ LVM2/tools/vgchange.c	2008/04/10 17:09:32	1.64
@@ -134,7 +134,7 @@
 		return ECMD_FAILED;
 	}
 
-	if (activate && lockingfailed() && (vg_status(vg) & CLUSTERED)) {
+	if (activate && lockingfailed() && (vg_is_clustered(vg))) {
 		log_error("Locking inactive: ignoring clustered "
 			  "volume group %s", vg->name);
 		return ECMD_FAILED;
@@ -243,13 +243,13 @@
 	int clustered = !strcmp(arg_str_value(cmd, clustered_ARG, "n"), "y");
 	struct lv_list *lvl;
 
-	if (clustered && (vg_status(vg) & CLUSTERED)) {
+	if (clustered && (vg_is_clustered(vg))) {
 		log_error("Volume group \"%s\" is already clustered",
 			  vg->name);
 		return ECMD_FAILED;
 	}
 
-	if (!clustered && !(vg_status(vg) & CLUSTERED)) {
+	if (!clustered && !(vg_is_clustered(vg))) {
 		log_error("Volume group \"%s\" is already not clustered",
 			  vg->name);
 		return ECMD_FAILED;
--- LVM2/tools/vgsplit.c	2008/04/10 02:15:56	1.60
+++ LVM2/tools/vgsplit.c	2008/04/10 17:09:32	1.61
@@ -379,7 +379,7 @@
 					vp_new.alloc, 0, NULL)))
 			goto bad;
 
-		if (vg_from->status & CLUSTERED)
+		if (vg_is_clustered(vg_from))
 			vg_to->status |= CLUSTERED;
 	}
 


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2008-01-30 13:19 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2008-01-30 13:19 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-01-30 13:19:47

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c fs.c 
	lib/cache      : lvmcache.c 
	lib/commands   : toolcontext.c 
	lib/config     : config.c 
	lib/datastruct : btree.c str_list.c 
	lib/device     : dev-cache.c dev-io.c device.c 
	lib/display    : display.c 
	lib/filters    : filter-composite.c filter-persistent.c 
	                 filter-regex.c filter.c 
	lib/format1    : disk-rep.c format1.c import-export.c 
	                 import-extents.c layout.c lvm1-label.c 
	                 vg_number.c 
	lib/format_pool: disk_rep.c format_pool.c import_export.c 
	lib/format_text: archive.c archiver.c export.c flags.c 
	                 format-text.c import.c import_vsn1.c tags.c 
	lib/label      : label.c 
	lib/locking    : external_locking.c 
	lib/metadata   : lv_manip.c merge.c metadata.c mirror.c 
	                 pv_manip.c pv_map.c snapshot_manip.c 
	lib/mirror     : mirrored.c 
	lib/report     : report.c 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 
	tools          : lvchange.c lvconvert.c lvcreate.c lvmcmdline.c 
	                 lvresize.c pvchange.c pvmove.c pvresize.c 
	                 toollib.c vgmerge.c vgreduce.c 

Log message:
	Use stack return macros throughout.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.782&r2=1.783
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.132&r2=1.133
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.65&r2=1.66
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/btree.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/str_list.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.50&r2=1.51
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-composite.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-regex.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.70&r2=1.71
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-extents.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/layout.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/lvm1-label.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/vg_number.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/flags.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/tags.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/external_locking.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.147&r2=1.148
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.154&r2=1.155
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.87&r2=1.88
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.170&r2=1.171
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.59&r2=1.60
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvresize.c.diff?cvsroot=lvm2&r1=1.90&r2=1.91
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvresize.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.128&r2=1.129
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76

--- LVM2/WHATS_NEW	2008/01/29 23:45:47	1.782
+++ LVM2/WHATS_NEW	2008/01/30 13:19:43	1.783
@@ -1,5 +1,6 @@
 Version 2.02.33 -
 ===================================
+  Use stack return macros throughout.
   Rely upon internally-cached PV labels while corresponding VG lock is held.
 
 Version 2.02.32 - 29th January 2008
--- LVM2/lib/activate/dev_manager.c	2008/01/08 16:47:10	1.132
+++ LVM2/lib/activate/dev_manager.c	2008/01/30 13:19:44	1.133
@@ -100,10 +100,8 @@
 {
 	struct dm_task *dmt;
 
-	if (!(dmt = dm_task_create(task))) {
-		stack;
-		return NULL;
-	}
+	if (!(dmt = dm_task_create(task)))
+		return_NULL;
 
 	if (name)
 		dm_task_set_name(dmt, name);
@@ -127,10 +125,8 @@
 
 	dmtask = mknodes ? DM_DEVICE_MKNODES : DM_DEVICE_INFO;
 
-	if (!(dmt = _setup_task(name, dlid, 0, dmtask))) {
-		stack;
-		return 0;
-	}
+	if (!(dmt = _setup_task(name, dlid, 0, dmtask)))
+		return_0;
 
 	if (!with_open_count)
 		if (!dm_task_no_open_count(dmt))
@@ -259,10 +255,8 @@
 	char *type = NULL;
 	char *params = NULL;
 
-	if (!(dmt = _setup_task(name, uuid, 0, DM_DEVICE_STATUS))) {
-		stack;
-		return 0;
-	}
+	if (!(dmt = _setup_task(name, uuid, 0, DM_DEVICE_STATUS)))
+		return_0;
 
 	if (!dm_task_no_open_count(dmt))
 		log_error("Failed to disable open_count");
@@ -348,10 +342,8 @@
 	*percent = -1;
 
 	if (!(dmt = _setup_task(name, dlid, event_nr,
-				wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS))) {
-		stack;
-		return 0;
-	}
+				wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS)))
+		return_0;
 
 	if (!dm_task_no_open_count(dmt))
 		log_error("Failed to disable open_count");
@@ -443,10 +435,8 @@
 	struct dm_pool *mem;
 	struct dev_manager *dm;
 
-	if (!(mem = dm_pool_create("dev_manager", 16 * 1024))) {
-		stack;
-		return NULL;
-	}
+	if (!(mem = dm_pool_create("dev_manager", 16 * 1024)))
+		return_NULL;
 
 	if (!(dm = dm_pool_alloc(mem, sizeof(*dm))))
 		goto_bad;
@@ -509,10 +499,8 @@
 	 */
 	log_debug("Getting device status percentage for %s", name);
 	if (!(_percent(dm, name, dlid, "snapshot", 0, NULL, percent,
-		       NULL))) {
-		stack;
-		return 0;
-	}
+		       NULL)))
+		return_0;
 
 	/* FIXME dm_pool_free ? */
 
@@ -544,10 +532,8 @@
 
 	log_debug("Getting device mirror status percentage for %s", name);
 	if (!(_percent(dm, name, dlid, "mirror", wait, lv, percent,
-		       event_nr))) {
-		stack;
-		return 0;
-	}
+		       event_nr)))
+		return_0;
 
 	return 1;
 }
@@ -691,31 +677,25 @@
 		return NULL;
 	}
 
-	if (!_add_lv_to_dtree(dm, dtree, lv)) {
-		stack;
-		goto fail;
-	}
+	if (!_add_lv_to_dtree(dm, dtree, lv))
+		goto_bad;
 
 	/* Add any snapshots of this LV */
 	list_iterate_safe(snh, snht, &lv->snapshot_segs)
-		if (!_add_lv_to_dtree(dm, dtree, list_struct_base(snh, struct lv_segment, origin_list)->cow)) {
-			stack;
-			goto fail;
-		}
+		if (!_add_lv_to_dtree(dm, dtree, list_struct_base(snh, struct lv_segment, origin_list)->cow))
+			goto_bad;
 
 	/* Add any LVs used by segments in this LV */
 	list_iterate_items(seg, &lv->segments)
 		for (s = 0; s < seg->area_count; s++)
 			if (seg_type(seg, s) == AREA_LV && seg_lv(seg, s)) {
-				if (!_add_lv_to_dtree(dm, dtree, seg_lv(seg, s))) {
-					stack;
-					goto fail;
-				}
+				if (!_add_lv_to_dtree(dm, dtree, seg_lv(seg, s)))
+					goto_bad;
 			}
 
 	return dtree;
 
-fail:
+bad:
 	dm_tree_free(dtree);
 	return NULL;
 }
--- LVM2/lib/activate/fs.c	2007/08/20 20:55:24	1.40
+++ LVM2/lib/activate/fs.c	2008/01/30 13:19:44	1.41
@@ -175,10 +175,8 @@
 	}
 
 #ifdef HAVE_SELINUX
-        if (!dm_set_selinux_context(lv_path, S_IFLNK)) {
-                stack;
-                return 0;
-        }
+        if (!dm_set_selinux_context(lv_path, S_IFLNK))
+                return_0;
 #endif
 
 	return 1;
@@ -225,17 +223,13 @@
 	switch (type) {
 	case FS_ADD:
 		if (!_mk_dir(dev_dir, vg_name) ||
-		    !_mk_link(dev_dir, vg_name, lv_name, dev)) {
-			stack;
-			return 0;
-		}
+		    !_mk_link(dev_dir, vg_name, lv_name, dev))
+			return_0;
 		break;
 	case FS_DEL:
 		if (!_rm_link(dev_dir, vg_name, lv_name) ||
-		    !_rm_dir(dev_dir, vg_name)) {
-			stack;
-			return 0;
-		}
+		    !_rm_dir(dev_dir, vg_name))
+			return_0;
 		break;
 		/* FIXME Use rename() */
 	case FS_RENAME:
@@ -316,10 +310,8 @@
 {
 	if (memlock()) {
 		if (!_stack_fs_op(type, dev_dir, vg_name, lv_name, dev,
-				  old_lv_name)) {
-			stack;
-			return 0;
-		}
+				  old_lv_name))
+			return_0;
 		return 1;
 	}
 
--- LVM2/lib/cache/lvmcache.c	2008/01/29 23:45:47	1.34
+++ LVM2/lib/cache/lvmcache.c	2008/01/30 13:19:44	1.35
@@ -803,10 +803,8 @@
 
 	if (!(existing = info_from_pvid(pvid_s, 0)) &&
 	    !(existing = info_from_pvid(dev->pvid, 0))) {
-		if (!(label = label_create(labeller))) {
-			stack;
-			return NULL;
-		}
+		if (!(label = label_create(labeller)))
+			return_NULL;
 		if (!(info = dm_malloc(sizeof(*info)))) {
 			log_error("lvmcache_info allocation failed");
 			label_destroy(label);
@@ -862,11 +860,9 @@
 		/* Has labeller changed? */
 		if (info->label->labeller != labeller) {
 			label_destroy(info->label);
-			if (!(info->label = label_create(labeller))) {
+			if (!(info->label = label_create(labeller)))
 				/* FIXME leaves info without label! */
-				stack;
-				return NULL;
-			}
+				return_NULL;
 			info->label->info = info;
 		}
 		label = info->label;
--- LVM2/lib/commands/toolcontext.c	2007/11/09 16:51:53	1.55
+++ LVM2/lib/commands/toolcontext.c	2008/01/30 13:19:44	1.56
@@ -282,10 +282,8 @@
 	if (!cmd->hosttags && find_config_int(cft->root, "tags/hosttags",
 					      DEFAULT_HOSTTAGS)) {
 		/* FIXME Strip out invalid chars: only A-Za-z0-9_+.- */
-		if (!_set_tag(cmd, cmd->hostname)) {
-			stack;
-			return 0;
-		}
+		if (!_set_tag(cmd, cmd->hostname))
+			return_0;
 		cmd->hosttags = 1;
 	}
 
@@ -301,17 +299,13 @@
 		}
 		if (cn->child) {
 			passes = 0;
-			if (!_check_host_filters(cmd, cn->child, &passes)) {
-				stack;
-				return 0;
-			}
+			if (!_check_host_filters(cmd, cn->child, &passes))
+				return_0;
 			if (!passes)
 				continue;
 		}
-		if (!_set_tag(cmd, tag)) {
-			stack;
-			return 0;
-		}
+		if (!_set_tag(cmd, tag))
+			return_0;
 	}
 
 	return 1;
@@ -385,10 +379,8 @@
 		return 1;
 	}
 
-	if (!_load_config_file(cmd, "")) {
-		stack;
-		return 0;
-	}
+	if (!_load_config_file(cmd, ""))
+		return_0;
 
 	return 1;
 }
@@ -400,11 +392,8 @@
 
 	/* Tag list may grow while inside this loop */
 	list_iterate_items(sl, &cmd->tags) {
-		if (!_load_config_file(cmd, sl->str)) {
-			stack;
-			return 0;
-		}
-
+		if (!_load_config_file(cmd, sl->str))
+			return_0;
 	}
 
 	return 1;
@@ -424,10 +413,8 @@
 
 	list_iterate_items(cfl, &cmd->config_files) {
 		/* Merge all config trees into cmd->cft using merge/tag rules */
-		if (!merge_config_tree(cmd, cmd->cft, cfl->cft)) {
-			stack;
-			return 0;
-		}
+		if (!merge_config_tree(cmd, cmd->cft, cfl->cft))
+			return_0;
 	}
 
 	return 1;
@@ -694,10 +681,8 @@
 				return 0;
 			}
 			if (!(lib = load_shared_library(cmd, cv->v.str,
-							"format", 0))) {
-				stack;
-				return 0;
-			}
+							"format", 0)))
+				return_0;
 
 			if (!(init_format_fn = dlsym(lib, "init_format"))) {
 				log_error("Shared library %s does not contain "
@@ -790,10 +775,8 @@
 				return 0;
 			}
 			if (!(lib = load_shared_library(cmd, cv->v.str,
-							"segment type", 0))) {
-				stack;
-				return 0;
-			}
+							"segment type", 0)))
+				return_0;
 
 			if (!(init_segtype_fn = dlsym(lib, "init_segtype"))) {
 				log_error("Shared library %s does not contain "
--- LVM2/lib/config/config.c	2007/08/22 14:38:15	1.65
+++ LVM2/lib/config/config.c	2008/01/30 13:19:44	1.66
@@ -196,10 +196,8 @@
 	off_t mmap_offset = 0;
 	char *buf = NULL;
 
-	if (!(p = dm_pool_alloc(c->mem, sizeof(*p)))) {
-		stack;
-		return 0;
-	}
+	if (!(p = dm_pool_alloc(c->mem, sizeof(*p))))
+		return_0;
 	p->mem = c->mem;
 
 	/* Only use mmap with regular files */
@@ -217,10 +215,8 @@
 		}
 		p->fb = p->fb + mmap_offset;
 	} else {
-		if (!(buf = dm_malloc(size + size2))) {
-			stack;
-			return 0;
-		}
+		if (!(buf = dm_malloc(size + size2)))
+			return_0;
 		if (!dev_read_circular(dev, (uint64_t) offset, size,
 				       (uint64_t) offset2, size2, buf)) {
 			goto out;
@@ -237,10 +233,8 @@
 
 	p->fe = p->fb + size + size2;
 
-	if (!_parse_config_file(p, cft)) {
-		stack;
-		goto out;
-	}
+	if (!_parse_config_file(p, cft))
+		goto_out;
 
 	r = 1;
 
@@ -537,10 +531,8 @@
 {
 	struct config_node *root = NULL, *n, *l = NULL;
 	while (p->t != TOK_EOF) {
-		if (!(n = _section(p))) {
-			stack;
-			return 0;
-		}
+		if (!(n = _section(p)))
+			return_0;
 
 		if (!root)
 			root = n;
@@ -555,25 +547,19 @@
 {
 	/* IDENTIFIER SECTION_B_CHAR VALUE* SECTION_E_CHAR */
 	struct config_node *root, *n, *l = NULL;
-	if (!(root = _create_node(p))) {
-		stack;
-		return 0;
-	}
+	if (!(root = _create_node(p)))
+		return_0;
 
-	if (!(root->key = _dup_tok(p))) {
-		stack;
-		return 0;
-	}
+	if (!(root->key = _dup_tok(p)))
+		return_0;
 
 	match(TOK_IDENTIFIER);
 
 	if (p->t == TOK_SECTION_B) {
 		match(TOK_SECTION_B);
 		while (p->t != TOK_SECTION_E) {
-			if (!(n = _section(p))) {
-				stack;
-				return 0;
-			}
+			if (!(n = _section(p)))
+				return_0;
 
 			if (!root->child)
 				root->child = n;
@@ -584,10 +570,8 @@
 		match(TOK_SECTION_E);
 	} else {
 		match(TOK_EQ);
-		if (!(root->v = _value(p))) {
-			stack;
-			return 0;
-		}
+		if (!(root->v = _value(p)))
+			return_0;
 	}
 
 	return root;
@@ -600,10 +584,8 @@
 	if (p->t == TOK_ARRAY_B) {
 		match(TOK_ARRAY_B);
 		while (p->t != TOK_ARRAY_E) {
-			if (!(l = _type(p))) {
-				stack;
-				return 0;
-			}
+			if (!(l = _type(p)))
+				return_0;
 
 			if (!h)
 				h = l;
@@ -656,10 +638,8 @@
 		v->type = CFG_STRING;
 
 		p->tb++, p->te--;	/* strip "'s */
-		if (!(v->v.str = _dup_tok(p))) {
-			stack;
-			return 0;
-		}
+		if (!(v->v.str = _dup_tok(p)))
+			return_0;
 		p->te++;
 		match(TOK_STRING);
 		break;
@@ -847,10 +827,8 @@
 {
 	size_t len = p->te - p->tb;
 	char *str = dm_pool_alloc(p->mem, len + 1);
-	if (!str) {
-		stack;
-		return 0;
-	}
+	if (!str)
+		return_0;
 	strncpy(str, p->tb, len);
 	str[len] = '\0';
 	return str;
--- LVM2/lib/datastruct/btree.c	2007/08/20 20:55:24	1.11
+++ LVM2/lib/datastruct/btree.c	2008/01/30 13:19:44	1.12
@@ -87,10 +87,8 @@
 	struct node *p, **c = _lookup(&t->root, key, &p), *n;
 
 	if (!*c) {
-		if (!(n = dm_pool_alloc(t->mem, sizeof(*n)))) {
-			stack;
-			return 0;
-		}
+		if (!(n = dm_pool_alloc(t->mem, sizeof(*n))))
+			return_0;
 
 		n->key = key;
 		n->data = data;
--- LVM2/lib/datastruct/str_list.c	2007/09/17 16:02:46	1.9
+++ LVM2/lib/datastruct/str_list.c	2008/01/30 13:19:44	1.10
@@ -20,10 +20,8 @@
 {
 	struct list *sl;
 
-	if (!(sl = dm_pool_alloc(mem, sizeof(struct list)))) {
-		stack;
-		return NULL;
-	}
+	if (!(sl = dm_pool_alloc(mem, sizeof(struct list))))
+		return_NULL;
 
 	list_init(sl);
 
@@ -34,19 +32,15 @@
 {
 	struct str_list *sln;
 
-	if (!str) {
-		stack;
-		return 0;
-	}
+	if (!str)
+		return_0;
 
 	/* Already in list? */
 	if (str_list_match_item(sll, str))
 		return 1;
 
-	if (!(sln = dm_pool_alloc(mem, sizeof(*sln)))) {
-		stack;
-		return 0;
-	}
+	if (!(sln = dm_pool_alloc(mem, sizeof(*sln))))
+		return_0;
 
 	sln->str = str;
 	list_add(sll, &sln->list);
@@ -74,10 +68,8 @@
 	list_init(sllnew);
 
 	list_iterate_items(sl, sllold) {
-		if (!str_list_add(mem, sllnew, dm_pool_strdup(mem, sl->str))) {
-			stack;
-			return 0;
-		}
+		if (!str_list_add(mem, sllnew, dm_pool_strdup(mem, sl->str)))
+			return_0;
 	}
 
 	return 1;
--- LVM2/lib/device/dev-cache.c	2007/08/20 20:55:25	1.50
+++ LVM2/lib/device/dev-cache.c	2008/01/30 13:19:44	1.51
@@ -236,10 +236,8 @@
 	const char *oldpath;
 	int prefer_old = 1;
 
-	if (!sl) {
-		stack;
-		return 0;
-	}
+	if (!sl)
+		return_0;
 
 	/* Is name already there? */
 	list_iterate_items(strl, &dev->aliases) {
@@ -249,10 +247,8 @@
 		}
 	}
 
-	if (!(sl->str = dm_pool_strdup(_cache.mem, path))) {
-		stack;
-		return 0;
-	}
+	if (!(sl->str = dm_pool_strdup(_cache.mem, path)))
+		return_0;
 
 	if (!list_empty(&dev->aliases)) {
 		oldpath = list_item(dev->aliases.n, struct str_list)->str;
@@ -294,14 +290,10 @@
 						   (uint32_t) d))) {
 		/* create new device */
 		if (loopfile) {
-			if (!(dev = dev_create_file(path, NULL, NULL, 0))) {
-				stack;
-				return 0;
-			}
-		} else if (!(dev = _dev_create(d))) {
-			stack;
-			return 0;
-		}
+			if (!(dev = dev_create_file(path, NULL, NULL, 0)))
+				return_0;
+		} else if (!(dev = _dev_create(d)))
+			return_0;
 
 		if (!(btree_insert(_cache.devices, (uint32_t) d, dev))) {
 			log_err("Couldn't insert device into binary tree.");
@@ -369,10 +361,8 @@
 				continue;
 			}
 
-			if (!(path = _join(dir, dirent[n]->d_name))) {
-				stack;
-				return 0;
-			}
+			if (!(path = _join(dir, dirent[n]->d_name)))
+				return_0;
 
 			_collapse_slashes(path);
 			r &= _insert(path, 1);
@@ -400,10 +390,8 @@
 		return 0;
 	}
 
-	if (!_insert_dev(path, 0)) {
-		stack;
-		return 0;
-	}
+	if (!_insert_dev(path, 0))
+		return_0;
 
 	return 1;
 }
@@ -439,10 +427,8 @@
 			return 0;
 		}
 
-		if (!_insert_dev(path, info.st_rdev)) {
-			stack;
-			return 0;
-		}
+		if (!_insert_dev(path, info.st_rdev))
+			return_0;
 
 		r = 1;
 	}
@@ -543,16 +529,13 @@
 	_cache.names = NULL;
 	_cache.has_scanned = 0;
 
-	if (!(_cache.mem = dm_pool_create("dev_cache", 10 * 1024))) {
-		stack;
-		return 0;
-	}
+	if (!(_cache.mem = dm_pool_create("dev_cache", 10 * 1024)))
+		return_0;
 
 	if (!(_cache.names = dm_hash_create(128))) {
-		stack;
 		dm_pool_destroy(_cache.mem);
 		_cache.mem = 0;
-		return 0;
+		return_0;
 	}
 
 	if (!(_cache.devices = btree_create(_cache.mem))) {
--- LVM2/lib/device/dev-io.c	2008/01/29 23:45:47	1.60
+++ LVM2/lib/device/dev-io.c	2008/01/30 13:19:44	1.61
@@ -170,10 +170,8 @@
 	struct device_area widened;
 
 	if (!(where->dev->flags & DEV_REGULAR) &&
-	    !_get_block_size(where->dev, &block_size)) {
-		stack;
-		return 0;
-	}
+	    !_get_block_size(where->dev, &block_size))
+		return_0;
 
 	if (!block_size)
 		block_size = lvm_getpagesize();
@@ -200,10 +198,8 @@
 
 	/* channel the io through the bounce buffer */
 	if (!_io(&widened, bounce, 0)) {
-		if (!should_write) {
-			stack;
-			return 0;
-		}
+		if (!should_write)
+			return_0;
 		/* FIXME pre-extend the file */
 		memset(bounce, '\n', widened.size);
 	}
@@ -354,10 +350,8 @@
 
 	if (dev->flags & DEV_REGULAR)
 		name = dev_name(dev);
-	else if (!(name = dev_name_confirmed(dev, quiet))) {
-		stack;
-		return 0;
-	}
+	else if (!(name = dev_name_confirmed(dev, quiet)))
+		return_0;
 
 	if (!(dev->flags & DEV_REGULAR)) {
 		if (stat(name, &buf) < 0) {
@@ -557,10 +551,8 @@
 {
 	struct device_area where;
 
-	if (!dev->open_count) {
-		stack;
-		return 0;
-	}
+	if (!dev->open_count)
+		return_0;
 
 	where.dev = dev;
 	where.start = offset;
@@ -607,10 +599,8 @@
 {
 	int r;
 
-	if (!dev->open_count) {
-		stack;
-		return 0;
-	}
+	if (!dev->open_count)
+		return_0;
 
 	r = dev_write(dev, dev->end, len, buffer);
 	dev->end += (uint64_t) len;
@@ -625,10 +615,8 @@
 {
 	struct device_area where;
 
-	if (!dev->open_count) {
-		stack;
-		return 0;
-	}
+	if (!dev->open_count)
+		return_0;
 
 	where.dev = dev;
 	where.start = offset;
@@ -644,10 +632,8 @@
 	size_t s;
 	char buffer[4096] __attribute((aligned(8)));
 
-	if (!dev_open(dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(dev))
+		return_0;
 
 	if ((offset % SECTOR_SIZE) || (len % SECTOR_SIZE))
 		log_debug("Wiping %s at %" PRIu64 " length %" PRIsize_t,
--- LVM2/lib/device/device.c	2007/08/20 20:55:25	1.24
+++ LVM2/lib/device/device.c	2008/01/30 13:19:44	1.25
@@ -62,10 +62,8 @@
 		return -1;
 	}
 
-	if (!dev_read(dev, UINT64_C(0), sizeof(buf), &buf)) {
-		stack;
-		goto out;
-	}
+	if (!dev_read(dev, UINT64_C(0), sizeof(buf), &buf))
+		goto_out;
 
 	/* FIXME Check for other types of partition table too */
 
--- LVM2/lib/display/display.c	2007/11/12 20:51:53	1.83
+++ LVM2/lib/display/display.c	2008/01/30 13:19:44	1.84
@@ -360,10 +360,8 @@
 	if (!pv)
 		return 0;
 
-	if (!id_write_format(&pv->id, uuid, sizeof(uuid))) {
-		stack;
-		return 0;
-	}
+	if (!id_write_format(&pv->id, uuid, sizeof(uuid)))
+		return_0;
 
 	log_print("PV Name               %s     ", pv_dev_name(pv));
 	/* FIXME  pv->pv_number); */
@@ -407,10 +405,8 @@
 	struct lv_segment *snap_seg = NULL;
 	float snap_percent;	/* fused, fsize; */
 
-	if (!id_write_format(&lv->lvid.id[1], uuid, sizeof(uuid))) {
-		stack;
-		return 0;
-	}
+	if (!id_write_format(&lv->lvid.id[1], uuid, sizeof(uuid)))
+		return_0;
 
 	inkernel = lv_info(cmd, lv, &info, 1, 1) && info.exists;
 
--- LVM2/lib/filters/filter-composite.c	2007/08/20 20:55:25	1.13
+++ LVM2/lib/filters/filter-composite.c	2008/01/30 13:19:45	1.14
@@ -50,10 +50,8 @@
 {
 	struct dev_filter **filters_copy, *cft;
 
-	if (!filters) {
-		stack;
-		return NULL;
-	}
+	if (!filters)
+		return_NULL;
 
 	if (!(filters_copy = dm_malloc(sizeof(*filters) * (n + 1)))) {
 		log_error("composite filters allocation failed");
--- LVM2/lib/filters/filter-persistent.c	2007/08/20 20:55:25	1.33
+++ LVM2/lib/filters/filter-persistent.c	2008/01/30 13:19:45	1.34
@@ -42,10 +42,8 @@
 	if (pf->devices)
 		dm_hash_destroy(pf->devices);
 
-	if (!(pf->devices = dm_hash_create(128))) {
-		stack;
-		return 0;
-	}
+	if (!(pf->devices = dm_hash_create(128)))
+		return_0;
 
 	return 1;
 }
@@ -293,10 +291,8 @@
 	struct pfilter *pf;
 	struct dev_filter *f = NULL;
 
-	if (!(pf = dm_malloc(sizeof(*pf)))) {
-		stack;
-		return NULL;
-	}
+	if (!(pf = dm_malloc(sizeof(*pf))))
+		return_NULL;
 	memset(pf, 0, sizeof(*pf));
 
 	if (!(pf->file = dm_malloc(strlen(file) + 1)))
--- LVM2/lib/filters/filter-regex.c	2007/08/20 20:55:25	1.23
+++ LVM2/lib/filters/filter-regex.c	2008/01/30 13:19:45	1.24
@@ -70,10 +70,8 @@
 	/*
 	 * copy the regex
 	 */
-	if (!(r = dm_pool_strdup(mem, pat))) {
-		stack;
-		return 0;
-	}
+	if (!(r = dm_pool_strdup(mem, pat)))
+		return_0;
 
 	/*
 	 * trim the trailing character, having checked it's sep.
@@ -192,10 +190,8 @@
 	struct rfilter *rf;
 	struct dev_filter *f;
 
-	if (!mem) {
-		stack;
-		return NULL;
-	}
+	if (!mem)
+		return_NULL;
 
 	if (!(rf = dm_pool_alloc(mem, sizeof(*rf))))
 		goto_bad;
--- LVM2/lib/filters/filter.c	2007/08/22 14:38:16	1.43
+++ LVM2/lib/filters/filter.c	2008/01/30 13:19:45	1.44
@@ -277,9 +277,8 @@
 	f->private = NULL;
 
 	if (!_scan_proc_dev(proc, cn)) {
-		stack;
 		dm_free(f);
-		return NULL;
+		return_NULL;
 	}
 
 	return f;
--- LVM2/lib/format1/disk-rep.c	2007/11/02 20:40:04	1.70
+++ LVM2/lib/format1/disk-rep.c	2008/01/30 13:19:45	1.71
@@ -21,7 +21,6 @@
 
 #include <fcntl.h>
 
-#define fail do {stack; return 0;} while(0)
 #define xx16(v) disk->v = xlate16(disk->v)
 #define xx32(v) disk->v = xlate32(disk->v)
 #define xx64(v) disk->v = xlate64(disk->v)
@@ -218,7 +217,7 @@
 static int _read_lvd(struct device *dev, uint64_t pos, struct lv_disk *disk)
 {
 	if (!dev_read(dev, pos, sizeof(*disk), disk))
-		fail;
+		return_0;
 
 	_xlate_lvd(disk);
 
@@ -230,12 +229,12 @@
 	uint64_t pos = pvd->vg_on_disk.base;
 
 	if (!dev_read(dev, pos, sizeof(*vgd), vgd))
-		fail;
+		return_0;
 
 	_xlate_vgd(vgd);
 
 	if ((vgd->lv_max > MAX_LV) || (vgd->pv_max > MAX_PV))
-		fail;
+		return_0;
 		
 	/* If UUID is missing, create one */
 	if (vgd->vg_uuid[0] == '\0')
@@ -254,10 +253,10 @@
 
 	while (pos < end && num_read < data->vgd.pv_cur) {
 		if (!dev_read(data->dev, pos, sizeof(buffer), buffer))
-			fail;
+			return_0;
 
 		if (!(ul = dm_pool_alloc(data->mem, sizeof(*ul))))
-			fail;
+			return_0;
 
 		memcpy(ul->uuid, buffer, NAME_LEN);
 		ul->uuid[NAME_LEN - 1] = '\0';
@@ -288,10 +287,10 @@
 		ll = dm_pool_alloc(data->mem, sizeof(*ll));
 
 		if (!ll)
-			fail;
+			return_0;
 
 		if (!_read_lvd(data->dev, pos, &ll->lvd))
-			fail;
+			return_0;
 
 		if (!_check_lvd(&ll->lvd))
 			continue;
@@ -310,10 +309,10 @@
 	uint64_t pos = data->pvd.pe_on_disk.base;
 
 	if (!extents)
-		fail;
+		return_0;
 
 	if (!dev_read(data->dev, pos, len, extents))
-		fail;
+		return_0;
 
 	_xlate_extents(extents, data->pvd.pe_total);
 	data->extents = extents;
@@ -347,10 +346,8 @@
 	struct disk_list *dl = dm_pool_zalloc(mem, sizeof(*dl));
 	const char *name = dev_name(dev);
 
-	if (!dl) {
-		stack;
-		return NULL;
-	}
+	if (!dl)
+		return_NULL;
 
 	dl->dev = dev;
 	dl->mem = mem;
@@ -417,10 +414,8 @@
 {
 	struct disk_list *dl;
 
-	if (!dev_open(dev)) {
-		stack;
-		return NULL;
-	}
+	if (!dev_open(dev))
+		return_NULL;
 
 	dl = __read_disk(fmt, dev, mem, vg_name);
 
@@ -519,7 +514,7 @@
 
 	_xlate_vgd(vgd);
 	if (!dev_write(data->dev, pos, sizeof(*vgd), vgd))
-		fail;
+		return_0;
 
 	_xlate_vgd(vgd);
 
@@ -544,7 +539,7 @@
 			  pos, NAME_LEN);
 
 		if (!dev_write(data->dev, pos, NAME_LEN, ul->uuid))
-			fail;
+			return_0;
 
 		pos += NAME_LEN;
 	}
@@ -560,7 +555,7 @@
 
 	_xlate_lvd(disk);
 	if (!dev_write(dev, pos, sizeof(*disk), disk))
-		fail;
+		return_0;
 
 	_xlate_lvd(disk);
 
@@ -588,7 +583,7 @@
 		}
 
 		if (!_write_lvd(data->dev, pos + offset, &ll->lvd))
-			fail;
+			return_0;
 	}
 
 	return 1;
@@ -606,7 +601,7 @@
 
 	_xlate_extents(extents, data->pvd.pe_total);
 	if (!dev_write(data->dev, pos, len, extents))
-		fail;
+		return_0;
 
 	_xlate_extents(extents, data->pvd.pe_total);
 
@@ -643,7 +638,7 @@
 	_xlate_pvd((struct pv_disk *) buf);
 	if (!dev_write(data->dev, pos, size, buf)) {
 		dm_free(buf);
-		fail;
+		return_0;
 	}
 
 	dm_free(buf);
@@ -707,10 +702,8 @@
 {
 	int r;
 
-	if (!dev_open(data->dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(data->dev))
+		return_0;
 
 	r = __write_all_pvd(fmt, data);
 
@@ -731,7 +724,7 @@
 
 	list_iterate_items(dl, pvs) {
 		if (!(_write_all_pvd(fmt, dl)))
-			fail;
+			return_0;
 
 		log_very_verbose("Successfully wrote data to %s",
 				 dev_name(dl->dev));
--- LVM2/lib/format1/format1.c	2007/11/09 16:51:53	1.103
+++ LVM2/lib/format1/format1.c	2008/01/30 13:19:45	1.104
@@ -168,7 +168,6 @@
 	return vg;
 
       bad:
-	stack;
 	dm_pool_free(mem, vg);
 	return NULL;
 }
@@ -182,10 +181,8 @@
 	struct volume_group *vg = NULL;
 	list_init(&pvs);
 
-	if (!mem) {
-		stack;
-		return NULL;
-	}
+	if (!mem)
+		return_NULL;
 
 	/* Strip dev_dir if present */
 	vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
@@ -209,10 +206,8 @@
 {
 	struct disk_list *dl = dm_pool_alloc(mem, sizeof(*dl));
 
-	if (!dl) {
-		stack;
-		return NULL;
-	}
+	if (!dl)
+		return_NULL;
 
 	dl->mem = mem;
 	dl->dev = pv->dev;
@@ -224,9 +219,8 @@
 	    !export_vg(&dl->vgd, vg) ||
 	    !export_uuids(dl, vg) ||
 	    !export_lvs(dl, vg, pv, dev_dir) || !calculate_layout(dl)) {
-		stack;
 		dm_pool_free(mem, dl);
-		return NULL;
+		return_NULL;
 	}
 
 	return dl;
@@ -241,10 +235,8 @@
 	struct disk_list *data;
 
 	list_iterate_items(pvl, &vg->pvs) {
-		if (!(data = _flatten_pv(fid, mem, vg, pvl->pv, dev_dir))) {
-			stack;
-			return 0;
-		}
+		if (!(data = _flatten_pv(fid, mem, vg, pvl->pv, dev_dir)))
+			return_0;
 
 		list_add(pvds, &data->list);
 	}
@@ -252,10 +244,8 @@
 	export_numbers(pvds, vg);
 	export_pv_act(pvds);
 
-	if (!export_vg_number(fid, pvds, vg->name, filter)) {
-		stack;
-		return 0;
-	}
+	if (!export_vg_number(fid, pvds, vg->name, filter))
+		return_0;
 
 	return 1;
 }
@@ -267,10 +257,8 @@
 	struct list pvds;
 	int r = 0;
 
-	if (!mem) {
-		stack;
-		return 0;
-	}
+	if (!mem)
+		return_0;
 
 	list_init(&pvds);
 
@@ -293,25 +281,17 @@
 
 	log_very_verbose("Reading physical volume data %s from disk", pv_name);
 
-	if (!mem) {
-		stack;
-		return 0;
-	}
+	if (!mem)
+		return_0;
 
-	if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter))) {
-		stack;
-		goto out;
-	}
+	if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter)))
+		goto_out;
 
-	if (!(dl = read_disk(fmt, dev, mem, NULL))) {
-		stack;
-		goto out;
-	}
+	if (!(dl = read_disk(fmt, dev, mem, NULL)))
+		goto_out;
 
-	if (!import_pv(fmt, fmt->cmd->mem, dl->dev, NULL, pv, &dl->pvd, &dl->vgd)) {
-		stack;
-		goto out;
-	}
+	if (!import_pv(fmt, fmt->cmd->mem, dl->dev, NULL, pv, &dl->pvd, &dl->vgd))
+		goto_out;
 
 	pv->fmt = fmt;
 
@@ -344,10 +324,8 @@
 	/*
 	 * This works out pe_start and pe_count.
 	 */
-	if (!calculate_extent_count(pv, extent_size, extent_count, pe_start)) {
-		stack;
-		return 0;
-	}
+	if (!calculate_extent_count(pv, extent_size, extent_count, pe_start))
+		return_0;
 
 	/* Retain existing extent locations exactly */
 	if (((pe_start || extent_count) && (pe_start != pv->pe_start)) ||
@@ -390,10 +368,8 @@
 	struct lvmcache_info *info;
 
 	if (!(info = lvmcache_add(fmt->labeller, (char *) &pv->id, pv->dev,
-				  pv->vg_name, NULL, 0))) {
-		stack;
-		return 0;
-	}
+				  pv->vg_name, NULL, 0)))
+		return_0;
 	label = info->label;
 	info->device_size = pv->size << SECTOR_SHIFT;
 	info->fmt = fmt;
@@ -406,10 +382,8 @@
 	pv->pe_size = pv->pe_count = 0;
 	pv->pe_start = LVM1_PE_ALIGN;
 
-	if (!(mem = dm_pool_create("lvm1 pv_write", 1024))) {
-		stack;
-		return 0;
-	}
+	if (!(mem = dm_pool_create("lvm1 pv_write", 1024)))
+		return_0;
 
 	if (!(dl = dm_pool_alloc(mem, sizeof(*dl))))
 		goto_bad;
@@ -473,10 +447,8 @@
 static int _format1_segtype_supported(struct format_instance *fid __attribute((unused)), 
 				      const struct segment_type *segtype)
 {
-	if (!(segtype->flags & SEG_FORMAT1_SUPPORT)) {
-		stack;
-		return 0;
-	}
+	if (!(segtype->flags & SEG_FORMAT1_SUPPORT))
+		return_0;
 
 	return 1;
 }
@@ -494,19 +466,16 @@
 	struct format_instance *fid;
 	struct metadata_area *mda;
 
-	if (!(fid = dm_pool_alloc(fmt->cmd->mem, sizeof(*fid)))) {
-		stack;
-		return NULL;
-	}
+	if (!(fid = dm_pool_alloc(fmt->cmd->mem, sizeof(*fid))))
+		return_NULL;
 
 	fid->fmt = fmt;
 	list_init(&fid->metadata_areas);
 
 	/* Define a NULL metadata area */
 	if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda)))) {
-		stack;
 		dm_pool_free(fmt->cmd->mem, fid);
-		return NULL;
+		return_NULL;
 	}
 
 	mda->ops = &_metadata_format1_ops;
@@ -547,10 +516,8 @@
 {
 	struct format_type *fmt = dm_malloc(sizeof(*fmt));
 
-	if (!fmt) {
-		stack;
-		return NULL;
-	}
+	if (!fmt)
+		return_NULL;
 
 	fmt->cmd = cmd;
 	fmt->ops = &_format1_ops;
--- LVM2/lib/format1/import-export.c	2008/01/16 19:00:59	1.92
+++ LVM2/lib/format1/import-export.c	2008/01/30 13:19:45	1.93
@@ -117,10 +117,8 @@
 	list_init(&pv->tags);
 	list_init(&pv->segments);
 
-	if (!alloc_pv_segment_whole_pv(mem, pv)) {
-		stack;
-		return 0;
-	}
+	if (!alloc_pv_segment_whole_pv(mem, pv))
+		return_0;
 
 	return 1;
 }
@@ -150,10 +148,8 @@
 	memcpy(pvd->pv_uuid, pv->id.uuid, ID_LEN);
 
 	if (pv->vg_name) {
-		if (!_check_vg_name(pv->vg_name)) {
-			stack;
-			return 0;
-		}
+		if (!_check_vg_name(pv->vg_name))
+			return_0;
 		strncpy((char *)pvd->vg_name, pv->vg_name, sizeof(pvd->vg_name));
 	}
 
@@ -167,10 +163,8 @@
 		if (!*vg->system_id ||
 		    strncmp(vg->system_id, EXPORTED_TAG,
 			    sizeof(EXPORTED_TAG) - 1)) {
-			if (!_system_id(cmd, (char *)pvd->system_id, EXPORTED_TAG)) {
-				stack;
-				return 0;
-			}
+			if (!_system_id(cmd, (char *)pvd->system_id, EXPORTED_TAG))
+				return_0;
 		}
 		if (strlen((char *)pvd->vg_name) + sizeof(EXPORTED_TAG) >
 		    sizeof(pvd->vg_name)) {
@@ -184,18 +178,14 @@
 	/* Is VG being imported? */
 	if (vg && !(vg->status & EXPORTED_VG) && *vg->system_id &&
 	    !strncmp(vg->system_id, EXPORTED_TAG, sizeof(EXPORTED_TAG) - 1)) {
-		if (!_system_id(cmd, (char *)pvd->system_id, IMPORTED_TAG)) {
-			stack;
-			return 0;
-		}
+		if (!_system_id(cmd, (char *)pvd->system_id, IMPORTED_TAG))
+			return_0;
 	}
 
 	/* Generate system_id if PV is in VG */
 	if (!pvd->system_id || !*pvd->system_id)
-		if (!_system_id(cmd, (char *)pvd->system_id, "")) {
-			stack;
-			return 0;
-		}
+		if (!_system_id(cmd, (char *)pvd->system_id, ""))
+			return_0;
 
 	/* Update internal system_id if we changed it */
 	if (vg &&
@@ -227,20 +217,14 @@
 	struct vg_disk *vgd = &dl->vgd;
 	memcpy(vg->id.uuid, vgd->vg_uuid, ID_LEN);
 
-	if (!_check_vg_name((char *)dl->pvd.vg_name)) {
-		stack;
-		return 0;
-	}
+	if (!_check_vg_name((char *)dl->pvd.vg_name))
+		return_0;
 
-	if (!(vg->name = dm_pool_strdup(mem, (char *)dl->pvd.vg_name))) {
-		stack;
-		return 0;
-	}
+	if (!(vg->name = dm_pool_strdup(mem, (char *)dl->pvd.vg_name)))
+		return_0;
 
-	if (!(vg->system_id = dm_pool_alloc(mem, NAME_LEN))) {
-		stack;
-		return 0;
-	}
+	if (!(vg->system_id = dm_pool_alloc(mem, NAME_LEN)))
+		return_0;
 
 	*vg->system_id = '\0';
 
@@ -315,10 +299,8 @@
 {
 	lvid_from_lvnum(&lv->lvid, &lv->vg->id, lvd->lv_number);
 
-	if (!(lv->name = _create_lv_name(mem, (char *)lvd->lv_name))) {
-		stack;
-		return 0;
-	}
+	if (!(lv->name = _create_lv_name(mem, (char *)lvd->lv_name)))
+		return_0;
 
 	lv->status |= VISIBLE_LV;
 
@@ -457,15 +439,11 @@
 	*count = 0;
 	list_iterate_items(dl, pvds) {
 		if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl))) ||
-		    !(pvl->pv = dm_pool_alloc(mem, sizeof(*pvl->pv)))) {
-			stack;
-			return 0;
-		}
+		    !(pvl->pv = dm_pool_alloc(mem, sizeof(*pvl->pv))))
+			return_0;
 
-		if (!import_pv(fmt, mem, dl->dev, vg, pvl->pv, &dl->pvd, &dl->vgd)) {
-			stack;
-			return 0;
-		}
+		if (!import_pv(fmt, mem, dl->dev, vg, pvl->pv, &dl->pvd, &dl->vgd))
+			return_0;
 
 		pvl->pv->fmt = fmt;
 		list_add(results, &pvl->list);
@@ -483,17 +461,13 @@
 	struct logical_volume *lv;
 
 	if (!(ll = dm_pool_zalloc(mem, sizeof(*ll))) ||
-	    !(ll->lv = dm_pool_zalloc(mem, sizeof(*ll->lv)))) {
-		stack;
-		return NULL;
-	}
+	    !(ll->lv = dm_pool_zalloc(mem, sizeof(*ll->lv))))
+		return_NULL;
 	lv = ll->lv;
 	lv->vg = vg;
 
-	if (!import_lv(mem, lv, lvd)) {
-		stack;
-		return NULL;
-	}
+	if (!import_lv(mem, lv, lvd))
+		return_NULL;
 
 	list_add(&vg->lvs, &ll->list);
 	vg->lv_count++;
@@ -512,10 +486,8 @@
 			lvd = &ll->lvd;
 
 			if (!find_lv(vg, (char *)lvd->lv_name) &&
-			    !_add_lv(mem, vg, lvd)) {
-				stack;
-				return 0;
-			}
+			    !_add_lv(mem, vg, lvd))
+				return_0;
 		}
 	}
 
@@ -533,49 +505,37 @@
 	uint32_t lv_num;
 	struct dm_hash_table *lvd_hash;
 
-	if (!_check_vg_name(vg->name)) {
-		stack;
-		return 0;
-	}
+	if (!_check_vg_name(vg->name))
+		return_0;
 
-	if (!(lvd_hash = dm_hash_create(32))) {
-		stack;
-		return 0;
-	}
+	if (!(lvd_hash = dm_hash_create(32)))
+		return_0;
 
 	/*
 	 * setup the pv's extents array
 	 */
 	len = sizeof(struct pe_disk) * dl->pvd.pe_total;
-	if (!(dl->extents = dm_pool_alloc(dl->mem, len))) {
-		stack;
-		goto out;
-	}
+	if (!(dl->extents = dm_pool_alloc(dl->mem, len)))
+		goto_out;
 	memset(dl->extents, 0, len);
 
 	list_iterate_items(ll, &vg->lvs) {
 		if (ll->lv->status & SNAPSHOT)
 			continue;
 
-		if (!(lvdl = dm_pool_alloc(dl->mem, sizeof(*lvdl)))) {
-			stack;
-			goto out;
-		}
+		if (!(lvdl = dm_pool_alloc(dl->mem, sizeof(*lvdl))))
+			goto_out;
 
 		_export_lv(&lvdl->lvd, vg, ll->lv, dev_dir);
 
 		lv_num = lvnum_from_lvid(&ll->lv->lvid);
 		lvdl->lvd.lv_number = lv_num;
 
-		if (!dm_hash_insert(lvd_hash, ll->lv->name, &lvdl->lvd)) {
-			stack;
-			goto out;
-		}
+		if (!dm_hash_insert(lvd_hash, ll->lv->name, &lvdl->lvd))
+			goto_out;
 
-		if (!export_extents(dl, lv_num + 1, ll->lv, pv)) {
-			stack;
-			goto out;
-		}
+		if (!export_extents(dl, lv_num + 1, ll->lv, pv))
+			goto_out;
 
 		if (lv_is_origin(ll->lv))
 			lvdl->lvd.lv_access |= LV_SNAPSHOT_ORG;
@@ -675,10 +635,8 @@
 	struct pv_list *pvl;
 
 	list_iterate_items(pvl, &vg->pvs) {
-		if (!(ul = dm_pool_alloc(dl->mem, sizeof(*ul)))) {
-			stack;
-			return 0;
-		}
+		if (!(ul = dm_pool_alloc(dl->mem, sizeof(*ul))))
+			return_0;
 
 		memset(ul->uuid, 0, sizeof(ul->uuid));
 		memcpy(ul->uuid, pvl->pv->id.uuid, ID_LEN);
@@ -723,10 +681,8 @@
 	struct disk_list *dl;
 	int vg_num;
 
-	if (!get_free_vg_number(fid, filter, vg_name, &vg_num)) {
-		stack;
-		return 0;
-	}
+	if (!get_free_vg_number(fid, filter, vg_name, &vg_num))
+		return_0;
 
 	list_iterate_items(dl, pvds)
 		dl->vgd.vg_number = vg_num;
--- LVM2/lib/format1/import-extents.c	2007/08/20 20:55:25	1.34
+++ LVM2/lib/format1/import-extents.c	2008/01/30 13:19:45	1.35
@@ -118,10 +118,8 @@
 		e = dl->extents;
 
 		/* build an array of lv's for this pv */
-		if (!_fill_lv_array(lvms, maps, dl)) {
-			stack;
-			return 0;
-		}
+		if (!_fill_lv_array(lvms, maps, dl))
+			return_0;
 
 		for (i = 0; i < dl->pvd.pe_total; i++) {
 			lv_num = e[i].lv_num;
@@ -189,10 +187,8 @@
 	for (n = dm_hash_get_first(maps); n; n = dm_hash_get_next(maps, n)) {
 		lvm = (struct lv_map *) dm_hash_get_data(maps, n);
 
-		if (!_check_single_map(lvm)) {
-			stack;
-			return 0;
-		}
+		if (!_check_single_map(lvm))
+			return_0;
 	}
 	return 1;
 }
@@ -216,10 +212,8 @@
 	struct lv_segment *seg;
 	struct segment_type *segtype;
 
-	if (!(segtype = get_segtype_from_string(cmd, "striped"))) {
-		stack;
-		return 0;
-	}
+	if (!(segtype = get_segtype_from_string(cmd, "striped")))
+		return_0;
 
 	while (le < lvm->lv->le_count) {
 		len = _area_length(lvm, le);
@@ -334,10 +328,8 @@
 
 	for (n = dm_hash_get_first(maps); n; n = dm_hash_get_next(maps, n)) {
 		lvm = (struct lv_map *) dm_hash_get_data(maps, n);
-		if (!_build_segments(cmd, lvm)) {
-			stack;
-			return 0;
-		}
+		if (!_build_segments(cmd, lvm))
+			return_0;
 	}
 
 	return 1;
@@ -350,10 +342,8 @@
 	struct dm_pool *scratch = dm_pool_create("lvm1 import_extents", 10 * 1024);
 	struct dm_hash_table *maps;
 
-	if (!scratch) {
-		stack;
-		return 0;
-	}
+	if (!scratch)
+		return_0;
 
 	if (!(maps = _create_lv_maps(scratch, vg))) {
 		log_err("Couldn't allocate logical volume maps.");
@@ -365,10 +355,8 @@
 		goto out;
 	}
 
-	if (!_check_maps_are_complete(maps) && !(vg->status & PARTIAL_VG)) {
-		stack;
-		goto out;
-	}
+	if (!_check_maps_are_complete(maps) && !(vg->status & PARTIAL_VG))
+		goto_out;
 
 	if (!_build_all_segments(cmd, maps)) {
 		log_err("Couldn't build extent segments.");
--- LVM2/lib/format1/layout.c	2007/10/12 14:29:31	1.27
+++ LVM2/lib/format1/layout.c	2008/01/30 13:19:45	1.28
@@ -122,10 +122,8 @@
 	struct pv_disk *pvd = dm_malloc(sizeof(*pvd));
 	uint32_t end;
 
-	if (!pvd) {
-		stack;
-		return 0;
-	}
+	if (!pvd)
+		return_0;
 
 	/*
 	 * Guess how many extents will fit, bearing in mind that
--- LVM2/lib/format1/lvm1-label.c	2007/08/22 14:38:16	1.16
+++ LVM2/lib/format1/lvm1-label.c	2008/01/30 13:19:45	1.17
@@ -71,10 +71,8 @@
 	}
 
 	if (!(info = lvmcache_add(l, (char *)pvd->pv_uuid, dev, (char *)pvd->vg_name, vgid,
-				  exported))) {
-		stack;
-		return 0;
-	}
+				  exported)))
+		return_0;
 	*label = info->label;
 
 	info->device_size = xlate32(pvd->pv_size) << SECTOR_SHIFT;
--- LVM2/lib/format1/vg_number.c	2007/08/20 20:55:25	1.13
+++ LVM2/lib/format1/vg_number.c	2008/01/30 13:19:45	1.14
@@ -33,15 +33,11 @@
 
 	list_init(&all_pvs);
 
-	if (!mem) {
-		stack;
-		return 0;
-	}
+	if (!mem)
+		return_0;
 
-	if (!read_pvs_in_vg(fid->fmt, NULL, filter, mem, &all_pvs)) {
-		stack;
-		goto out;
-	}
+	if (!read_pvs_in_vg(fid->fmt, NULL, filter, mem, &all_pvs))
+		goto_out;
 
 	memset(numbers, 0, sizeof(numbers));
 
--- LVM2/lib/format_pool/disk_rep.c	2007/08/22 14:38:16	1.11
+++ LVM2/lib/format_pool/disk_rep.c	2008/01/30 13:19:45	1.12
@@ -45,10 +45,8 @@
 		return 0;
 	}
 
-	if (!read_pool_label(pl, fmt->labeller, dev, buf, NULL)) {
-		stack;
-		return 0;
-	}
+	if (!read_pool_label(pl, fmt->labeller, dev, buf, NULL))
+		return_0;
 
 	return 1;
 }
@@ -98,10 +96,8 @@
 	log_debug("Calculated uuid %s for %s", uuid, pd->pl_pool_name);
 
 	if (!(info = lvmcache_add(l, (char *) &pvid, dev, pd->pl_pool_name,
-				  (char *) &vgid, 0))) {
-		stack;
-		return 0;
-	}
+				  (char *) &vgid, 0)))
+		return_0;
 	if (label)
 		*label = info->label;
 
@@ -252,10 +248,8 @@
 
 	/* FIXME: maybe should return a different error in memory
 	 * allocation failure */
-	if (!(tmpmem = dm_pool_create("pool read_vg", 512))) {
-		stack;
-		return 0;
-	}
+	if (!(tmpmem = dm_pool_create("pool read_vg", 512)))
+		return_0;
 
 	list_iterate_items(info, &vginfo->infos) {
 		if (info->dev &&
@@ -354,20 +348,16 @@
 {
 	struct pool_list *pl;
 
-	if (!dev_open(dev)) {
-		stack;
-		return NULL;
-	}
+	if (!dev_open(dev))
+		return_NULL;
 
 	if (!(pl = dm_pool_zalloc(mem, sizeof(*pl)))) {
 		log_error("Unable to allocate pool list structure");
 		return 0;
 	}
 
-	if (!__read_pool_disk(fmt, dev, mem, pl, vg_name)) {
-		stack;
-		return NULL;
-	}
+	if (!__read_pool_disk(fmt, dev, mem, pl, vg_name))
+		return_NULL;
 
 	if (!dev_close(dev))
 		stack;
--- LVM2/lib/format_pool/format_pool.c	2007/08/22 14:38:16	1.11
+++ LVM2/lib/format_pool/format_pool.c	2008/01/30 13:19:45	1.12
@@ -128,44 +128,32 @@
 	list_init(&vg->lvs);
 	list_init(&vg->tags);
 
-	if (!import_pool_vg(vg, smem, pds)) {
-		stack;
-		return NULL;
-	}
+	if (!import_pool_vg(vg, smem, pds))
+		return_NULL;
 
-	if (!import_pool_pvs(fid->fmt, vg, &vg->pvs, smem, pds)) {
-		stack;
-		return NULL;
-	}
+	if (!import_pool_pvs(fid->fmt, vg, &vg->pvs, smem, pds))
+		return_NULL;
 
-	if (!import_pool_lvs(vg, smem, pds)) {
-		stack;
-		return NULL;
-	}
+	if (!import_pool_lvs(vg, smem, pds))
+		return_NULL;
 
 	/*
 	 * I need an intermediate subpool structure that contains all the
 	 * relevant info for this.  Then i can iterate through the subpool
 	 * structures for checking, and create the segments
 	 */
-	if (!(usp = _build_usp(pds, mem, &sp_count))) {
-		stack;
-		return NULL;
-	}
+	if (!(usp = _build_usp(pds, mem, &sp_count)))
+		return_NULL;
 
 	/*
 	 * check the subpool structures - we can't handle partial VGs in
 	 * the pool format, so this will error out if we're missing PVs
 	 */
-	if (!_check_usp(vg->name, usp, sp_count)) {
-		stack;
-		return NULL;
-	}
+	if (!_check_usp(vg->name, usp, sp_count))
+		return_NULL;
 
-	if (!import_pool_segments(&vg->lvs, smem, usp, sp_count)) {
-		stack;
-		return NULL;
-	}
+	if (!import_pool_segments(&vg->lvs, smem, usp, sp_count))
+		return_NULL;
 
 	return vg;
 }
@@ -182,25 +170,19 @@
 
 	/* We can safely ignore the mda passed in */
 
-	if (!mem) {
-		stack;
-		return NULL;
-	}
+	if (!mem)
+		return_NULL;
 
 	/* Strip dev_dir if present */
 	vg_name = strip_dir(vg_name, fid->fmt->cmd->dev_dir);
 
 	/* Read all the pvs in the vg */
-	if (!read_pool_pds(fid->fmt, vg_name, mem, &pds)) {
-		stack;
-		goto out;
-	}
+	if (!read_pool_pds(fid->fmt, vg_name, mem, &pds))
+		goto_out;
 
 	/* Do the rest of the vg stuff */
-	if (!(vg = _build_vg_from_pds(fid, mem, &pds))) {
-		stack;
-		goto out;
-	}
+	if (!(vg = _build_vg_from_pds(fid, mem, &pds)))
+		goto_out;
 
       out:
 	dm_pool_destroy(mem);
@@ -231,30 +213,22 @@
 
 	log_very_verbose("Reading physical volume data %s from disk", pv_name);
 
-	if (!mem) {
-		stack;
-		return 0;
-	}
+	if (!mem)
+		return_0;
 
-	if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter))) {
-		stack;
-		goto out;
-	}
+	if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter)))
+		goto_out;
 
 	/*
 	 * I need to read the disk and populate a pv structure here
 	 * I'll probably need to abstract some of this later for the
 	 * vg_read code
 	 */
-	if (!(pl = read_pool_disk(fmt, dev, mem, NULL))) {
-		stack;
-		goto out;
-	}
+	if (!(pl = read_pool_disk(fmt, dev, mem, NULL)))
+		goto_out;
 
-	if (!import_pool_pv(fmt, fmt->cmd->mem, NULL, pv, pl)) {
-		stack;
-		goto out;
-	}
+	if (!import_pool_pv(fmt, fmt->cmd->mem, NULL, pv, pl))
+		goto_out;
 
 	pv->fmt = fmt;
 
--- LVM2/lib/format_pool/import_export.c	2008/01/16 19:00:59	1.19
+++ LVM2/lib/format_pool/import_export.c	2008/01/30 13:19:45	1.20
@@ -91,10 +91,8 @@
 		if (lv->name)
 			continue;
 
-		if (!(lv->name = dm_pool_strdup(mem, pl->pd.pl_pool_name))) {
-			stack;
-			return 0;
-		}
+		if (!(lv->name = dm_pool_strdup(mem, pl->pd.pl_pool_name)))
+			return_0;
 
 		get_pool_lv_uuid(lv->lvid.id, &pl->pd);
 		log_debug("Calculated lv uuid for lv %s: %s", lv->name,
@@ -178,10 +176,8 @@
 	list_init(&pv->tags);
 	list_init(&pv->segments);
 
-	if (!alloc_pv_segment_whole_pv(mem, pv)) {
-		stack;
-		return 0;
-	}
+	if (!alloc_pv_segment_whole_pv(mem, pv))
+		return_0;
 
 	return 1;
 }
@@ -216,10 +212,8 @@
 	area_len = (usp->devs[0].blocks) / POOL_PE_SIZE;
 
 	if (!(segtype = get_segtype_from_string(lv->vg->cmd,
-						     "striped"))) {
-		stack;
-		return 0;
-	}
+						     "striped")))
+		return_0;
 
 	if (!(seg = alloc_lv_segment(mem, segtype, lv, *le_cur, 
 				     area_len * usp->num_devs, 0,
@@ -230,10 +224,8 @@
 	}
 
 	for (j = 0; j < usp->num_devs; j++)
-		if (!set_lv_segment_area_pv(seg, j, usp->devs[j].pv, 0)) {
-			stack;
-			return 0;
-		}
+		if (!set_lv_segment_area_pv(seg, j, usp->devs[j].pv, 0))
+			return_0;
 
 	/* add the subpool type to the segment tag list */
 	str_list_add(mem, &seg->tags, _cvt_sptype(usp->type));
@@ -254,10 +246,8 @@
 	unsigned j;
 	uint32_t area_len;
 
-	if (!(segtype = get_segtype_from_string(lv->vg->cmd, "striped"))) {
-		stack;
-		return 0;
-	}
+	if (!(segtype = get_segtype_from_string(lv->vg->cmd, "striped")))
+		return_0;
 
 	for (j = 0; j < usp->num_devs; j++) {
 		area_len = (usp->devs[j].blocks) / POOL_PE_SIZE;
@@ -274,10 +264,8 @@
 		/* add the subpool type to the segment tag list */
 		str_list_add(mem, &seg->tags, _cvt_sptype(usp->type));
 
-		if (!set_lv_segment_area_pv(seg, 0, usp->devs[j].pv, 0)) {
-			stack;
-			return 0;
-		}
+		if (!set_lv_segment_area_pv(seg, 0, usp->devs[j].pv, 0))
+			return_0;
 		list_add(&lv->segments, &seg->list);
 
 		*le_cur += seg->len;
@@ -302,15 +290,11 @@
 
 		for (i = 0; i < subpools; i++) {
 			if (usp[i].striping) {
-				if (!_add_stripe_seg(mem, &usp[i], lv, &le_cur)) {
-					stack;
-					return 0;
-				}
+				if (!_add_stripe_seg(mem, &usp[i], lv, &le_cur))
+					return_0;
 			} else {
-				if (!_add_linear_seg(mem, &usp[i], lv, &le_cur)) {
-					stack;
-					return 0;
-				}
+				if (!_add_linear_seg(mem, &usp[i], lv, &le_cur))
+					return_0;
 			}
 		}
 	}
--- LVM2/lib/format_text/archive.c	2007/08/20 20:55:26	1.29
+++ LVM2/lib/format_text/archive.c	2008/01/30 13:19:45	1.30
@@ -113,10 +113,8 @@
 	    !dm_pool_grow_object(mem, dir, strlen(dir)) ||
 	    !dm_pool_grow_object(mem, "/", 1) ||
 	    !dm_pool_grow_object(mem, name, strlen(name)) ||
-	    !dm_pool_grow_object(mem, "\0", 1)) {
-		stack;
-		return NULL;
-	}
+	    !dm_pool_grow_object(mem, "\0", 1))
+		return_NULL;
 
 	return dm_pool_end_object(mem);
 }
@@ -134,10 +132,8 @@
 	struct archive_file *af;
 	struct list *results;
 
-	if (!(results = dm_pool_alloc(mem, sizeof(*results)))) {
-		stack;
-		return NULL;
-	}
+	if (!(results = dm_pool_alloc(mem, sizeof(*results))))
+		return_NULL;
 
 	list_init(results);
 
@@ -161,10 +157,8 @@
 		if (strcmp(vgname, vgname_found))
 			continue;
 
-		if (!(path = _join_file_to_dir(mem, dir, dirent[i]->d_name))) {
-			stack;
-			goto out;
-		}
+		if (!(path = _join_file_to_dir(mem, dir, dirent[i]->d_name)))
+			goto_out;
 
 		/*
 		 * Create a new archive_file.
@@ -255,10 +249,9 @@
 	}
 
 	if (!text_vg_export_file(vg, desc, fp)) {
-		stack;
 		if (fclose(fp))
 			log_sys_error("fclose", temp_file);
-		return 0;
+		return_0;
 	}
 
 	if (lvm_fclose(fp, temp_file))
@@ -267,10 +260,8 @@
 	/*
 	 * Now we want to rename this file to <vg>_index.vg.
 	 */
-	if (!(archives = _scan_archive(vg->cmd->mem, vg->name, dir))) {
-		stack;
-		return 0;
-	}
+	if (!(archives = _scan_archive(vg->cmd->mem, vg->name, dir)))
+		return_0;
 
 	if (list_empty(archives))
 		ix = 0;
@@ -343,10 +334,8 @@
 	struct list *archives;
 	struct archive_file *af;
 
-	if (!(archives = _scan_archive(cmd->mem, vgname, dir))) {
-		stack;
-		return 0;
-	}
+	if (!(archives = _scan_archive(cmd->mem, vgname, dir)))
+		return_0;
 
 	if (list_empty(archives))
 		log_print("No archives found in %s.", dir);
@@ -379,10 +368,8 @@
 {
 	struct archive_file af;
 
-	if (!(af.path = _join_file_to_dir(cmd->mem, dir, vgname))) {
-		stack;
-		return 0;
-	}
+	if (!(af.path = _join_file_to_dir(cmd->mem, dir, vgname)))
+		return_0;
 
 	if (path_exists(af.path))
 		_display_archive(cmd, &af);
--- LVM2/lib/format_text/archiver.c	2008/01/29 23:45:47	1.11
+++ LVM2/lib/format_text/archiver.c	2008/01/30 13:19:45	1.12
@@ -78,17 +78,13 @@
 	size_t len = strlen(line) + 32;
 	char *buffer;
 
-	if (!(buffer = dm_pool_zalloc(mem, strlen(line) + 32))) {
-		stack;
-		return NULL;
-	}
+	if (!(buffer = dm_pool_zalloc(mem, strlen(line) + 32)))
+		return_NULL;
 
 	if (snprintf(buffer, len,
 		     "Created %s executing '%s'",
-		     before ? "*before*" : "*after*", line) < 0) {
-		stack;
-		return NULL;
-	}
+		     before ? "*before*" : "*after*", line) < 0)
+		return_NULL;
 
 	return buffer;
 }
@@ -97,10 +93,8 @@
 {
 	char *desc;
 
-	if (!(desc = _build_desc(vg->cmd->mem, vg->cmd->cmd_line, 1))) {
-		stack;
-		return 0;
-	}
+	if (!(desc = _build_desc(vg->cmd->mem, vg->cmd->cmd_line, 1)))
+		return_0;
 
 	return archive_vg(vg, vg->cmd->archive_params->dir, desc,
 			  vg->cmd->archive_params->keep_days,
@@ -196,10 +190,8 @@
 	char name[PATH_MAX];
 	char *desc;
 
-	if (!(desc = _build_desc(vg->cmd->mem, vg->cmd->cmd_line, 0))) {
-		stack;
-		return 0;
-	}
+	if (!(desc = _build_desc(vg->cmd->mem, vg->cmd->cmd_line, 0)))
+		return_0;
 
 	if (dm_snprintf(name, sizeof(name), "%s/%s",
 			 vg->cmd->backup_params->dir, vg->name) < 0) {
@@ -324,10 +316,8 @@
 		}
 	}
 
-	if (!vg_write(vg) || !vg_commit(vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_write(vg) || !vg_commit(vg))
+		return_0;
 
 	return 1;
 }
@@ -341,10 +331,8 @@
 	/*
 	 * Read in the volume group from the text file.
 	 */
-	if (!(vg = backup_read_vg(cmd, vg_name, file))) {
-		stack;
-		return 0;
-	}
+	if (!(vg = backup_read_vg(cmd, vg_name, file)))
+		return_0;
 
 	return backup_restore_vg(cmd, vg);
 }
--- LVM2/lib/format_text/export.c	2007/11/09 16:51:53	1.59
+++ LVM2/lib/format_text/export.c	2008/01/30 13:19:45	1.60
@@ -135,10 +135,8 @@
 {
 	/* If metadata doesn't fit, extend buffer */
 	if ((f->data.buf.used + 2 > f->data.buf.size) &&
-	    (!_extend_buffer(f))) {
-		stack;
-		return 0;
-	}
+	    (!_extend_buffer(f)))
+		return_0;
 
 	*(f->data.buf.start + f->data.buf.used) = '\n';
 	f->data.buf.used += 1;
@@ -195,10 +193,8 @@
 
 	/* If metadata doesn't fit, extend buffer */
 	if (n < 0 || (n + f->data.buf.used + 2 > f->data.buf.size)) {
-		if (!_extend_buffer(f)) {
-			stack;
-			return 0;
-		}
+		if (!_extend_buffer(f))
+			return_0;
 		return -1; /* Retry */
 	}
 
@@ -323,26 +319,20 @@
 {
 	char buffer[4096];
 
-	if (!id_write_format(&vg->id, buffer, sizeof(buffer))) {
-		stack;
-		return 0;
-	}
+	if (!id_write_format(&vg->id, buffer, sizeof(buffer)))
+		return_0;
 
 	outf(f, "id = \"%s\"", buffer);
 
 	outf(f, "seqno = %u", vg->seqno);
 
-	if (!print_flags(vg->status, VG_FLAGS, buffer, sizeof(buffer))) {
-		stack;
-		return 0;
-	}
+	if (!print_flags(vg->status, VG_FLAGS, buffer, sizeof(buffer)))
+		return_0;
 	outf(f, "status = %s", buffer);
 
 	if (!list_empty(&vg->tags)) {
-		if (!print_tags(&vg->tags, buffer, sizeof(buffer))) {
-			stack;
-			return 0;
-		}
+		if (!print_tags(&vg->tags, buffer, sizeof(buffer)))
+			return_0;
 		outf(f, "tags = %s", buffer);
 	}
 
@@ -350,10 +340,8 @@
 		outf(f, "system_id = \"%s\"", vg->system_id);
 
 	if (!out_size(f, (uint64_t) vg->extent_size, "extent_size = %u",
-		      vg->extent_size)) {
-		stack;
-		return 0;
-	}
+		      vg->extent_size))
+		return_0;
 	outf(f, "max_lv = %u", vg->max_lv);
 	outf(f, "max_pv = %u", vg->max_pv);
 
@@ -390,52 +378,38 @@
 	list_iterate_items(pvl, &vg->pvs) {
 		pv = pvl->pv;
 
-		if (!(name = _get_pv_name(f, pv))) {
-			stack;
-			return 0;
-		}
+		if (!(name = _get_pv_name(f, pv)))
+			return_0;
 
 		outnl(f);
 		outf(f, "%s {", name);
 		_inc_indent(f);
 
-		if (!id_write_format(&pv->id, buffer, sizeof(buffer))) {
-			stack;
-			return 0;
-		}
+		if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
+			return_0;
 
 		outf(f, "id = \"%s\"", buffer);
-		if (!out_hint(f, "device = \"%s\"", pv_dev_name(pv))) {
-			stack;
-			return 0;
-		}
+		if (!out_hint(f, "device = \"%s\"", pv_dev_name(pv)))
+			return_0;
 		outnl(f);
 
-		if (!print_flags(pv->status, PV_FLAGS, buffer, sizeof(buffer))) {
-			stack;
-			return 0;
-		}
+		if (!print_flags(pv->status, PV_FLAGS, buffer, sizeof(buffer)))
+			return_0;
 		outf(f, "status = %s", buffer);
 
 		if (!list_empty(&pv->tags)) {
-			if (!print_tags(&pv->tags, buffer, sizeof(buffer))) {
-				stack;
-				return 0;
-			}
+			if (!print_tags(&pv->tags, buffer, sizeof(buffer)))
+				return_0;
 			outf(f, "tags = %s", buffer);
 		}
 
-		if (!out_size(f, pv->size, "dev_size = %" PRIu64, pv->size)) {
-			stack;
-			return 0;
-		}
+		if (!out_size(f, pv->size, "dev_size = %" PRIu64, pv->size))
+			return_0;
 
 		outf(f, "pe_start = %" PRIu64, pv->pe_start);
 		if (!out_size(f, vg->extent_size * (uint64_t) pv->pe_count,
-			      "pe_count = %u", pv->pe_count)) {
-			stack;
-			return 0;
-		}
+			      "pe_count = %u", pv->pe_count))
+			return_0;
 
 		_dec_indent(f);
 		outf(f, "}");
@@ -456,27 +430,21 @@
 
 	outf(f, "start_extent = %u", seg->le);
 	if (!out_size(f, (uint64_t) seg->len * vg->extent_size,
-		      "extent_count = %u", seg->len)) {
-		stack;
-		return 0;
-	}
+		      "extent_count = %u", seg->len))
+		return_0;
 
 	outnl(f);
 	outf(f, "type = \"%s\"", seg->segtype->name);
 
 	if (!list_empty(&seg->tags)) {
-		if (!print_tags(&seg->tags, buffer, sizeof(buffer))) {
-			stack;
-			return 0;
-		}
+		if (!print_tags(&seg->tags, buffer, sizeof(buffer)))
+			return_0;
 		outf(f, "tags = %s", buffer);
 	}
 
 	if (seg->segtype->ops->text_export &&
-	    !seg->segtype->ops->text_export(seg, f)) {
-		stack;
-		return 0;
-	}
+	    !seg->segtype->ops->text_export(seg, f))
+		return_0;
 
 	_dec_indent(f);
 	outf(f, "}");
@@ -498,10 +466,8 @@
 	for (s = 0; s < seg->area_count; s++) {
 		switch (seg_type(seg, s)) {
 		case AREA_PV:
-			if (!(name = _get_pv_name(f, seg_pv(seg, s)))) {
-				stack;
-				return 0;
-			}
+			if (!(name = _get_pv_name(f, seg_pv(seg, s))))
+				return_0;
 
 			outf(f, "\"%s\", %u%s", name,
 			     seg_pe(seg, s),
@@ -534,24 +500,18 @@
 	_inc_indent(f);
 
 	/* FIXME: Write full lvid */
-	if (!id_write_format(&lv->lvid.id[1], buffer, sizeof(buffer))) {
-		stack;
-		return 0;
-	}
+	if (!id_write_format(&lv->lvid.id[1], buffer, sizeof(buffer)))
+		return_0;
 
 	outf(f, "id = \"%s\"", buffer);
 
-	if (!print_flags(lv->status, LV_FLAGS, buffer, sizeof(buffer))) {
-		stack;
-		return 0;
-	}
+	if (!print_flags(lv->status, LV_FLAGS, buffer, sizeof(buffer)))
+		return_0;
 	outf(f, "status = %s", buffer);
 
 	if (!list_empty(&lv->tags)) {
-		if (!print_tags(&lv->tags, buffer, sizeof(buffer))) {
-			stack;
-			return 0;
-		}
+		if (!print_tags(&lv->tags, buffer, sizeof(buffer)))
+			return_0;
 		outf(f, "tags = %s", buffer);
 	}
 
@@ -579,10 +539,8 @@
 
 	seg_count = 1;
 	list_iterate_items(seg, &lv->segments) {
-		if (!_print_segment(f, lv->vg, seg_count++, seg)) {
-			stack;
-			return 0;
-		}
+		if (!_print_segment(f, lv->vg, seg_count++, seg))
+			return_0;
 	}
 
 	_dec_indent(f);
@@ -610,19 +568,15 @@
 	list_iterate_items(lvl, &vg->lvs) {
 		if (!(lvl->lv->status & VISIBLE_LV))
 			continue;
-		if (!_print_lv(f, lvl->lv)) {
-			stack;
-			return 0;
-		}
+		if (!_print_lv(f, lvl->lv))
+			return_0;
 	}
 
 	list_iterate_items(lvl, &vg->lvs) {
 		if ((lvl->lv->status & VISIBLE_LV))
 			continue;
-		if (!_print_lv(f, lvl->lv)) {
-			stack;
-			return 0;
-		}
+		if (!_print_lv(f, lvl->lv))
+			return_0;
 	}
 
 	_dec_indent(f);
@@ -671,10 +625,8 @@
 {
 	int r = 0;
 
-	if (!_build_pv_names(f, vg)) {
-		stack;
-		goto out;
-	}
+	if (!_build_pv_names(f, vg))
+		goto_out;
 
 	if (f->header && !_print_header(f, desc))
 		goto_out;
@@ -721,10 +673,8 @@
 
 	_init();
 
-	if (!(f = dm_malloc(sizeof(*f)))) {
-		stack;
-		return 0;
-	}
+	if (!(f = dm_malloc(sizeof(*f))))
+		return_0;
 
 	memset(f, 0, sizeof(*f));
 	f->data.fp = fp;
@@ -748,10 +698,8 @@
 
 	_init();
 
-	if (!(f = dm_malloc(sizeof(*f)))) {
-		stack;
-		return 0;
-	}
+	if (!(f = dm_malloc(sizeof(*f))))
+		return_0;
 
 	memset(f, 0, sizeof(*f));
 
@@ -767,9 +715,8 @@
 	f->nl = &_nl_raw;
 
 	if (!_text_vg_export(f, vg, desc)) {
-		stack;
 		dm_free(f->data.buf.start);
-		goto out;
+		goto_out;
 	}
 
 	r = f->data.buf.used + 1;
--- LVM2/lib/format_text/flags.c	2008/01/10 18:35:50	1.31
+++ LVM2/lib/format_text/flags.c	2008/01/30 13:19:45	1.32
@@ -91,10 +91,8 @@
 	int f, first = 1;
 	struct flag *flags;
 
-	if (!(flags = _get_flags(type))) {
-		stack;
-		return 0;
-	}
+	if (!(flags = _get_flags(type)))
+		return_0;
 
 	if (!emit_to_buffer(&buffer, &size, "["))
 		return 0;
@@ -135,10 +133,8 @@
 	uint32_t s = 0;
 	struct flag *flags;
 
-	if (!(flags = _get_flags(type))) {
-		stack;
-		return 0;
-	}
+	if (!(flags = _get_flags(type)))
+		return_0;
 
 	if (cv->type == CFG_EMPTY_ARRAY)
 		goto out;
--- LVM2/lib/format_text/format-text.c	2008/01/29 23:45:47	1.86
+++ LVM2/lib/format_text/format-text.c	2008/01/30 13:19:45	1.87
@@ -297,40 +297,38 @@
 		return NULL;
 	}
 
-	if (!dev_read(dev_area->dev, dev_area->start, MDA_HEADER_SIZE, mdah)) {
-		stack;
-		goto error;
-	}
+	if (!dev_read(dev_area->dev, dev_area->start, MDA_HEADER_SIZE, mdah))
+		goto_bad;
 
 	if (mdah->checksum_xl != xlate32(calc_crc(INITIAL_CRC, mdah->magic,
 						  MDA_HEADER_SIZE -
 						  sizeof(mdah->checksum_xl)))) {
 		log_error("Incorrect metadata area header checksum");
-		goto error;
+		goto bad;
 	}
 
 	_xlate_mdah(mdah);
 
 	if (strncmp((char *)mdah->magic, FMTT_MAGIC, sizeof(mdah->magic))) {
 		log_error("Wrong magic number in metadata area header");
-		goto error;
+		goto bad;
 	}
 
 	if (mdah->version != FMTT_VERSION) {
 		log_error("Incompatible metadata area header version: %d",
 			  mdah->version);
-		goto error;
+		goto bad;
 	}
 
 	if (mdah->start != dev_area->start) {
 		log_error("Incorrect start sector in metadata area header: %"
 			  PRIu64, mdah->start);
-		goto error;
+		goto bad;
 	}
 
 	return mdah;
 
-error:
+bad:
 	dm_pool_free(fmt->cmd->mem, mdah);
 	return NULL;
 }
@@ -349,9 +347,8 @@
 					     sizeof(mdah->checksum_xl)));
 
 	if (!dev_write(dev, start_byte, MDA_HEADER_SIZE, mdah)) {
-		stack;
 		dm_pool_free(fmt->cmd->mem, mdah);
-		return 0;
+		return_0;
 	}
 
 	return 1;
@@ -380,17 +377,15 @@
 	/* FIXME Loop through rlocns two-at-a-time.  List null-terminated. */
 	/* FIXME Ignore if checksum incorrect!!! */
 	if (!dev_read(dev_area->dev, dev_area->start + rlocn->offset,
-		      sizeof(vgnamebuf), vgnamebuf)) {
-		stack;
-		goto error;
-	}
+		      sizeof(vgnamebuf), vgnamebuf))
+		goto_bad;
 
 	if (!strncmp(vgnamebuf, vgname, len = strlen(vgname)) &&
 	    (isspace(vgnamebuf[len]) || vgnamebuf[len] == '{')) {
 		return rlocn;
 	}
 
-      error:
+      bad:
 	if ((info = info_from_pvid(dev_area->dev->pvid, 0)))
 		lvmcache_update_vgname_and_id(info, ORPHAN, ORPHAN, 0, NULL);
 
@@ -422,15 +417,11 @@
 	int noprecommit = 0;
 	struct mda_header *mdah;
 
-	if (!dev_open(dev_area->dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(dev_area->dev))
+		return_0;
 
-	if (!(mdah = _raw_read_mda_header(fid->fmt, dev_area))) {
-		stack;
-		return 0;
-	}
+	if (!(mdah = _raw_read_mda_header(fid->fmt, dev_area)))
+		return_0;
 
 	if (_find_vg_rlocn(dev_area, mdah, vgname, &noprecommit))
 		r = 1;
@@ -453,15 +444,11 @@
 	char *desc;
 	uint32_t wrap = 0;
 
-	if (!dev_open(area->dev)) {
-		stack;
-		return NULL;
-	}
+	if (!dev_open(area->dev))
+		return_NULL;
 
-	if (!(mdah = _raw_read_mda_header(fid->fmt, area))) {
-		stack;
-		goto out;
-	}
+	if (!(mdah = _raw_read_mda_header(fid->fmt, area)))
+		goto_out;
 
 	if (!(rlocn = _find_vg_rlocn(area, mdah, vgname, &precommitted))) {
 		log_debug("VG %s not found on %s", vgname, dev_name(area->dev));
@@ -483,10 +470,8 @@
 				     (uint32_t) (rlocn->size - wrap),
 				     (off_t) (area->start + MDA_HEADER_SIZE),
 				     wrap, calc_crc, rlocn->checksum, &when,
-				     &desc))) {
-		stack;
-		goto out;
-	}
+				     &desc)))
+		goto_out;
 	log_debug("Read %s %smetadata (%u) from %s at %" PRIu64 " size %"
 		  PRIu64, vg->name, precommitted ? "pre-commit " : "",
 		  vg->seqno, dev_name(area->dev),
@@ -544,15 +529,11 @@
 	if (!found)
 		return 1;
 
-	if (!dev_open(mdac->area.dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(mdac->area.dev))
+		return_0;
 
-	if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area))) {
-		stack;
-		goto out;
-	}
+	if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area)))
+		goto_out;
 
 	rlocn = _find_vg_rlocn(&mdac->area, mdah, vg->name, &noprecommit);
 	mdac->rlocn.offset = _next_rlocn_offset(rlocn, mdah);
@@ -589,10 +570,8 @@
 	/* Write text out, circularly */
 	if (!dev_write(mdac->area.dev, mdac->area.start + mdac->rlocn.offset,
 		       (size_t) (mdac->rlocn.size - new_wrap),
-		       fidtc->raw_metadata_buf)) {
-		stack;
-		goto out;
-	}
+		       fidtc->raw_metadata_buf))
+		goto_out;
 
 	if (new_wrap) {
 		log_debug("Writing metadata to %s at %" PRIu64 " len %" PRIu32,
@@ -603,10 +582,8 @@
 			       mdac->area.start + MDA_HEADER_SIZE,
 			       (size_t) new_wrap,
 			       fidtc->raw_metadata_buf + 
-			       mdac->rlocn.size - new_wrap)) {
-			stack;
-			goto out;
-		}
+			       mdac->rlocn.size - new_wrap))
+			goto_out;
 	}
 
 	mdac->rlocn.checksum = calc_crc(INITIAL_CRC, fidtc->raw_metadata_buf,
@@ -652,10 +629,8 @@
 	if (!found)
 		return 1;
 
-	if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area))) {
-		stack;
-		goto out;
-	}
+	if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area)))
+		goto_out;
 
 	if (!(rlocn = _find_vg_rlocn(&mdac->area, mdah, vg->name, &noprecommit))) {
 		mdah->raw_locns[0].offset = 0;
@@ -759,15 +734,11 @@
 	int r = 0;
 	int noprecommit = 0;
 
-	if (!dev_open(mdac->area.dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(mdac->area.dev))
+		return_0;
 
-	if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area))) {
-		stack;
-		goto out;
-	}
+	if (!(mdah = _raw_read_mda_header(fid->fmt, &mdac->area)))
+		goto_out;
 
 	if (!(rlocn = _find_vg_rlocn(&mdac->area, mdah, vg->name, &noprecommit))) {
 		rlocn = &mdah->raw_locns[0];
@@ -801,10 +772,8 @@
 	time_t when;
 	char *desc;
 
-	if (!(vg = text_vg_import_file(fid, read_path, &when, &desc))) {
-		stack;
-		return NULL;
-	}
+	if (!(vg = text_vg_import_file(fid, read_path, &when, &desc)))
+		return_NULL;
 
 	/*
 	 * Currently you can only have a single volume group per
@@ -1065,10 +1034,8 @@
 	if (mda_free_sectors)
 		*mda_free_sectors = ((dev_area->size - MDA_HEADER_SIZE) / 2) >> SECTOR_SHIFT;
 
-	if (!dev_open(dev_area->dev)) {
-		stack;
-		return NULL;
-	}
+	if (!dev_open(dev_area->dev))
+		return_NULL;
 
 	if (!(mdah = _raw_read_mda_header(fmt, dev_area)))
 		goto_out;
@@ -1114,15 +1081,13 @@
 
 	/* Ignore this entry if the characters aren't permissible */
 	if (!validate_name(vgname)) {
-		stack;
 		vgname = NULL;
-		goto out;
+		goto_out;
 	}
 
 	if (!id_write_format(vgid, uuid, sizeof(uuid))) {
-		stack;
 		vgname = NULL;
-		goto out;
+		goto_out;
 	}
 
 	log_debug("%s: Found metadata at %" PRIu64 " size %" PRIu64
@@ -1328,10 +1293,8 @@
 	/* FIXME Test mode don't update cache? */
 
 	if (!(info = lvmcache_add(fmt->labeller, (char *) &pv->id, pv->dev,
-				  ORPHAN, NULL, 0))) {
-		stack;
-		return 0;
-	}
+				  ORPHAN, NULL, 0)))
+		return_0;
 	label = info->label;
 
 	if (label_sector != -1)
@@ -1384,15 +1347,11 @@
 		}
 	}
 	if (!add_da
-	    (NULL, &info->das, pv->pe_start << SECTOR_SHIFT, UINT64_C(0))) {
-		stack;
-		return 0;
-	}
+	    (NULL, &info->das, pv->pe_start << SECTOR_SHIFT, UINT64_C(0)))
+		return_0;
 
-	if (!dev_open(pv->dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(pv->dev))
+		return_0;
 
 	list_iterate_items(mda, &info->mdas) {
 		mdac = mda->metadata_locn;
@@ -1400,19 +1359,16 @@
 		mdah->size = mdac->area.size;
 		if (!_raw_write_mda_header(fmt, mdac->area.dev,
 					   mdac->area.start, mdah)) {
-			stack;
 			if (!dev_close(pv->dev))
 				stack;
-			return 0;
+			return_0;
 		}
 	}
 
 	label_write(pv->dev, label);
 
-	if (!dev_close(pv->dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_close(pv->dev))
+		return_0;
 
 	return 1;
 }
@@ -1449,16 +1405,12 @@
 	struct mda_context *mdac, *mdac_new;
 	struct data_area_list *da;
 
-	if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter))) {
-		stack;
-		return 0;
-	}
+	if (!(dev = dev_cache_get(pv_name, fmt->cmd->filter)))
+		return_0;
 
 	/* FIXME Optimise out repeated reading when cache lock held */
-	if (!(label_read(dev, &label, UINT64_C(0)))) {
-		stack;
-		return 0;
-	}
+	if (!(label_read(dev, &label, UINT64_C(0))))
+		return_0;
 	info = (struct lvmcache_info *) label->info;
 
 	/* Have we already cached vgname? */
@@ -1642,16 +1594,12 @@
 					continue;
 
 				if (!(mda_new = dm_pool_alloc(fmt->cmd->mem,
-							   sizeof(*mda_new)))) {
-					stack;
-					return 0;
-				}
+							   sizeof(*mda_new))))
+					return_0;
 
 				if (!(mdac_new = dm_pool_alloc(fmt->cmd->mem,
-							    sizeof(*mdac_new)))) {
-					stack;
-					return 0;
-				}
+							    sizeof(*mdac_new))))
+					return_0;
 				/* FIXME multiple dev_areas inside area */
 				memcpy(mda_new, mda, sizeof(*mda));
 				memcpy(mdac_new, mdac, sizeof(*mdac));
@@ -1687,11 +1635,8 @@
 		if (extent_count)
 			pe_end = pe_start + extent_count * extent_size - 1;
 		if (!_mda_setup(fmt, pe_start, pe_end, pvmetadatacopies,
-				pvmetadatasize, mdas, pv, vg)) {
-			stack;
-			return 0;
-		}
-
+				pvmetadatasize, mdas, pv, vg))
+			return_0;
 	}
 
 	return 1;
@@ -1732,10 +1677,8 @@
 	list_init(&fid->metadata_areas);
 
 	if (!vgname) {
-		if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda)))) {
-			stack;
-			return NULL;
-		}
+		if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda))))
+			return_NULL;
 		mda->ops = &_metadata_text_file_backup_ops;
 		mda->metadata_locn = context;
 		list_add(&fid->metadata_areas, &mda->list);
@@ -1751,10 +1694,8 @@
 			}
 
 			context = create_text_context(fmt->cmd, path, NULL);
-			if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda)))) {
-				stack;
-				return NULL;
-			}
+			if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda))))
+				return_NULL;
 			mda->ops = &_metadata_text_file_ops;
 			mda->metadata_locn = context;
 			list_add(&fid->metadata_areas, &mda->list);
@@ -1767,15 +1708,11 @@
 			if (!_raw_holds_vgname(fid, &rl->dev_area, vgname))
 				continue;
 
-			if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda)))) {
-				stack;
-				return NULL;
-			}
+			if (!(mda = dm_pool_alloc(fmt->cmd->mem, sizeof(*mda))))
+				return_NULL;
 
-			if (!(mdac = dm_pool_alloc(fmt->cmd->mem, sizeof(*mdac)))) {
-				stack;
-				return NULL;
-			}
+			if (!(mdac = dm_pool_alloc(fmt->cmd->mem, sizeof(*mdac))))
+				return_NULL;
 			mda->metadata_locn = mdac;
 			/* FIXME Allow multiple dev_areas inside area */
 			memcpy(&mdac->area, &rl->dev_area, sizeof(mdac->area));
@@ -1786,10 +1723,8 @@
 
 		/* Scan PVs in VG for any further MDAs */
 		lvmcache_label_scan(fmt->cmd, 0);
-		if (!(vginfo = vginfo_from_vgname(vgname, vgid))) {
-			stack;
-			goto out;
-		}
+		if (!(vginfo = vginfo_from_vgname(vgname, vgid)))
+			goto_out;
 		list_iterate_items(info, &vginfo->infos) {
 			mdas = &info->mdas;
 			list_iterate_items(mda, mdas) {
@@ -1798,16 +1733,12 @@
 
 				/* FIXME Check it holds this VG */
 				if (!(mda_new = dm_pool_alloc(fmt->cmd->mem,
-							   sizeof(*mda_new)))) {
-					stack;
-					return NULL;
-				}
+							   sizeof(*mda_new))))
+					return_NULL;
 
 				if (!(mdac_new = dm_pool_alloc(fmt->cmd->mem,
-							    sizeof(*mdac_new)))) {
-					stack;
-					return NULL;
-				}
+							    sizeof(*mdac_new))))
+					return_NULL;
 				/* FIXME multiple dev_areas inside area */
 				memcpy(mda_new, mda, sizeof(*mda));
 				memcpy(mdac_new, mdac, sizeof(*mdac));
@@ -1834,33 +1765,26 @@
 		return NULL;
 	}
 
-	if (!(tc = dm_pool_alloc(cmd->mem, sizeof(*tc)))) {
-		stack;
-		return NULL;
-	}
+	if (!(tc = dm_pool_alloc(cmd->mem, sizeof(*tc))))
+		return_NULL;
 
-	if (!(tc->path_live = dm_pool_strdup(cmd->mem, path))) {
-		stack;
-		goto no_mem;
-	}
+	if (!(tc->path_live = dm_pool_strdup(cmd->mem, path)))
+		goto_bad;
+
+	if (!(tc->path_edit = dm_pool_alloc(cmd->mem, strlen(path) + 5)))
+		goto_bad;
 
-	if (!(tc->path_edit = dm_pool_alloc(cmd->mem, strlen(path) + 5))) {
-		stack;
-		goto no_mem;
-	}
 	sprintf(tc->path_edit, "%s.tmp", path);
 
 	if (!desc)
 		desc = "";
 
-	if (!(tc->desc = dm_pool_strdup(cmd->mem, desc))) {
-		stack;
-		goto no_mem;
-	}
+	if (!(tc->desc = dm_pool_strdup(cmd->mem, desc)))
+		goto_bad;
 
 	return (void *) tc;
 
-      no_mem:
+      bad:
 	dm_pool_free(cmd->mem, tc);
 
 	log_err("Couldn't allocate text format context object.");
@@ -1956,10 +1880,8 @@
 	struct config_value *cv;
 	struct mda_lists *mda_lists;
 
-	if (!(fmt = dm_malloc(sizeof(*fmt)))) {
-		stack;
-		return NULL;
-	}
+	if (!(fmt = dm_malloc(sizeof(*fmt))))
+		return_NULL;
 
 	fmt->cmd = cmd;
 	fmt->ops = &_text_handler;
--- LVM2/lib/format_text/import.c	2007/08/20 20:55:26	1.43
+++ LVM2/lib/format_text/import.c	2008/01/30 13:19:45	1.44
@@ -111,10 +111,8 @@
 		if (!(*vsn)->check_version(cft))
 			continue;
 
-		if (!(vg = (*vsn)->read_vg(fid, cft))) {
-			stack;
-			goto out;
-		}
+		if (!(vg = (*vsn)->read_vg(fid, cft)))
+			goto_out;
 
 		(*vsn)->read_desc(fid->fmt->cmd->mem, cft, when, desc);
 		break;
--- LVM2/lib/format_text/import_vsn1.c	2008/01/16 19:00:59	1.47
+++ LVM2/lib/format_text/import_vsn1.c	2008/01/30 13:19:45	1.48
@@ -136,10 +136,8 @@
 	uint64_t size;
 
 	if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl))) ||
-	    !(pvl->pv = dm_pool_zalloc(mem, sizeof(*pvl->pv)))) {
-		stack;
-		return 0;
-	}
+	    !(pvl->pv = dm_pool_zalloc(mem, sizeof(*pvl->pv))))
+		return_0;
 
 	pv = pvl->pv;
 
@@ -147,10 +145,8 @@
 	 * Add the pv to the pv hash for quick lookup when we read
 	 * the lv segments.
 	 */
-	if (!dm_hash_insert(pv_hash, pvn->key, pv)) {
-		stack;
-		return 0;
-	}
+	if (!dm_hash_insert(pv_hash, pvn->key, pv))
+		return_0;
 
 	if (!(pvn = pvn->child)) {
 		log_error("Empty pv section.");
@@ -180,10 +176,8 @@
 			return 0;
 	}
 
-	if (!(pv->vg_name = dm_pool_strdup(mem, vg->name))) {
-		stack;
-		return 0;
-	}
+	if (!(pv->vg_name = dm_pool_strdup(mem, vg->name)))
+		return_0;
 
 	memcpy(&pv->vgid, &vg->id, sizeof(vg->id));
 
@@ -250,10 +244,8 @@
                 }
         }
 
-	if (!alloc_pv_segment_whole_pv(mem, pv)) {
-		stack;
-		return 0;
-	}
+	if (!alloc_pv_segment_whole_pv(mem, pv))
+		return_0;
 
 	vg->pv_count++;
 	list_add(&vg->pvs, &pvl->list);
@@ -316,16 +308,12 @@
 		segtype_str = cv->v.str;
 	}
 
-	if (!(segtype = get_segtype_from_string(vg->cmd, segtype_str))) {
-		stack;
-		return 0;
-	}
+	if (!(segtype = get_segtype_from_string(vg->cmd, segtype_str)))
+		return_0;
 
 	if (segtype->ops->text_import_area_count &&
-	    !segtype->ops->text_import_area_count(sn, &area_count)) {
-		stack;
-		return 0;
-	}
+	    !segtype->ops->text_import_area_count(sn, &area_count))
+		return_0;
 
 	if (!(seg = alloc_lv_segment(mem, segtype, lv, start_extent,
 				     extent_count, 0, 0, NULL, area_count,
@@ -335,10 +323,8 @@
 	}
 
 	if (seg->segtype->ops->text_import &&
-	    !seg->segtype->ops->text_import(seg, sn, pv_hash)) {
-		stack;
-		return 0;
-	}
+	    !seg->segtype->ops->text_import(seg, sn, pv_hash))
+		return_0;
 
 	/* Optional tags */
 	if ((cn = find_config_node(sn, "tags")) &&
@@ -403,10 +389,8 @@
 
 		/* FIXME Cope if LV not yet read in */
 		if ((pv = dm_hash_lookup(pv_hash, cv->v.str))) {
-			if (!set_lv_segment_area_pv(seg, s, pv, (uint32_t) cv->next->v.i)) {
-				stack;
-				return 0;
-			}
+			if (!set_lv_segment_area_pv(seg, s, pv, (uint32_t) cv->next->v.i))
+				return_0;
 		} else if ((lv1 = find_lv(seg->lv->vg, cv->v.str))) {
 			if (!set_lv_segment_area_lv(seg, s, lv1,
 						    (uint32_t) cv->next->v.i,
@@ -447,10 +431,8 @@
 		 * All sub-sections are assumed to be segments.
 		 */
 		if (!sn->v) {
-			if (!_read_segment(mem, vg, lv, sn, pv_hash)) {
-				stack;
-				return 0;
-			}
+			if (!_read_segment(mem, vg, lv, sn, pv_hash))
+				return_0;
 
 			count++;
 		}
@@ -475,18 +457,14 @@
 	/*
 	 * Check there are no gaps or overlaps in the lv.
 	 */
-	if (!check_lv_segments(lv, 0)) {
-		stack;
-		return 0;
-	}
+	if (!check_lv_segments(lv, 0))
+		return_0;
 
 	/*
 	 * Merge segments in case someones been editing things by hand.
 	 */
-	if (!lv_merge_segments(lv)) {
-		stack;
-		return 0;
-	}
+	if (!lv_merge_segments(lv))
+		return_0;
 
 	return 1;
 }
@@ -502,17 +480,13 @@
 	struct config_node *cn;
 
 	if (!(lvl = dm_pool_zalloc(mem, sizeof(*lvl))) ||
-	    !(lvl->lv = dm_pool_zalloc(mem, sizeof(*lvl->lv)))) {
-		stack;
-		return 0;
-	}
+	    !(lvl->lv = dm_pool_zalloc(mem, sizeof(*lvl->lv))))
+		return_0;
 
 	lv = lvl->lv;
 
-	if (!(lv->name = dm_pool_strdup(mem, lvn->key))) {
-		stack;
-		return 0;
-	}
+	if (!(lv->name = dm_pool_strdup(mem, lvn->key)))
+		return_0;
 
 	if (!(lvn = lvn->child)) {
 		log_error("Empty logical volume section.");
@@ -538,10 +512,8 @@
 		}
 
 		lv->alloc = get_alloc_from_string(cv->v.str);
-		if (lv->alloc == ALLOC_INVALID) {
-			stack;
-			return 0;
-		}
+		if (lv->alloc == ALLOC_INVALID)
+			return_0;
 	}
 
 	if (!_read_int32(lvn, "read_ahead", &lv->read_ahead))
@@ -611,10 +583,8 @@
 
 	memcpy(&lv->lvid.id[0], &lv->vg->id, sizeof(lv->lvid.id[0]));
 
-	if (!_read_segments(mem, vg, lv, lvn, pv_hash)) {
-		stack;
-		return 0;
-	}
+	if (!_read_segments(mem, vg, lv, lvn, pv_hash))
+		return_0;
 
 	lv->size = (uint64_t) lv->le_count * (uint64_t) vg->extent_size;
 
@@ -664,10 +634,8 @@
 	}
 
 	for (n = n->child; n; n = n->sib) {
-		if (!fn(fid, mem, vg, n, vgn, pv_hash)) {
-			stack;
-			return 0;
-		}
+		if (!fn(fid, mem, vg, n, vgn, pv_hash))
+			return_0;
 	}
 
 	return 1;
@@ -689,10 +657,8 @@
 		return NULL;
 	}
 
-	if (!(vg = dm_pool_zalloc(mem, sizeof(*vg)))) {
-		stack;
-		return NULL;
-	}
+	if (!(vg = dm_pool_zalloc(mem, sizeof(*vg))))
+		return_NULL;
 	vg->cmd = fid->fmt->cmd;
 
 	/* FIXME Determine format type from file contents */
@@ -770,10 +736,8 @@
 		}
 
 		vg->alloc = get_alloc_from_string(cv->v.str);
-		if (vg->alloc == ALLOC_INVALID) {
-			stack;
-			return 0;
-		}
+		if (vg->alloc == ALLOC_INVALID)
+			return_0;
 	}
 
 	/*
--- LVM2/lib/format_text/tags.c	2007/08/20 20:55:26	1.4
+++ LVM2/lib/format_text/tags.c	2008/01/30 13:19:45	1.5
@@ -24,30 +24,22 @@
 	struct str_list *sl;
 	int first = 1;
 
-	if (!emit_to_buffer(&buffer, &size, "[")) {
-		stack;
-		return 0;
-	}
+	if (!emit_to_buffer(&buffer, &size, "["))
+		return_0;
 
 	list_iterate_items(sl, tags) {
 		if (!first) {
-			if (!emit_to_buffer(&buffer, &size, ", ")) {
-				stack;
-				return 0;
-			}
+			if (!emit_to_buffer(&buffer, &size, ", "))
+				return_0;
 		} else
 			first = 0;
 
-		if (!emit_to_buffer(&buffer, &size, "\"%s\"", sl->str)) {
-			stack;
-			return 0;
-		}
+		if (!emit_to_buffer(&buffer, &size, "\"%s\"", sl->str))
+			return_0;
 	}
 
-	if (!emit_to_buffer(&buffer, &size, "]")) {
-		stack;
-		return 0;
-	}
+	if (!emit_to_buffer(&buffer, &size, "]"))
+		return_0;
 
 	return 1;
 }
@@ -63,10 +55,8 @@
 			return 0;
 		}
 
-		if (!str_list_add(mem, tags, dm_pool_strdup(mem, cv->v.str))) {
-			stack;
-			return 0;
-		}
+		if (!str_list_add(mem, tags, dm_pool_strdup(mem, cv->v.str)))
+			return_0;
 
 		cv = cv->next;
 	}
--- LVM2/lib/label/label.c	2008/01/29 23:45:48	1.39
+++ LVM2/lib/label/label.c	2008/01/30 13:19:45	1.40
@@ -86,10 +86,8 @@
 {
 	struct labeller_i *li;
 
-	if (!(li = _alloc_li(name, handler))) {
-		stack;
-		return 0;
-	}
+	if (!(li = _alloc_li(name, handler)))
+		return_0;
 
 	list_add(&_labellers, &li->list);
 	return 1;
@@ -203,10 +201,8 @@
 
 	log_very_verbose("Scanning for labels to wipe from %s", dev_name(dev));
 
-	if (!dev_open(dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(dev))
+		return_0;
 
 	/*
 	 * We flush the device just in case someone is stupid
@@ -322,18 +318,14 @@
 	lh->sector_xl = xlate64(label->sector);
 	lh->offset_xl = xlate32(sizeof(*lh));
 
-	if (!(label->labeller->ops->write)(label, buf)) {
-		stack;
-		return 0;
-	}
+	if (!(label->labeller->ops->write)(label, buf))
+		return_0;
 
 	lh->crc_xl = xlate32(calc_crc(INITIAL_CRC, &lh->offset_xl, LABEL_SIZE -
 				      ((void *) &lh->offset_xl - (void *) lh)));
 
-	if (!dev_open(dev)) {
-		stack;
-		return 0;
-	}
+	if (!dev_open(dev))
+		return_0;
 
 	log_info("%s: Writing label to sector %" PRIu64, dev_name(dev),
 		 label->sector);
--- LVM2/lib/locking/external_locking.c	2007/08/22 14:38:17	1.13
+++ LVM2/lib/locking/external_locking.c	2008/01/30 13:19:46	1.14
@@ -73,10 +73,8 @@
 	libname = find_config_tree_str(cmd, "global/locking_library",
 				       DEFAULT_LOCKING_LIB);
 
-	if (!(_locking_lib = load_shared_library(cmd, libname, "locking", 1))) {
-		stack;
-		return 0;
-	}
+	if (!(_locking_lib = load_shared_library(cmd, libname, "locking", 1)))
+		return_0;
 
 	/* Get the functions we need */
 	if (!(_init_fn = dlsym(_locking_lib, "locking_init")) ||
--- LVM2/lib/metadata/lv_manip.c	2008/01/26 00:25:04	1.147
+++ LVM2/lib/metadata/lv_manip.c	2008/01/30 13:19:46	1.148
@@ -178,15 +178,12 @@
 	struct lv_segment *seg;
 	uint32_t areas_sz = area_count * sizeof(*seg->areas);
 
-	if (!(seg = dm_pool_zalloc(mem, sizeof(*seg)))) {
-		stack;
-		return NULL;
-	}
+	if (!(seg = dm_pool_zalloc(mem, sizeof(*seg))))
+		return_NULL;
 
 	if (!(seg->areas = dm_pool_zalloc(mem, areas_sz))) {
 		dm_pool_free(mem, seg);
-		stack;
-		return NULL;
+		return_NULL;
 	}
 
 	if (!segtype) {
@@ -290,10 +287,8 @@
 					seg_from->area_len);
 		release_lv_segment_area(seg_to, area_to, seg_to->area_len);
 
-		if (!set_lv_segment_area_pv(seg_to, area_to, pv, pe)) {
-			stack;
-			return 0;
-		}
+		if (!set_lv_segment_area_pv(seg_to, area_to, pv, pe))
+			return_0;
 
 		break;
 
@@ -326,10 +321,8 @@
 	seg->areas[area_num].type = AREA_PV;
 
 	if (!(seg_pvseg(seg, area_num) =
-	      assign_peg_to_lvseg(pv, pe, seg->area_len, seg, area_num))) {
-		stack;
-		return 0;
-	}
+	      assign_peg_to_lvseg(pv, pe, seg->area_len, seg, area_num)))
+		return_0;
 
 	return 1;
 }
@@ -365,10 +358,8 @@
 	struct lv_segment_area *newareas;
 	uint32_t areas_sz = new_area_count * sizeof(*newareas);
 
-	if (!(newareas = dm_pool_zalloc(lv->vg->cmd->mem, areas_sz))) {
-		stack;
-		return 0;
-	}
+	if (!(newareas = dm_pool_zalloc(lv->vg->cmd->mem, areas_sz)))
+		return_0;
 
 	memcpy(newareas, seg->areas, seg->area_count * sizeof(*seg->areas));
 
@@ -423,19 +414,15 @@
 		if (seg->len <= count) {
 			/* remove this segment completely */
 			/* FIXME Check this is safe */
-			if (seg->log_lv && !lv_remove(seg->log_lv)) {
-				stack;
-				return 0;
-			}
+			if (seg->log_lv && !lv_remove(seg->log_lv))
+				return_0;
 			list_del(&seg->list);
 			reduction = seg->len;
 		} else
 			reduction = count;
 
-		if (!_lv_segment_reduce(seg, reduction)) {
-			stack;
-			return 0;
-		}
+		if (!_lv_segment_reduce(seg, reduction))
+			return_0;
 		count -= reduction;
 	}
 
@@ -447,19 +434,15 @@
 
 	/* Remove the LV if it is now empty */
 	if (!lv->le_count) {
-		if (!(lvl = find_lv_in_vg(lv->vg, lv->name))) {
-			stack;
-			return 0;
-		}
+		if (!(lvl = find_lv_in_vg(lv->vg, lv->name)))
+			return_0;
 
 		list_del(&lvl->list);
 
 		lv->vg->lv_count--;
 	} else if (lv->vg->fid->fmt->ops->lv_setup &&
-		   !lv->vg->fid->fmt->ops->lv_setup(lv->vg->fid, lv)) {
-		stack;
-		return 0;
-	}
+		   !lv->vg->fid->fmt->ops->lv_setup(lv->vg->fid, lv))
+		return_0;
 
 	return 1;
 }
@@ -504,10 +487,8 @@
 int lv_remove(struct logical_volume *lv)
 {
 
-	if (!lv_reduce(lv, lv->le_count)) {
-		stack;
-		return 0;
-	}
+	if (!lv_reduce(lv, lv->le_count))
+		return_0;
 
 	return 1;
 }
@@ -684,12 +665,9 @@
 		return 0;
 	}
 
-	for (s = 0; s < area_count; s++) {
-		if (!set_lv_segment_area_pv(seg, s, aa[s].pv, aa[s].pe)) {
-			stack;
-			return 0;
-		}
-	}
+	for (s = 0; s < area_count; s++)
+		if (!set_lv_segment_area_pv(seg, s, aa[s].pv, aa[s].pe))
+			return_0;
 
 	list_add(&lv->segments, &seg->list);
 
@@ -717,10 +695,8 @@
 	list_iterate_items(aa, &alloced_areas[0]) {
 		if (!_setup_alloced_segment(lv, status, area_count,
 					    stripe_size, segtype, aa,
-					    region_size, log_lv)) {
-			stack;
-			return 0;
-		}
+					    region_size, log_lv))
+			return_0;
 	}
 
 	return 1;
@@ -1142,10 +1118,8 @@
 					  allocated,
 					  (ah->log_count && !ah->log_area.len) ?
 						*(areas + ix_offset + ix - 1) :
-						NULL)) {
-			stack;
-			return 0;
-		}
+						NULL))
+			return_0;
 
 	} while (!contiguous && *allocated != needed && can_split);
 
@@ -1187,10 +1161,8 @@
 	/*
 	 * Build the sets of available areas on the pv's.
 	 */
-	if (!(pvms = create_pv_maps(ah->mem, vg, allocatable_pvs))) {
-		stack;
-		return 0;
-	}
+	if (!(pvms = create_pv_maps(ah->mem, vg, allocatable_pvs)))
+		return_0;
 
 	if (!_log_parallel_areas(ah->mem, ah->parallel_areas))
 		stack;
@@ -1315,9 +1287,8 @@
 	if (!segtype_is_virtual(segtype) &&
 	    !_allocate(ah, vg, lv, (lv ? lv->le_count : 0) + extents,
 		       1, allocatable_pvs)) {
-		stack;
 		alloc_destroy(ah);
-		return NULL;
+		return_NULL;
 	}
 
 	return ah;
@@ -1348,10 +1319,8 @@
 	if (!_setup_alloced_segments(lv, &ah->alloced_areas[first_area],
 				     num_areas, status,
 				     stripe_size, segtype,
-				     region_size, log_lv)) {
-		stack;
-		return 0;
-	}
+				     region_size, log_lv))
+		return_0;
 
 	if ((segtype->flags & SEG_CAN_SPLIT) && !lv_merge_segments(lv)) {
 		log_err("Couldn't merge segments after extending "
@@ -1360,10 +1329,8 @@
 	}
 
 	if (lv->vg->fid->fmt->ops->lv_setup &&
-	    !lv->vg->fid->fmt->ops->lv_setup(lv->vg->fid, lv)) {
-		stack;
-		return 0;
-	}
+	    !lv->vg->fid->fmt->ops->lv_setup(lv->vg->fid, lv))
+		return_0;
 
 	return 1;
 }
@@ -1615,10 +1582,8 @@
 
 	if (mirrors < 2) {
 		if (!lv_add_segment(ah, 0, ah->area_count, lv, segtype, stripe_size,
-			    status, 0, NULL)) {
-			stack;
-			goto out;
-		}
+			    status, 0, NULL))
+			goto_out;
 	} else {
 		if (!_lv_extend_mirror(ah, lv, extents, 0))
 			return_0;
@@ -1787,15 +1752,13 @@
 	backup(vg);
 
 	if (!suspend_lv(cmd, lv)) {
-		stack;
 		vg_revert(vg);
-		return 0;
+		return_0;
 	}
 
 	if (!vg_commit(vg)) {
-		stack;
 		resume_lv(cmd, lv);
-		return 0;
+		return_0;
 	}
 
 	resume_lv(cmd, lv);
@@ -1890,10 +1853,9 @@
 		lv->lvid = *lvid;
 
 	if (fi->fmt->ops->lv_setup && !fi->fmt->ops->lv_setup(fi, lv)) {
-		stack;
 		if (ll)
 			dm_pool_free(cmd->mem, ll);
-		return NULL;
+		return_NULL;
 	}
 
 	if (!import)
@@ -1960,10 +1922,8 @@
 		/* Find next segment end */
 		/* FIXME Unnecessary nesting! */
 		if (!_for_each_pv(cmd, lv, current_le, spvs->len, &spvs->len,
-				  0, 0, -1, 0, _add_pvs, (void *) spvs)) {
-			stack;
-			return NULL;
-		}
+				  0, 0, -1, 0, _add_pvs, (void *) spvs))
+			return_NULL;
 
 		current_le = spvs->le + spvs->len;
 	} while (current_le < lv->le_count);
@@ -2055,10 +2015,8 @@
 	if (lv_is_cow(lv)) {
 		origin = origin_from_cow(lv);
 		log_verbose("Removing snapshot %s", lv->name);
-		if (!vg_remove_snapshot(lv)) {
-			stack;
-			return 0;
-		}
+		if (!vg_remove_snapshot(lv))
+			return_0;
 	}
 
 	log_verbose("Releasing logical volume \"%s\"", lv->name);
--- LVM2/lib/metadata/merge.c	2008/01/26 00:30:28	1.32
+++ LVM2/lib/metadata/merge.c	2008/01/30 13:19:46	1.33
@@ -305,10 +305,8 @@
 						     seg->area_len,
 						 seg_pvseg(seg, s)->len -
 						     seg->area_len,
-						 split_seg, s))) {
-				stack;
-				return 0;
-			}
+						 split_seg, s)))
+				return_0;
 			log_debug("Split %s:%u[%u] at %u: %s PE %u", lv->name,
 				  seg->le, s, le,
 				  dev_name(seg_dev(seg, s)),
@@ -344,15 +342,11 @@
 	if (le == seg->le)
 		return 1;
 
-	if (!_lv_split_segment(lv, seg, le)) {
-		stack;
-		return 0;
-	}
+	if (!_lv_split_segment(lv, seg, le))
+		return_0;
 
-	if (!vg_validate(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_validate(lv->vg))
+		return_0;
 
 	return 1;
 }
--- LVM2/lib/metadata/metadata.c	2008/01/22 16:02:26	1.154
+++ LVM2/lib/metadata/metadata.c	2008/01/30 13:19:46	1.155
@@ -154,10 +154,8 @@
 		return 0;
 	}
 
-	if (!alloc_pv_segment_whole_pv(mem, pv)) {
-		stack;
-		return 0;
-	}
+	if (!alloc_pv_segment_whole_pv(mem, pv))
+		return_0;
 
 	pvl->pv = pv;
 	list_add(&vg->pvs, &pvl->list);
@@ -189,10 +187,8 @@
 	}
 
 	if (!peg_dup(pv_to->fmt->cmd->mem, &pv_to->segments,
-		     &pv_from->segments)) {
-		stack;
-		return 0;
-	}
+		     &pv_from->segments))
+		return_0;
 
 	return 1;
 }
@@ -217,10 +213,8 @@
 
 	list_iterate_items(pvl, &vg->pvs) {
 		if (id_equal(&pvl->pv->id, (const struct id *) pvid)) {
-			if (!_copy_pv(pv, pvl->pv)) {
-				stack;
-				return 0;
-			}
+			if (!_copy_pv(pv, pvl->pv))
+				return_0;
 			return 1;
 		}
 	}
@@ -475,10 +469,8 @@
 	int consistent = 0;
 	int old_partial;
 
-	if (!(vg = dm_pool_zalloc(mem, sizeof(*vg)))) {
-		stack;
-		return NULL;
-	}
+	if (!(vg = dm_pool_zalloc(mem, sizeof(*vg))))
+		return_NULL;
 
 	/* is this vg name already in use ? */
 	old_partial = partial_mode();
@@ -499,10 +491,8 @@
 
 	vg->cmd = cmd;
 
-	if (!(vg->name = dm_pool_strdup(mem, vg_name))) {
-		stack;
-		goto bad;
-	}
+	if (!(vg->name = dm_pool_strdup(mem, vg_name)))
+		goto_bad;
 
 	vg->seqno = 0;
 
@@ -595,22 +585,16 @@
 	vg->extent_size = new_size;
 
 	if (vg->fid->fmt->ops->vg_setup &&
-	    !vg->fid->fmt->ops->vg_setup(vg->fid, vg)) {
-		stack;
-		return 0;
-	}
+	    !vg->fid->fmt->ops->vg_setup(vg->fid, vg))
+		return_0;
 
 	if (!_recalc_extents(&vg->extent_count, vg->name, "", old_size,
-			     new_size)) {
-		stack;
-		return 0;
-	}
+			     new_size))
+		return_0;
 
 	if (!_recalc_extents(&vg->free_count, vg->name, " free space",
-			     old_size, new_size)) {
-		stack;
-		return 0;
-	}
+			     old_size, new_size))
+		return_0;
 
 	/* foreach PV */
 	list_iterate_items(pvl, &vg->pvs) {
@@ -618,16 +602,12 @@
 
 		pv->pe_size = new_size;
 		if (!_recalc_extents(&pv->pe_count, pv_dev_name(pv), "",
-				     old_size, new_size)) {
-			stack;
-			return 0;
-		}
+				     old_size, new_size))
+			return_0;
 
 		if (!_recalc_extents(&pv->pe_alloc_count, pv_dev_name(pv),
-				     " allocated space", old_size, new_size)) {
-			stack;
-			return 0;
-		}
+				     " allocated space", old_size, new_size))
+			return_0;
 
 		/* foreach free PV Segment */
 		list_iterate_items(pvseg, &pv->segments) {
@@ -636,16 +616,12 @@
 
 			if (!_recalc_extents(&pvseg->pe, pv_dev_name(pv),
 					     " PV segment start", old_size,
-					     new_size)) {
-				stack;
-				return 0;
-			}
+					     new_size))
+				return_0;
 			if (!_recalc_extents(&pvseg->len, pv_dev_name(pv),
 					     " PV segment length", old_size,
-					     new_size)) {
-				stack;
-				return 0;
-			}
+					     new_size))
+				return_0;
 		}
 	}
 
@@ -654,39 +630,29 @@
 		lv = lvl->lv;
 
 		if (!_recalc_extents(&lv->le_count, lv->name, "", old_size,
-				     new_size)) {
-			stack;
-			return 0;
-		}
+				     new_size))
+			return_0;
 
 		list_iterate_items(seg, &lv->segments) {
 			if (!_recalc_extents(&seg->le, lv->name,
 					     " segment start", old_size,
-					     new_size)) {
-				stack;
-				return 0;
-			}
+					     new_size))
+				return_0;
 
 			if (!_recalc_extents(&seg->len, lv->name,
 					     " segment length", old_size,
-					     new_size)) {
-				stack;
-				return 0;
-			}
+					     new_size))
+				return_0;
 
 			if (!_recalc_extents(&seg->area_len, lv->name,
 					     " area length", old_size,
-					     new_size)) {
-				stack;
-				return 0;
-			}
+					     new_size))
+				return_0;
 
 			if (!_recalc_extents(&seg->extents_copied, lv->name,
 					     " extents moved", old_size,
-					     new_size)) {
-				stack;
-				return 0;
-			}
+					     new_size))
+				return_0;
 
 			/* foreach area */
 			for (s = 0; s < seg->area_count; s++) {
@@ -696,27 +662,21 @@
 					    (&seg_pe(seg, s),
 					     lv->name,
 					     " pvseg start", old_size,
-					     new_size)) {
-						stack;
-						return 0;
-					}
+					     new_size))
+						return_0;
 					if (!_recalc_extents
 					    (&seg_pvseg(seg, s)->len,
 					     lv->name,
 					     " pvseg length", old_size,
-					     new_size)) {
-						stack;
-						return 0;
-					}
+					     new_size))
+						return_0;
 					break;
 				case AREA_LV:
 					if (!_recalc_extents
 					    (&seg_le(seg, s), lv->name,
 					     " area start", old_size,
-					     new_size)) {
-						stack;
-						return 0;
-					}
+					     new_size))
+						return_0;
 					break;
 				case AREA_UNASSIGNED:
 					log_error("Unassigned area %u found in "
@@ -804,10 +764,8 @@
 {
 	struct physical_volume *pv = dm_pool_zalloc(mem, sizeof(*pv));
 
-	if (!pv) {
-		stack;
-		return NULL;
-	}
+	if (!pv)
+		return_NULL;
 
 	if (!(pv->vg_name = dm_pool_zalloc(mem, NAME_LEN))) {
 		dm_pool_free(mem, pv);
@@ -1074,10 +1032,8 @@
 	/* Remove each copy of the metadata */
 	list_iterate_items(mda, &vg->fid->metadata_areas) {
 		if (mda->ops->vg_remove &&
-		    !mda->ops->vg_remove(vg->fid, vg, mda)) {
-			stack;
-			return 0;
-		}
+		    !mda->ops->vg_remove(vg->fid, vg, mda))
+			return_0;
 	}
 
 	return 1;
@@ -1260,10 +1216,8 @@
 	struct list *mdah;
 	struct metadata_area *mda;
 
-	if (!vg_validate(vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_validate(vg))
+		return_0;
 
 	if (vg->status & PARTIAL_VG) {
 		log_error("Cannot change metadata for partial volume group %s",
@@ -1378,10 +1332,8 @@
 	struct volume_group *vg;
 	struct physical_volume *pv;
 
-	if (!(vginfo = vginfo_from_vgname(ORPHAN, NULL))) {
-		stack;
-		return NULL;
-	}
+	if (!(vginfo = vginfo_from_vgname(ORPHAN, NULL)))
+		return_NULL;
 
 	if (!(vg = dm_pool_zalloc(cmd->mem, sizeof(*vg)))) {
 		log_error("vg allocation failed");
@@ -1477,15 +1429,11 @@
 	if (!(fmt = fmt_from_vgname(vgname, vgid))) {
 		lvmcache_label_scan(cmd, 0);
 		if (!(fmt = fmt_from_vgname(vgname, vgid))) {
-			if (memlock()) {
-				stack;
-				return NULL;
-			}
+			if (memlock())
+				return_NULL;
 			lvmcache_label_scan(cmd, 2);
-			if (!(fmt = fmt_from_vgname(vgname, vgid))) {
-				stack;
-				return NULL;
-			}
+			if (!(fmt = fmt_from_vgname(vgname, vgid)))
+				return_NULL;
 		}
 	}
 
@@ -1493,10 +1441,8 @@
 		use_precommitted = 0;
 
 	/* Store pvids for later so we can check if any are missing */
-	if (!(pvids = lvmcache_get_pvids(cmd, vgname, vgid))) {
-		stack;
-		return NULL;
-	}
+	if (!(pvids = lvmcache_get_pvids(cmd, vgname, vgid)))
+		return_NULL;
 
 	/* create format instance with appropriate metadata area */
 	if (!(fid = fmt->ops->create_instance(fmt, vgname, vgid, NULL))) {
@@ -1551,15 +1497,11 @@
 	if (!correct_vg) {
 		inconsistent = 0;
 
-		if (memlock()) {
-			stack;
-			return NULL;
-		}
+		if (memlock())
+			return_NULL;
 		lvmcache_label_scan(cmd, 2);
-		if (!(fmt = fmt_from_vgname(vgname, vgid))) {
-			stack;
-			return NULL;
-		}
+		if (!(fmt = fmt_from_vgname(vgname, vgid)))
+			return_NULL;
 
 		if (precommitted && !(fmt->features & FMT_PRECOMMIT))
 			use_precommitted = 0;
@@ -1605,10 +1547,8 @@
 		}
 
 		/* Give up looking */
-		if (!correct_vg) {
-			stack;
-			return NULL;
-		}
+		if (!correct_vg)
+			return_NULL;
 	}
 
 	lvmcache_update_vg(correct_vg);
@@ -1837,10 +1777,8 @@
 	struct lvmcache_info *info;
 	struct device *dev;
 
-	if (!(dev = dev_cache_get(pv_name, cmd->filter))) {
-		stack;
-		return NULL;
-	}
+	if (!(dev = dev_cache_get(pv_name, cmd->filter)))
+		return_NULL;
 
 	if (!(label_read(dev, &label, UINT64_C(0)))) {
 		if (warnings)
@@ -1871,10 +1809,8 @@
 	if (!pv->size)
 		return NULL;
 	
-	if (!alloc_pv_segment_whole_pv(cmd->mem, pv)) {
-		stack;
-		return NULL;
-	}
+	if (!alloc_pv_segment_whole_pv(cmd->mem, pv))
+		return_NULL;
 
 	return pv;
 }
@@ -1996,10 +1932,8 @@
 		return 0;
 	}
 
-	if (!pv->fmt->ops->pv_write(pv->fmt, pv, mdas, label_sector)) {
-		stack;
-		return 0;
-	}
+	if (!pv->fmt->ops->pv_write(pv->fmt, pv, mdas, label_sector))
+		return_0;
 
 	return 1;
 }
--- LVM2/lib/metadata/mirror.c	2008/01/26 00:25:04	1.66
+++ LVM2/lib/metadata/mirror.c	2008/01/30 13:19:46	1.67
@@ -1002,10 +1002,8 @@
 {
 	struct physical_volume *pv;
 
-	if (!(pv = find_pv_by_name(cmd, name))) {
-		stack;
-		return NULL;
-	}
+	if (!(pv = find_pv_by_name(cmd, name)))
+		return_NULL;
 
 	return find_pvmove_lv(vg, pv->dev, lv_type);
 }
--- LVM2/lib/metadata/pv_manip.c	2007/11/15 22:11:18	1.18
+++ LVM2/lib/metadata/pv_manip.c	2008/01/30 13:19:46	1.19
@@ -53,10 +53,8 @@
 		return 1;
 
 	/* FIXME Cope with holes in PVs */
-	if (!(peg = _alloc_pv_segment(mem, pv, 0, pv->pe_count, NULL, 0))) {
-		stack;
-		return 0;
-	}
+	if (!(peg = _alloc_pv_segment(mem, pv, 0, pv->pe_count, NULL, 0)))
+		return_0;
 
 	list_add(&pv->segments, &peg->list);
 
@@ -72,10 +70,8 @@
 	list_iterate_items(pego, peg_old) {
 		if (!(peg = _alloc_pv_segment(mem, pego->pv, pego->pe,
 					      pego->len, pego->lvseg,
-					      pego->lv_area))) {
-			stack;
-			return 0;
-		} 
+					      pego->lv_area)))
+			return_0;
 		list_add(peg_new, &peg->list);
 	}
 
@@ -93,10 +89,8 @@
 
 	if (!(peg_new = _alloc_pv_segment(pv->fmt->cmd->mem, peg->pv, pe,
 					  peg->len + peg->pe - pe,
-					  NULL, 0))) {
-		stack;
-		return 0;
-	}
+					  NULL, 0)))
+		return_0;
 
 	peg->len = peg->len - peg_new->len;
 
@@ -130,10 +124,8 @@
 	if (pe == peg->pe)
 		return 1;
 
-	if (!_pv_split_segment(pv, peg, pe)) {
-		stack;
-		return 0;
-	}
+	if (!_pv_split_segment(pv, peg, pe))
+		return_0;
 
 	return 1;
 }
@@ -155,10 +147,8 @@
 		return &null_pv_segment;
 
 	if (!pv_split_segment(pv, pe) || 
-	    !pv_split_segment(pv, pe + area_len)) {
-		stack;
-		return NULL;
-	}
+	    !pv_split_segment(pv, pe + area_len))
+		return_NULL;
 
 	if (!(peg = find_peg_by_pe(pv, pe))) {
 		log_error("Missing PV segment on %s at %u.",
@@ -196,10 +186,8 @@
 	}
 
 	if (!pv_split_segment(peg->pv, peg->pe + peg->lvseg->area_len -
-				       area_reduction)) {
-		stack;
-		return 0;
-	}
+				       area_reduction))
+		return_0;
 
 	return 1;
 }
@@ -371,10 +359,8 @@
 		}
 	}
 
-	if (!pv_split_segment(pv, new_pe_count)) {
-		stack;
-		return 0;
-	}
+	if (!pv_split_segment(pv, new_pe_count))
+		return_0;
 
 	list_iterate_items_safe(peg, pegt, &pv->segments) {
  		if (peg->pe + peg->len > new_pe_count)
--- LVM2/lib/metadata/pv_map.c	2007/10/12 14:29:32	1.29
+++ LVM2/lib/metadata/pv_map.c	2008/01/30 13:19:46	1.30
@@ -40,10 +40,8 @@
 {
 	struct pv_area *pva;
 
-	if (!(pva = dm_pool_zalloc(mem, sizeof(*pva)))) {
-		stack;
-		return 0;
-	}
+	if (!(pva = dm_pool_zalloc(mem, sizeof(*pva))))
+		return_0;
 
 	log_debug("Allowing allocation on %s start PE %" PRIu32 " length %"
 		  PRIu32, pv_dev_name(pvm->pv), start, length);
@@ -88,10 +86,8 @@
 		area_len = (end >= peg->pe + peg->len - 1) ?
 			   peg->len - (pe - peg->pe) : end - pe + 1;
 
-		if (!_create_single_area(mem, pvm, pe, area_len)) {
-			stack;
-			return 0;
-		}
+		if (!_create_single_area(mem, pvm, pe, area_len))
+			return_0;
 
       next:
 		pe = peg->pe + peg->len;
@@ -108,20 +104,16 @@
 	if (!pe_ranges) {
 		/* Use whole PV */
 		if (!_create_alloc_areas_for_pv(mem, pvm, UINT32_C(0),
-						pvm->pv->pe_count)) {
-			stack;
-			return 0;
-		}
+						pvm->pv->pe_count))
+			return_0;
 
 		return 1;
 	}
 
 	list_iterate_items(aa, pe_ranges) {
 		if (!_create_alloc_areas_for_pv(mem, pvm, aa->start,
-						aa->count)) {
-			stack;
-			return 0;
-		}
+						aa->count))
+			return_0;
 	}
 
 	return 1;
@@ -145,20 +137,16 @@
 			}
 
 		if (!pvm) {
-			if (!(pvm = dm_pool_zalloc(mem, sizeof(*pvm)))) {
-				stack;
-				return 0;
-			}
+			if (!(pvm = dm_pool_zalloc(mem, sizeof(*pvm))))
+				return_0;
 
 			pvm->pv = pvl->pv;
 			list_init(&pvm->areas);
 			list_add(pvms, &pvm->list);
 		}
 
-		if (!_create_all_areas_for_pv(mem, pvm, pvl->pe_ranges)) {
-			stack;
-			return 0;
-		}
+		if (!_create_all_areas_for_pv(mem, pvm, pvl->pe_ranges))
+			return_0;
 	}
 
 	return 1;
--- LVM2/lib/metadata/snapshot_manip.c	2007/11/07 16:33:12	1.29
+++ LVM2/lib/metadata/snapshot_manip.c	2008/01/30 13:19:46	1.30
@@ -70,17 +70,13 @@
 
 	if (!(snap = lv_create_empty(name ? name : "snapshot%d",
 				     lvid, LVM_READ | LVM_WRITE | VISIBLE_LV,
-				     ALLOC_INHERIT, 1, origin->vg))) {
-		stack;
-		return 0;
-	}
+				     ALLOC_INHERIT, 1, origin->vg)))
+		return_0;
 
 	snap->le_count = extent_count;
 
-	if (!(seg = alloc_snapshot_seg(snap, 0, 0))) {
-		stack;
-		return 0;
-	}
+	if (!(seg = alloc_snapshot_seg(snap, 0, 0)))
+		return_0;
 
 	seg->chunk_size = chunk_size;
 	seg->origin = origin;
--- LVM2/lib/mirror/mirrored.c	2008/01/17 17:17:09	1.49
+++ LVM2/lib/mirror/mirrored.c	2008/01/30 13:19:46	1.50
@@ -555,10 +555,8 @@
 {
 	struct segment_type *segtype = dm_malloc(sizeof(*segtype));
 
-	if (!segtype) {
-		stack;
-		return NULL;
-	}
+	if (!segtype)
+		return_NULL;
 
 	segtype->cmd = cmd;
 	segtype->ops = &_mirrored_ops;
--- LVM2/lib/report/report.c	2008/01/29 23:45:48	1.73
+++ LVM2/lib/report/report.c	2008/01/30 13:19:46	1.74
@@ -583,10 +583,8 @@
 	const char *disp, *repstr;
 	uint64_t *sortval;
 
-	if (!*(disp = display_size_units(private, (uint64_t) size))) {
-		stack;
-		return 0;
-	}
+	if (!*(disp = display_size_units(private, (uint64_t) size)))
+		return_0;
 
 	if (!(repstr = dm_pool_strdup(mem, disp))) {
 		log_error("dm_pool_strdup failed");
@@ -614,10 +612,8 @@
 	const char *disp, *repstr;
 	uint64_t *sortval;
 
-	if (!*(disp = display_size_units(private, size))) {
-		stack;
-		return 0;
-	}
+	if (!*(disp = display_size_units(private, size)))
+		return_0;
 
 	if (!(repstr = dm_pool_strdup(mem, disp))) {
 		log_error("dm_pool_strdup failed");
@@ -809,10 +805,8 @@
 		return 0;
 	}
 
-	if (!id_write_format((const struct id *) data, repstr, 40)) {
-		stack;
-		return 0;
-	}
+	if (!id_write_format((const struct id *) data, repstr, 40))
+		return_0;
 
 	dm_report_field_set_value(field, repstr, NULL);
 	return 1;
--- LVM2/lib/snapshot/snapshot.c	2008/01/11 17:44:26	1.26
+++ LVM2/lib/snapshot/snapshot.c	2008/01/30 13:19:46	1.27
@@ -74,10 +74,8 @@
 	}
 
 	if (!vg_add_snapshot(seg->lv->name, org, cow,
-			     &seg->lv->lvid, seg->len, chunk_size)) {
-		stack;
-		return 0;
-	}
+			     &seg->lv->lvid, seg->len, chunk_size))
+		return_0;
 
 	return 1;
 }
@@ -304,10 +302,8 @@
 	char *dso;
 #endif
 
-	if (!segtype) {
-		stack;
-		return NULL;
-	}
+	if (!segtype)
+		return_NULL;
 
 	segtype->cmd = cmd;
 	segtype->ops = &_snapshot_ops;
--- LVM2/lib/striped/striped.c	2007/08/20 20:55:27	1.22
+++ LVM2/lib/striped/striped.c	2008/01/30 13:19:46	1.23
@@ -213,10 +213,8 @@
 {
 	struct segment_type *segtype = dm_malloc(sizeof(*segtype));
 
-	if (!segtype) {
-		stack;
-		return NULL;
-	}
+	if (!segtype)
+		return_NULL;
 
 	segtype->cmd = cmd;
 	segtype->ops = &_striped_ops;
--- LVM2/lib/zero/zero.c	2007/08/22 14:38:18	1.14
+++ LVM2/lib/zero/zero.c	2008/01/30 13:19:46	1.15
@@ -96,10 +96,8 @@
 {
 	struct segment_type *segtype = dm_malloc(sizeof(*segtype));
 
-	if (!segtype) {
-		stack;
-		return NULL;
-	}
+	if (!segtype)
+		return_NULL;
 
 	segtype->cmd = cmd;
 	segtype->ops = &_zero_ops;
--- LVM2/tools/lvchange.c	2008/01/26 00:25:04	1.87
+++ LVM2/tools/lvchange.c	2008/01/30 13:19:46	1.88
@@ -53,10 +53,8 @@
 	}
 
 	log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
-	if (!vg_write(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_write(lv->vg))
+		return_0;
 
 	backup(lv->vg);
 
@@ -114,16 +112,12 @@
 	if (activate == CHANGE_ALN) {
 		log_verbose("Deactivating logical volume \"%s\" locally",
 			    lv->name);
-		if (!deactivate_lv_local(cmd, lv)) {
-			stack;
-			return 0;
-		}
+		if (!deactivate_lv_local(cmd, lv))
+			return_0;
 	} else if (activate == CHANGE_AN) {
 		log_verbose("Deactivating logical volume \"%s\"", lv->name);
-		if (!deactivate_lv(cmd, lv)) {
-			stack;
-			return 0;
-		}
+		if (!deactivate_lv(cmd, lv))
+			return_0;
 	} else {
 		if (lockingfailed() && (lv->vg->status & CLUSTERED)) {
 			log_verbose("Locking failed: ignoring clustered "
@@ -134,24 +128,18 @@
 		if (lv_is_origin(lv) || (activate == CHANGE_AE)) {
 			log_verbose("Activating logical volume \"%s\" "
 				    "exclusively", lv->name);
-			if (!activate_lv_excl(cmd, lv)) {
-				stack;
-				return 0;
-			}
+			if (!activate_lv_excl(cmd, lv))
+				return_0;
 		} else if (activate == CHANGE_ALY) {
 			log_verbose("Activating logical volume \"%s\" locally",
 				    lv->name);
-			if (!activate_lv_local(cmd, lv)) {
-				stack;
-				return 0;
-			}
+			if (!activate_lv_local(cmd, lv))
+				return_0;
 		} else {
 			log_verbose("Activating logical volume \"%s\"",
 				    lv->name);
-			if (!activate_lv(cmd, lv)) {
-				stack;
-				return 0;
-			}
+			if (!activate_lv(cmd, lv))
+				return_0;
 		}
 
 		if ((lv->status & LOCKED) &&
@@ -357,18 +345,14 @@
 
 	log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
 
-	if (!vg_write(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_write(lv->vg))
+		return_0;
 
 	backup(lv->vg);
 
 	/* No need to suspend LV for this change */
-	if (!vg_commit(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_commit(lv->vg))
+		return_0;
 
 	return 1;
 }
@@ -407,10 +391,8 @@
 		    lv->name);
 
 	log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
-	if (!vg_write(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_write(lv->vg))
+		return_0;
 
 	backup(lv->vg);
 
@@ -488,17 +470,13 @@
 	}
 
 	log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
-	if (!vg_write(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_write(lv->vg))
+		return_0;
 
 	backup(lv->vg);
 
-	if (!vg_commit(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_commit(lv->vg))
+		return_0;
 
 	if (active) {
 		log_verbose("Re-activating logical volume \"%s\"", lv->name);
@@ -542,18 +520,14 @@
 	}
 
 	log_very_verbose("Updating logical volume \"%s\" on disk(s)", lv->name);
-	if (!vg_write(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_write(lv->vg))
+		return_0;
 
 	backup(lv->vg);
 
 	/* No need to suspend LV for this change */
-	if (!vg_commit(lv->vg)) {
-		stack;
-		return 0;
-	}
+	if (!vg_commit(lv->vg))
+		return_0;
 
 	return 1;
 }
--- LVM2/tools/lvconvert.c	2008/01/16 22:54:49	1.57
+++ LVM2/tools/lvconvert.c	2008/01/30 13:19:46	1.58
@@ -743,21 +743,19 @@
 	if (!(lvl = find_lv_in_vg(vg, lp.lv_name))) {
 		log_error("Logical volume \"%s\" not found in "
 			  "volume group \"%s\"", lp.lv_name, lp.vg_name);
-		goto error;
+		goto bad;
 	}
 
 	if (lp.pv_count) {
 		if (!(lp.pvh = create_pv_list(cmd->mem, vg, lp.pv_count,
-					      lp.pvs, 1))) {
-			stack;
-			goto error;
-		}
+					      lp.pvs, 1)))
+			goto_bad;
 	} else
 		lp.pvh = &vg->pvs;
 
 	ret = lvconvert_single(cmd, lvl->lv, &lp);
 
-error:
+bad:
 	unlock_vg(cmd, lp.vg_name);
 
 	if (ret == ECMD_PROCESSED && lp.need_polling) {
--- LVM2/tools/lvcreate.c	2008/01/18 22:02:37	1.170
+++ LVM2/tools/lvcreate.c	2008/01/30 13:19:46	1.171
@@ -135,10 +135,8 @@
 		if ((ptr = strrchr(lp->lv_name, '/')))
 			lp->lv_name = ptr + 1;
 
-		if (!apply_lvname_restrictions(lp->lv_name)) {
-			stack;
-			return 0;
-		}
+		if (!apply_lvname_restrictions(lp->lv_name))
+			return_0;
 
 		if (!validate_name(lp->lv_name)) {
 			log_error("Logical volume name \"%s\" is invalid",
@@ -385,10 +383,8 @@
 		}
 		log_verbose("Setting chunksize to %d sectors.", lp->chunk_size);
 
-		if (!(lp->segtype = get_segtype_from_string(cmd, "snapshot"))) {
-			stack;
-			return 0;
-		}
+		if (!(lp->segtype = get_segtype_from_string(cmd, "snapshot")))
+			return_0;
 	} else {
 		if (arg_count(cmd, chunksize_ARG)) {
 			log_error("-c is only available with snapshots");
@@ -409,10 +405,8 @@
 			return 0;
 		}
 
-		if (!(lp->segtype = get_segtype_from_string(cmd, "striped"))) {
-			stack;
-			return 0;
-		}
+		if (!(lp->segtype = get_segtype_from_string(cmd, "striped")))
+			return_0;
 	} else {
 		if (arg_count(cmd, corelog_ARG)) {
 			log_error("--corelog is only available with mirrors");
@@ -435,10 +429,8 @@
 	if (!_lvcreate_name_params(lp, cmd, &argc, &argv) ||
 	    !_read_size_params(lp, cmd) ||
 	    !_read_stripe_params(lp, cmd) ||
-	    !_read_mirror_params(lp, cmd)) {
-		stack;
-		return 0;
-	}
+	    !_read_mirror_params(lp, cmd))
+		return_0;
 
 	/*
 	 * Should we zero the lv.
@@ -557,10 +549,8 @@
 	 */
 	if (lp->pv_count) {
 		if (!(pvh = create_pv_list(cmd->mem, vg,
-					   lp->pv_count, lp->pvs, 1))) {
-			stack;
-			return 0;
-		}
+					   lp->pv_count, lp->pvs, 1)))
+			return_0;
 	} else
 		pvh = &vg->pvs;
 
@@ -712,10 +702,8 @@
 
 	/* The snapshot segment gets created later */
 	if (lp->snapshot &&
-	    !(lp->segtype = get_segtype_from_string(cmd, "striped"))) {
-		stack;
-		return 0;
-	}
+	    !(lp->segtype = get_segtype_from_string(cmd, "striped")))
+		return_0;
 
 	if (!archive(vg))
 		return 0;
@@ -754,10 +742,8 @@
 	}
 
 	if (!(lv = lv_create_empty(lv_name ? lv_name : "lvol%d", NULL,
-				   status, lp->alloc, 0, vg))) {
-		stack;
-		goto error;
-	}
+				   status, lp->alloc, 0, vg)))
+		return_0;
 
 	if (lp->read_ahead) {
 		log_verbose("Setting read ahead sectors");
@@ -775,7 +761,7 @@
 	if (tag && !str_list_add(cmd->mem, &lv->tags, tag)) {
 		log_error("Failed to add tag %s to %s/%s",
 			  tag, lv->vg->name, lv->name);
-		goto error;
+		return 0;
 	}
 
 	if (!lv_extend(lv, lp->segtype, lp->stripes, lp->stripe_size,
@@ -880,9 +866,6 @@
 
 	return 1;
 
-error:
-	return 0;
-
 deactivate_and_revert_new_lv:
 	if (!deactivate_lv(cmd, lv)) {
 		log_error("Unable to deactivate failed new LV. "
--- LVM2/tools/lvmcmdline.c	2008/01/16 18:15:26	1.59
+++ LVM2/tools/lvmcmdline.c	2008/01/30 13:19:47	1.60
@@ -1028,10 +1028,8 @@
 
 	_cmdline.the_args = &_the_args[0];
 
-	if (!(cmd = create_toolcontext(_cmdline.the_args, is_static, 0))) {
-		stack;
-		return NULL;
-	}
+	if (!(cmd = create_toolcontext(_cmdline.the_args, is_static, 0)))
+		return_NULL;
 
 	_init_rand();
 
--- LVM2/tools/lvresize.c	2007/12/20 18:55:46	1.90
+++ LVM2/tools/lvresize.c	2008/01/30 13:19:47	1.91
@@ -150,19 +150,13 @@
 		return 0;
 	}
 
-	if (!lp->nofsck) {
-		if (!exec_cmd("fsadm", "check", lv_path, NULL)) {
-			stack;
-			return 0;
-		}
-	}
-
-	if (lp->resize == LV_REDUCE) {
-		if (!exec_cmd("fsadm", "resize", lv_path, size_buf)) {
-			stack;
-			return 0;
-		}
-	}
+	if (!lp->nofsck)
+		if (!exec_cmd("fsadm", "check", lv_path, NULL))
+			return_0;
+
+	if (lp->resize == LV_REDUCE)
+		if (!exec_cmd("fsadm", "resize", lv_path, size_buf))
+			return_0;
 
 	return 1;
 }
--- LVM2/tools/pvchange.c	2007/11/15 02:20:03	1.56
+++ LVM2/tools/pvchange.c	2008/01/30 13:19:47	1.57
@@ -164,9 +164,8 @@
 			return 0;
 		}
 		if (!id_write_format(&pv->id, uuid, sizeof(uuid))) {
-			stack;
 			unlock_vg(cmd, vg_name);
-			return 0;
+			return_0;
 		}
 		log_verbose("Changing uuid of %s to %s.", pv_name, uuid);
 		if (!is_orphan(pv)) {
--- LVM2/tools/pvmove.c	2007/12/22 12:13:29	1.46
+++ LVM2/tools/pvmove.c	2008/01/30 13:19:47	1.47
@@ -71,18 +71,13 @@
 	struct list *allocatable_pvs, *pvht, *pvh;
 	struct pv_list *pvl;
 
-	if (argc) {
-		if (!(allocatable_pvs = create_pv_list(cmd->mem, vg, argc,
-						       argv, 1))) {
-			stack;
-			return NULL;
-		}
-	} else {
-		if (!(allocatable_pvs = clone_pv_list(cmd->mem, &vg->pvs))) {
-			stack;
-			return NULL;
-		}
-	}
+	if (argc)
+		allocatable_pvs = create_pv_list(cmd->mem, vg, argc, argv, 1);
+	else
+		allocatable_pvs = clone_pv_list(cmd->mem, &vg->pvs);
+
+	if (!allocatable_pvs)
+		return_NULL;
 
 	list_iterate_safe(pvh, pvht, allocatable_pvs) {
 		pvl = list_item(pvh, struct pv_list);
@@ -197,10 +192,8 @@
 			continue;
 		}
 		if (!_insert_pvmove_mirrors(cmd, lv_mirr, source_pvl, lv,
-					    *lvs_changed)) {
-			stack;
-			return NULL;
-		}
+					    *lvs_changed))
+			return_NULL;
 	}
 
 	/* Is temporary mirror empty? */
@@ -236,10 +229,8 @@
 	backup(vg);
 
 	/* Suspend lvs_changed */
-	if (!suspend_lvs(cmd, lvs_changed)) {
-		stack;
-		return 0;
-	}
+	if (!suspend_lvs(cmd, lvs_changed))
+		return_0;
 
 	/* Suspend mirrors on subsequent calls */
 	if (!first_time) {
--- LVM2/tools/pvresize.c	2007/11/16 21:16:20	1.19
+++ LVM2/tools/pvresize.c	2008/01/30 13:19:47	1.20
@@ -144,9 +144,8 @@
 		}
 
 		if (!pv_resize(pv, vg, new_pe_count)) {
-			stack;
 			unlock_vg(cmd, vg_name);
-			return 0;
+			return_0;
 		}
 	}
 
--- LVM2/tools/toollib.c	2008/01/17 17:17:09	1.128
+++ LVM2/tools/toollib.c	2008/01/30 13:19:47	1.129
@@ -978,10 +978,8 @@
 
 	/* Default to whole PV */
 	if (!c) {
-		if (!_add_pe_range(mem, pvname, pe_ranges, UINT32_C(0), size)) {
-			stack;
-			return 0;
-		}
+		if (!_add_pe_range(mem, pvname, pe_ranges, UINT32_C(0), size))
+			return_0;
 		return 1;
 	}
 
@@ -1026,10 +1024,8 @@
 			return 0;
 		}
 
-		if (!_add_pe_range(mem, pvname, pe_ranges, start, end - start + 1)) {
-			stack;
-			return 0;
-		}
+		if (!_add_pe_range(mem, pvname, pe_ranges, start, end - start + 1))
+			return_0;
 
 	}
 
@@ -1084,10 +1080,8 @@
 
 	/* Determine selected physical extents */
 	if (!_parse_pes(mem, colon, new_pvl->pe_ranges, pv_dev_name(pvl->pv),
-			pvl->pv->pe_count)) {
-		stack;
-		return 0;
-	}
+			pvl->pv->pe_count))
+		return_0;
 
 	return 1;
 }
@@ -1124,10 +1118,8 @@
 							tagname)) {
 					if (!_create_pv_entry(mem, pvl, NULL,
 							      allocatable_only,
-							      r)) {
-						stack;
-						return NULL;
-					}
+							      r))
+						return_NULL;
 				}
 			}
 			continue;
@@ -1149,10 +1141,8 @@
 				"Volume Group \"%s\"", pvname, vg->name);
 			return NULL;
 		}
-		if (!_create_pv_entry(mem, pvl, colon, allocatable_only, r)) {
-			stack;
-			return NULL;
-		}
+		if (!_create_pv_entry(mem, pvl, colon, allocatable_only, r))
+			return_NULL;
 	}
 
 	if (list_empty(r))
--- LVM2/tools/vgmerge.c	2008/01/16 19:54:39	1.43
+++ LVM2/tools/vgmerge.c	2008/01/30 13:19:47	1.44
@@ -42,12 +42,12 @@
 	}
 
 	if (!vgs_are_compatible(cmd, vg_from, vg_to))
-	    goto error;
+		goto_bad;
 
 	/* FIXME List arg: vg_show_with_pv_and_lv(vg_to); */
 
 	if (!archive(vg_from) || !archive(vg_to))
-		goto error;
+		goto_bad;
 
 	/* Merge volume groups */
 	while (!list_empty(&vg_from->pvs)) {
@@ -75,13 +75,11 @@
 					log_error("Failed to generate new "
 						  "random LVID for %s",
 						  lvl2->lv->name);
-					goto error;
+					goto bad;
 				}
                 		if (!id_write_format(&lvid2->id[1], uuid,
-						     sizeof(uuid))) {
-                        		stack;
-                        		goto error;
-		                }
+						     sizeof(uuid)))
+                        		goto_bad;
 
 				log_verbose("Changed LVID for %s to %s",
 					    lvl2->lv->name, uuid);
@@ -110,9 +108,8 @@
 
 	/* store it on disks */
 	log_verbose("Writing out updated volume group");
-	if (!vg_write(vg_to) || !vg_commit(vg_to)) {
-		goto error;
-	}
+	if (!vg_write(vg_to) || !vg_commit(vg_to))
+		goto_bad;
 
 	/* FIXME Remove /dev/vgfrom */
 
@@ -125,7 +122,7 @@
 		  vg_from->name, vg_to->name);
 	return ECMD_PROCESSED;
 
-      error:
+      bad:
 	unlock_vg(cmd, vg_name_from);
 	unlock_vg(cmd, vg_name_to);
 	return ECMD_FAILED;
--- LVM2/tools/vgreduce.c	2008/01/17 13:54:05	1.75
+++ LVM2/tools/vgreduce.c	2008/01/30 13:19:47	1.76
@@ -25,10 +25,8 @@
 		return 0;
 	}
 
-	if (!id_write_format(&pvl->pv->id, uuid, sizeof(uuid))) {
-		stack;
-		return 0;
-	}
+	if (!id_write_format(&pvl->pv->id, uuid, sizeof(uuid)))
+		return_0;
 
 	log_verbose("Removing PV with UUID %s from VG %s", uuid, vg->name);
 
@@ -91,16 +89,12 @@
 		}
 
 		*list_unsafe = 1;	/* May remove caller's lvht! */
-		if (!vg_remove_snapshot(cow)) {
-			stack;
-			return 0;
-		}
+		if (!vg_remove_snapshot(cow))
+			return_0;
 		log_verbose("Removing LV %s from VG %s", cow->name,
 			    lv->vg->name);
-		if (!lv_remove(cow)) {
-			stack;
-			return 0;
-		}
+		if (!lv_remove(cow))
+			return_0;
 
 		first = 0;
 	}
@@ -129,10 +123,8 @@
 	} else {
 		/* Remove LV immediately. */
 		log_verbose("Removing LV %s from VG %s", lv->name, lv->vg->name);
-		if (!lv_remove(lv)) {
-			stack;
-			return 0;
-		}
+		if (!lv_remove(lv))
+			return_0;
 	}
 
 	return 1;
@@ -177,10 +169,8 @@
 						only_mirror_images_found = 0;
 						continue;
 					}
-					if (!_remove_lv(cmd, lv, &list_unsafe, &lvs_changed)) {
-						stack;
-						return 0;
-					}
+					if (!_remove_lv(cmd, lv, &list_unsafe, &lvs_changed))
+						return_0;
 					if (list_unsafe)
 						goto restart_loop;
 				}
@@ -198,10 +188,8 @@
 		pvl = list_item(pvh, struct pv_list);
 		if (pvl->pv->dev)
 			continue;
-		if (!_remove_pv(vg, pvl)) {
-			stack;
-			return 0;
-		}
+		if (!_remove_pv(vg, pvl))
+			return_0;
 	}
 
 	/* VG is now consistent */
@@ -223,10 +211,9 @@
 			/* Suspend lvs_changed */
 			init_partial(1);
 			if (!suspend_lvs(cmd, &lvs_changed)) {
-				stack;
 				init_partial(0);
 				vg_revert(vg);
-				return 0;
+				return_0;
 			}
 			init_partial(0);
 		}
@@ -290,10 +277,8 @@
 
 			if ((mimages != mirrored_seg->area_count) || remove_log){
 				if (!reconfigure_mirror_images(mirrored_seg, mimages,
-							       NULL, remove_log)) {
-					stack;
-					return 0;
-				}
+							       NULL, remove_log))
+					return_0;
 
 				if (!vg_write(vg)) {
 					log_error("Failed to write out updated "
@@ -353,10 +338,8 @@
 				    lvl->lv->vg->name);
 				/* Skip LVs already removed by mirror code */
 				if (find_lv_in_vg(vg, lvl->lv->name) &&
-				    !lv_remove(lvl->lv)) {
-				stack;
-				return 0;
-			}
+				    !lv_remove(lvl->lv))
+					return_0;
 		}
 	}
 


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2007-05-15 14:42 mbroz
  0 siblings, 0 replies; 25+ messages in thread
From: mbroz @ 2007-05-15 14:42 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2007-05-15 14:42:02

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c fs.c fs.h 

Log message:
	Remove symlinks if parent volume is deactivated.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.617&r2=1.618
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.123&r2=1.124
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.h.diff?cvsroot=lvm2&r1=1.10&r2=1.11

--- LVM2/WHATS_NEW	2007/05/15 13:01:40	1.617
+++ LVM2/WHATS_NEW	2007/05/15 14:42:01	1.618
@@ -1,5 +1,6 @@
 Version 2.02.26 -
 =================================
+  Remove symlinks if parent volume is deactivated.
   Fix and clarify vgsplit error messages.
   Fix a segfault if a device has no target (no table)
   Add some more debuglogs to clvmd startup.
--- LVM2/lib/activate/dev_manager.c	2007/05/14 11:27:34	1.123
+++ LVM2/lib/activate/dev_manager.c	2007/05/15 14:42:01	1.124
@@ -937,6 +937,10 @@
 	return 1;
 }
 
+/* FIXME: symlinks should be created/destroyed at the same time
+ * as the kernel devices but we can't do that from within libdevmapper
+ * at present so we must walk the tree twice instead. */
+
 /*
  * Create LV symlinks for children of supplied root node.
  */
@@ -969,6 +973,32 @@
 	return r;
 }
 
+/*
+ * Remove LV symlinks for children of supplied root node.
+ */
+static int _remove_lv_symlinks(struct dev_manager *dm, struct dm_tree_node *root)
+{
+	void *handle = NULL;
+	struct dm_tree_node *child;
+	char *vgname, *lvname, *layer;
+	int r = 1;
+
+	while ((child = dm_tree_next_child(&handle, root, 0))) {
+        	if (!dm_split_lvm_name(dm->mem, dm_tree_node_get_name(child), &vgname, &lvname, &layer)) {
+			r = 0;
+			continue;
+		}
+
+		/* only top level layer has symlinks */
+		if (*layer)
+			continue;
+
+		fs_del_lv_byname(dm->cmd->dev_dir, vgname, lvname);
+	}
+
+	return r;
+}
+
 static int _clean_tree(struct dev_manager *dm, struct dm_tree_node *root)
 {
 	void *handle = NULL;
@@ -1028,6 +1058,8 @@
  		/* Deactivate LV and all devices it references that nothing else has open. */
 		if (!dm_tree_deactivate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
 			goto_out;
+		if (!_remove_lv_symlinks(dm, root))
+			log_error("Failed to remove all device symlinks associated with %s.", lv->name);
 		break;
 	case SUSPEND:
 		dm_tree_skip_lockfs(root);
--- LVM2/lib/activate/fs.c	2006/08/21 12:54:51	1.38
+++ LVM2/lib/activate/fs.c	2007/05/15 14:42:01	1.39
@@ -338,6 +338,11 @@
 		      "", "");
 }
 
+int fs_del_lv_byname(const char *dev_dir, const char *vg_name, const char *lv_name)
+{
+	return _fs_op(FS_DEL, dev_dir, vg_name, lv_name, "", "");
+}
+
 int fs_rename_lv(struct logical_volume *lv,
 		 const char *dev, const char *old_name)
 {
--- LVM2/lib/activate/fs.h	2004/03/30 19:35:37	1.10
+++ LVM2/lib/activate/fs.h	2007/05/15 14:42:01	1.11
@@ -25,6 +25,7 @@
  */
 int fs_add_lv(const struct logical_volume *lv, const char *dev);
 int fs_del_lv(const struct logical_volume *lv);
+int fs_del_lv_byname(const char *dev_dir, const char *vg_name, const char *lv_name);
 int fs_rename_lv(struct logical_volume *lv,
 		 const char *dev, const char *old_name);
 void fs_unlock(void);


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2006-11-30 23:11 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2006-11-30 23:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-11-30 23:11:42

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/cache      : lvmcache.c 
	lib/device     : dev-io.c device.c 
	lib/display    : display.c 
	lib/format1    : disk-rep.c disk-rep.h lvm1-label.c 
	lib/format_pool: disk_rep.c disk_rep.h pool_label.c 
	lib/format_text: format-text.c import_vsn1.c text_label.c 
	lib/label      : label.c label.h 
	lib/locking    : cluster_locking.c locking.c 
	lib/metadata   : metadata.c 
	tools          : pvchange.c pvscan.c vgmerge.c vgreduce.c 

Log message:
	Adjust some alignments for ia64 and sparc.
	(Some of the changes are probably unnecessary.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.511&r2=1.512
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.116&r2=1.117
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.69&r2=1.70
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.64&r2=1.65
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.h.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format1/lvm1-label.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/pool_label.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.69&r2=1.70
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_label.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.h.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.101&r2=1.102
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvchange.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/pvscan.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54

--- LVM2/WHATS_NEW	2006/11/30 17:52:47	1.511
+++ LVM2/WHATS_NEW	2006/11/30 23:11:39	1.512
@@ -1,5 +1,6 @@
 Version 2.02.16 -
 ====================================
+  Adjust some alignments for ia64/sparc.
   Fix mirror segment removal to use temporary error segment.
   Always compile debug logging into clvmd.
   Add startup timeout to RHEL4 clvmd startup script.
--- LVM2/lib/activate/dev_manager.c	2006/11/20 16:45:45	1.116
+++ LVM2/lib/activate/dev_manager.c	2006/11/30 23:11:39	1.117
@@ -1072,7 +1072,7 @@
 {
 	struct dm_tree *dtree;
 	struct dm_tree_node *root;
-	char dlid[sizeof(UUID_PREFIX) + sizeof(struct id) - 1];
+	char dlid[sizeof(UUID_PREFIX) + sizeof(struct id) - 1] __attribute((aligned(8)));
 	int r = 1;
 
 	if (!(dtree = dm_tree_create())) {
--- LVM2/lib/cache/lvmcache.c	2006/08/01 14:56:32	1.28
+++ LVM2/lib/cache/lvmcache.c	2006/11/30 23:11:39	1.29
@@ -114,7 +114,7 @@
 	struct list *devh, *tmp;
 	struct list devs;
 	struct device_list *devl;
-	char vgid_found[ID_LEN + 1];
+	char vgid_found[ID_LEN + 1] __attribute((aligned(8)));
 
 	if (!(vginfo = vginfo_from_vgname(vgname, vgid)))
 		return NULL;
@@ -151,7 +151,7 @@
 struct lvmcache_vginfo *vginfo_from_vgid(const char *vgid)
 {
 	struct lvmcache_vginfo *vginfo;
-	char id[ID_LEN + 1];
+	char id[ID_LEN + 1] __attribute((aligned(8)));
 
 	if (!_vgid_hash || !vgid)
 		return NULL;
@@ -186,7 +186,7 @@
 struct lvmcache_info *info_from_pvid(const char *pvid)
 {
 	struct lvmcache_info *info;
-	char id[ID_LEN + 1];
+	char id[ID_LEN + 1] __attribute((aligned(8)));
 
 	if (!_pvid_hash || !pvid)
 		return NULL;
@@ -476,7 +476,8 @@
 			  struct lvmcache_vginfo *primary_vginfo)
 {
 	struct lvmcache_vginfo *last_vginfo = primary_vginfo;
-	char uuid_primary[64], uuid_new[64];
+	char uuid_primary[64] __attribute((aligned(8)));
+	char uuid_new[64] __attribute((aligned(8)));
 	int use_new = 0;
 	
 	/* Pre-existing VG takes precedence. Unexported VG takes precedence. */
@@ -709,7 +710,7 @@
 {
 	struct pv_list *pvl;
 	struct lvmcache_info *info;
-	char pvid_s[ID_LEN + 1];
+	char pvid_s[ID_LEN + 1] __attribute((aligned(8)));
 
 	pvid_s[sizeof(pvid_s) - 1] = '\0';
 
@@ -733,7 +734,7 @@
 {
 	struct label *label;
 	struct lvmcache_info *existing, *info;
-	char pvid_s[ID_LEN + 1];
+	char pvid_s[ID_LEN + 1] __attribute((aligned(8)));
 
 	if (!_vgname_hash && !lvmcache_init()) {
 		log_error("Internal cache initialisation failed");
--- LVM2/lib/device/dev-io.c	2006/08/17 18:23:43	1.54
+++ LVM2/lib/device/dev-io.c	2006/11/30 23:11:40	1.55
@@ -605,7 +605,7 @@
 int dev_set(struct device *dev, uint64_t offset, size_t len, int value)
 {
 	size_t s;
-	char buffer[4096];
+	char buffer[4096] __attribute((aligned(8)));
 
 	if (!dev_open(dev)) {
 		stack;
--- LVM2/lib/device/device.c	2006/05/11 17:58:58	1.21
+++ LVM2/lib/device/device.c	2006/11/30 23:11:40	1.22
@@ -53,7 +53,7 @@
 {
 	int ret = 0;
 	unsigned p;
-	uint8_t buf[SECTOR_SIZE];
+	uint16_t buf[SECTOR_SIZE/sizeof(uint16_t)];
 	uint16_t *part_magic;
 	struct partition *part;
 
@@ -70,7 +70,7 @@
 	/* FIXME Check for other types of partition table too */
 
 	/* Check for msdos partition table */
-	part_magic = (uint16_t *)(buf + PART_MAGIC_OFFSET);
+	part_magic = buf + PART_MAGIC_OFFSET/sizeof(buf[0]);
 	if ((*part_magic == xlate16(PART_MAGIC))) {
 		part = (struct partition *) (buf + PART_OFFSET);
 		for (p = 0; p < 4; p++, part++) {
--- LVM2/lib/display/display.c	2006/11/10 18:24:11	1.69
+++ LVM2/lib/display/display.c	2006/11/30 23:11:40	1.70
@@ -234,7 +234,7 @@
 
 void pvdisplay_colons(struct physical_volume *pv)
 {
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 
 	if (!pv)
 		return;
@@ -262,7 +262,7 @@
 void pvdisplay_full(struct cmd_context *cmd, struct physical_volume *pv,
 		    void *handle __attribute((unused)))
 {
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 	const char *size;
 
 	uint32_t pe_free;
@@ -324,7 +324,7 @@
 		    struct physical_volume *pv,
 		    void *handle __attribute((unused)))
 {
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 
 	if (!pv)
 		return 0;
@@ -371,7 +371,7 @@
 {
 	struct lvinfo info;
 	int inkernel, snap_active = 0;
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 	struct lv_segment *snap_seg = NULL;
 	float snap_percent;	/* fused, fsize; */
 
@@ -537,7 +537,7 @@
 {
 	uint32_t access;
 	uint32_t active_pvs;
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 
 	if (vg->status & PARTIAL_VG)
 		active_pvs = list_size(&vg->pvs);
@@ -616,7 +616,7 @@
 {
 	uint32_t active_pvs;
 	const char *access;
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 
 	if (vg->status & PARTIAL_VG)
 		active_pvs = list_size(&vg->pvs);
--- LVM2/lib/format1/disk-rep.c	2006/08/01 14:56:32	1.64
+++ LVM2/lib/format1/disk-rep.c	2006/11/30 23:11:40	1.65
@@ -248,7 +248,7 @@
 {
 	unsigned num_read = 0;
 	struct uuid_list *ul;
-	char buffer[NAME_LEN];
+	char buffer[NAME_LEN] __attribute((aligned(8)));
 	uint64_t pos = data->pvd.pv_uuidlist_on_disk.base;
 	uint64_t end = pos + data->pvd.pv_uuidlist_on_disk.size;
 
--- LVM2/lib/format1/disk-rep.h	2006/10/19 12:53:46	1.49
+++ LVM2/lib/format1/disk-rep.h	2006/11/30 23:11:40	1.50
@@ -148,7 +148,7 @@
 
 struct uuid_list {
 	struct list list;
-	char uuid[NAME_LEN];
+	char uuid[NAME_LEN] __attribute((aligned(8)));
 };
 
 struct lvd_list {
@@ -161,11 +161,11 @@
 	struct dm_pool *mem;
 	struct device *dev;
 
-	struct pv_disk pvd;
-	struct vg_disk vgd;
-	struct list uuids;
-	struct list lvds;
-	struct pe_disk *extents;
+	struct pv_disk pvd __attribute((aligned(8)));
+	struct vg_disk vgd __attribute((aligned(8)));
+	struct list uuids __attribute((aligned(8)));
+	struct list lvds __attribute((aligned(8)));
+	struct pe_disk *extents __attribute((aligned(8)));
 };
 
 /*
--- LVM2/lib/format1/lvm1-label.c	2006/05/09 21:23:50	1.13
+++ LVM2/lib/format1/lvm1-label.c	2006/11/30 23:11:40	1.14
@@ -30,7 +30,7 @@
 		op);
 }
 
-static int _lvm1_can_handle(struct labeller *l, char *buf, uint64_t sector)
+static int _lvm1_can_handle(struct labeller *l, void *buf, uint64_t sector)
 {
 	struct pv_disk *pvd = (struct pv_disk *) buf;
 	uint32_t version;
@@ -48,13 +48,13 @@
 	return 0;
 }
 
-static int _lvm1_write(struct label *label, char *buf)
+static int _lvm1_write(struct label *label, void *buf)
 {
 	_not_supported("write");
 	return 0;
 }
 
-static int _lvm1_read(struct labeller *l, struct device *dev, char *buf,
+static int _lvm1_read(struct labeller *l, struct device *dev, void *buf,
 		 struct label **label)
 {
 	struct pv_disk *pvd = (struct pv_disk *) buf;
--- LVM2/lib/format_pool/disk_rep.c	2006/05/09 21:23:50	1.8
+++ LVM2/lib/format_pool/disk_rep.c	2006/11/30 23:11:40	1.9
@@ -36,7 +36,7 @@
 			    struct dm_pool *mem, struct pool_list *pl,
 			    const char *vg_name)
 {
-	char buf[512];
+	char buf[512] __attribute((aligned(8)));
 
 	/* FIXME: Need to check the cache here first */
 	if (!dev_read(dev, UINT64_C(0), 512, buf)) {
@@ -59,7 +59,7 @@
 
 	list_iterate_items(pl, head) {
 		if (id_equal(&data->pv_uuid, &pl->pv_uuid)) {
-			char uuid[ID_LEN + 7];
+			char uuid[ID_LEN + 7] __attribute((aligned(8)));
 
 			id_write_format(&pl->pv_uuid, uuid, ID_LEN + 7);
 
@@ -84,7 +84,7 @@
 	struct lvmcache_info *info;
 	struct id pvid;
 	struct id vgid;
-	char uuid[ID_LEN + 7];
+	char uuid[ID_LEN + 7] __attribute((aligned(8)));
 	struct pool_disk *pd = &pl->pd;
 
 	pool_label_in(pd, buf);
@@ -128,7 +128,7 @@
  * be able to interpret ondisk labels correctly.  Always use
  * this function before writing to disk.
  */
-void pool_label_out(struct pool_disk *pl, char *buf)
+void pool_label_out(struct pool_disk *pl, void *buf)
 {
 	struct pool_disk *bufpl = (struct pool_disk *) buf;
 
@@ -163,7 +163,7 @@
  * correctly.  Always use this function before using labels that
  * were read from disk.
  */
-void pool_label_in(struct pool_disk *pl, char *buf)
+void pool_label_in(struct pool_disk *pl, void *buf)
 {
 	struct pool_disk *bufpl = (struct pool_disk *) buf;
 
--- LVM2/lib/format_pool/disk_rep.h	2005/10/16 23:03:57	1.4
+++ LVM2/lib/format_pool/disk_rep.h	2006/11/30 23:11:40	1.5
@@ -134,8 +134,8 @@
 
 int read_pool_label(struct pool_list *pl, struct labeller *l,
 		    struct device *dev, char *buf, struct label **label);
-void pool_label_out(struct pool_disk *pl, char *buf);
-void pool_label_in(struct pool_disk *pl, char *buf);
+void pool_label_out(struct pool_disk *pl, void *buf);
+void pool_label_in(struct pool_disk *pl, void *buf);
 void get_pool_uuid(char *uuid, uint64_t poolid, uint32_t spid, uint32_t devid);
 int import_pool_vg(struct volume_group *vg, struct dm_pool *mem, struct list *pls);
 int import_pool_lvs(struct volume_group *vg, struct dm_pool *mem,
--- LVM2/lib/format_pool/pool_label.c	2006/05/09 21:23:50	1.4
+++ LVM2/lib/format_pool/pool_label.c	2006/11/30 23:11:40	1.5
@@ -29,7 +29,7 @@
 		  op);
 }
 
-static int _pool_can_handle(struct labeller *l, char *buf, uint64_t sector)
+static int _pool_can_handle(struct labeller *l, void *buf, uint64_t sector)
 {
 
 	struct pool_disk pd;
@@ -50,13 +50,13 @@
 	return 0;
 }
 
-static int _pool_write(struct label *label, char *buf)
+static int _pool_write(struct label *label, void *buf)
 {
 	_pool_not_supported("write");
 	return 0;
 }
 
-static int _pool_read(struct labeller *l, struct device *dev, char *buf,
+static int _pool_read(struct labeller *l, struct device *dev, void *buf,
 		 struct label **label)
 {
 	struct pool_list pl;
--- LVM2/lib/format_text/format-text.c	2006/11/10 18:24:11	1.69
+++ LVM2/lib/format_text/format-text.c	2006/11/30 23:11:41	1.70
@@ -193,7 +193,7 @@
 				       int *precommitted)
 {
 	size_t len;
-	char vgnamebuf[NAME_LEN + 2];
+	char vgnamebuf[NAME_LEN + 2] __attribute((aligned(8)));
 	struct raw_locn *rlocn, *rlocn_precommitted;
 	struct lvmcache_info *info;
 
@@ -885,8 +885,8 @@
 	uint32_t wrap = 0;
 	const char *vgname = NULL;
 	unsigned int len = 0;
-	char buf[NAME_LEN + 1];
-        char uuid[64];
+	char buf[NAME_LEN + 1] __attribute((aligned(8)));
+	char uuid[64] __attribute((aligned(8)));
 
 	if (!dev_open(dev_area->dev)) {
 		stack;
@@ -1131,7 +1131,7 @@
 	struct lvmcache_info *info;
 	struct mda_context *mdac;
 	struct metadata_area *mda;
-	char buf[MDA_HEADER_SIZE];
+	char buf[MDA_HEADER_SIZE] __attribute((aligned(8)));
 	struct mda_header *mdah = (struct mda_header *) buf;
 	uint64_t adjustment;
 
@@ -1742,7 +1742,7 @@
 	}
 
 	if (!(dev_area.dev = device_from_pvid(cmd, &id))) {
-		char buffer[64];
+		char buffer[64] __attribute((aligned(8)));
 
 		if (!id_write_format(&id, buffer, sizeof(buffer)))
 			log_err("Couldn't find device.");
--- LVM2/lib/format_text/import_vsn1.c	2006/10/19 12:53:47	1.37
+++ LVM2/lib/format_text/import_vsn1.c	2006/11/30 23:11:41	1.38
@@ -149,7 +149,7 @@
 	 * Convert the uuid into a device.
 	 */
 	if (!(pv->dev = device_from_pvid(fid->fmt->cmd, &pv->id))) {
-		char buffer[64];
+		char buffer[64] __attribute((aligned(8)));
 
 		if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
 			log_error("Couldn't find device.");
--- LVM2/lib/format_text/text_label.c	2006/05/11 17:58:58	1.16
+++ LVM2/lib/format_text/text_label.c	2006/11/30 23:11:41	1.17
@@ -24,7 +24,7 @@
 #include <fcntl.h>
 
 static int _text_can_handle(struct labeller *l __attribute((unused)),
-			    char *buf,
+			    void *buf,
 			    uint64_t sector __attribute((unused)))
 {
 	struct label_header *lh = (struct label_header *) buf;
@@ -35,7 +35,7 @@
 	return 0;
 }
 
-static int _text_write(struct label *label, char *buf)
+static int _text_write(struct label *label, void *buf)
 {
 	struct label_header *lh = (struct label_header *) buf;
 	struct pv_header *pvhdr;
@@ -189,7 +189,7 @@
 	return 1;
 }
 
-static int _text_read(struct labeller *l, struct device *dev, char *buf,
+static int _text_read(struct labeller *l, struct device *dev, void *buf,
 		 struct label **label)
 {
 	struct label_header *lh = (struct label_header *) buf;
--- LVM2/lib/label/label.c	2006/11/14 15:03:07	1.35
+++ LVM2/lib/label/label.c	2006/11/30 23:11:41	1.36
@@ -115,7 +115,7 @@
 	struct lvmcache_info *info;
 	uint64_t sector;
 	int found = 0;
-	char readbuf[LABEL_SCAN_SIZE];
+	char readbuf[LABEL_SCAN_SIZE] __attribute((aligned(8)));
 
 	if (!dev_read(dev, UINT64_C(0), LABEL_SCAN_SIZE, readbuf)) {
 		log_debug("%s: Failed to read label area", dev_name(dev));
@@ -186,8 +186,8 @@
 /* FIXME Also wipe associated metadata area headers? */
 int label_remove(struct device *dev)
 {
-	char buf[LABEL_SIZE];
-	char readbuf[LABEL_SCAN_SIZE];
+	char buf[LABEL_SIZE] __attribute((aligned(8)));
+	char readbuf[LABEL_SCAN_SIZE] __attribute((aligned(8)));
 	int r = 1;
 	uint64_t sector;
 	int wipe;
@@ -258,7 +258,7 @@
 /* FIXME Avoid repeated re-reading if cache lock held */
 int label_read(struct device *dev, struct label **result)
 {
-	char buf[LABEL_SIZE];
+	char buf[LABEL_SIZE] __attribute((aligned(8)));
 	struct labeller *l;
 	uint64_t sector;
 	struct lvmcache_info *info;
@@ -290,7 +290,7 @@
 /* Caller may need to use label_get_handler to create label struct! */
 int label_write(struct device *dev, struct label *label)
 {
-	char buf[LABEL_SIZE];
+	char buf[LABEL_SIZE] __attribute((aligned(8)));
 	struct label_header *lh = (struct label_header *) buf;
 	int r = 1;
 
@@ -341,7 +341,7 @@
 int label_verify(struct device *dev)
 {
 	struct labeller *l;
-	char buf[LABEL_SIZE];
+	char buf[LABEL_SIZE] __attribute((aligned(8)));
 	uint64_t sector;
 	struct lvmcache_info *info;
 	int r = 0;
--- LVM2/lib/label/label.h	2006/05/09 21:23:50	1.17
+++ LVM2/lib/label/label.h	2006/11/30 23:11:41	1.18
@@ -49,23 +49,23 @@
 	/*
 	 * Is the device labelled with this format ?
 	 */
-	int (*can_handle) (struct labeller * l, char *buf, uint64_t sector);
+	int (*can_handle) (struct labeller * l, void *buf, uint64_t sector);
 
 	/*
 	 * Write a label to a volume.
 	 */
-	int (*write) (struct label * label, char *buf);
+	int (*write) (struct label * label, void *buf);
 
 	/*
 	 * Read a label from a volume.
 	 */
 	int (*read) (struct labeller * l, struct device * dev,
-		     char *buf, struct label ** label);
+		     void *buf, struct label ** label);
 
 	/*
 	 * Additional consistency checks for the paranoid.
 	 */
-	int (*verify) (struct labeller * l, char *buf, uint64_t sector);
+	int (*verify) (struct labeller * l, void *buf, uint64_t sector);
 
 	/*
 	 * Populate label_type etc.
--- LVM2/lib/locking/cluster_locking.c	2006/08/21 12:54:52	1.14
+++ LVM2/lib/locking/cluster_locking.c	2006/11/30 23:11:41	1.15
@@ -94,7 +94,7 @@
 /* Send a request and return the status */
 static int _send_request(char *inbuf, int inlen, char **retbuf)
 {
-	char outbuf[PIPE_BUF];
+	char outbuf[PIPE_BUF] __attribute((aligned(8)));
 	struct clvm_header *outheader = (struct clvm_header *) outbuf;
 	int len;
 	int off;
@@ -195,7 +195,7 @@
 static int _cluster_request(char cmd, const char *node, void *data, int len,
 			   lvm_response_t ** response, int *num)
 {
-	char outbuf[sizeof(struct clvm_header) + len + strlen(node) + 1];
+	char outbuf[sizeof(struct clvm_header) + len + strlen(node) + 1] __attribute((aligned(8)));
 	int *outptr;
 	char *inptr;
 	char *retbuf = NULL;
--- LVM2/lib/locking/locking.c	2006/10/14 16:37:54	1.34
+++ LVM2/lib/locking/locking.c	2006/11/30 23:11:41	1.35
@@ -249,7 +249,7 @@
 
 int lock_vol(struct cmd_context *cmd, const char *vol, int flags)
 {
-	char resource[258];
+	char resource[258] __attribute((aligned(8)));
 
 	switch (flags & LCK_SCOPE_MASK) {
 	case LCK_VG:
--- LVM2/lib/metadata/metadata.c	2006/11/10 18:24:11	1.101
+++ LVM2/lib/metadata/metadata.c	2006/11/30 23:11:42	1.102
@@ -738,7 +738,7 @@
 {
 	struct pv_list *pvl, *pvl2;
 	struct lv_list *lvl, *lvl2;
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 	int r = 1;
 
 	/* FIXME Also check there's no data/metadata overlap */
--- LVM2/tools/pvchange.c	2006/09/02 01:18:17	1.43
+++ LVM2/tools/pvchange.c	2006/11/30 23:11:42	1.44
@@ -29,7 +29,7 @@
 	const char *pv_name = dev_name(pv->dev);
 	const char *tag = NULL;
 	const char *orig_vg_name;
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 
 	int consistent = 1;
 	int allocatable = 0;
--- LVM2/tools/pvscan.c	2006/05/09 21:23:51	1.29
+++ LVM2/tools/pvscan.c	2006/11/30 23:11:42	1.30
@@ -22,7 +22,7 @@
 				   struct physical_volume *pv,
 				   void *handle __attribute((unused)))
 {
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 	unsigned vg_name_len = 0;
 
 	char pv_tmp_name[NAME_LEN] = { 0, };
--- LVM2/tools/vgmerge.c	2006/09/02 01:18:17	1.34
+++ LVM2/tools/vgmerge.c	2006/11/30 23:11:42	1.35
@@ -176,7 +176,7 @@
 	/* Fix up LVIDs */
 	list_iterate_items(lvl1, &vg_to->lvs) {
 		union lvid *lvid1 = &lvl1->lv->lvid;
-		char uuid[64];
+		char uuid[64] __attribute((aligned(8)));
 
 		list_iterate_items(lvl2, &vg_from->lvs) {
 			union lvid *lvid2 = &lvl2->lv->lvid;
--- LVM2/tools/vgreduce.c	2006/09/07 23:23:45	1.53
+++ LVM2/tools/vgreduce.c	2006/11/30 23:11:42	1.54
@@ -18,7 +18,7 @@
 
 static int _remove_pv(struct volume_group *vg, struct pv_list *pvl)
 {
-	char uuid[64];
+	char uuid[64] __attribute((aligned(8)));
 
 	if (vg->pv_count == 1) {
 		log_error("Volume Groups must always contain at least one PV");


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2006-10-18 18:01 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2006-10-18 18:01 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-10-18 18:01:53

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/error      : errseg.c 
	lib/metadata   : mirror.c segtype.h 
	lib/mirror     : mirrored.c 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 
	tools          : lvconvert.c lvcreate.c 

Log message:
	Add segment parameter to target_present functions.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.473&r2=1.474
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.114&r2=1.115
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.127&r2=1.128

--- LVM2/WHATS_NEW	2006/10/16 17:17:54	1.473
+++ LVM2/WHATS_NEW	2006/10/18 18:01:51	1.474
@@ -1,5 +1,6 @@
 Version 2.02.13 -
 ===================================
+  Add segment parameter to target_present functions.
 
 Version 2.02.12 - 16th October 2006
 ===================================
--- LVM2/lib/activate/dev_manager.c	2006/08/21 12:04:55	1.114
+++ LVM2/lib/activate/dev_manager.c	2006/10/18 18:01:51	1.115
@@ -785,7 +785,7 @@
 
 	/* Ensure required device-mapper targets are loaded */
 	if (seg->segtype->ops->target_present &&
-	    !seg->segtype->ops->target_present()) {
+	    !seg->segtype->ops->target_present(seg)) {
 		log_error("Can't expand LV %s: %s target support missing "
 			  "from kernel?", seg->lv->name, seg->segtype->name);
 		return 0;
--- LVM2/lib/error/errseg.c	2006/10/03 17:55:19	1.11
+++ LVM2/lib/error/errseg.c	2006/10/18 18:01:51	1.12
@@ -50,7 +50,7 @@
 	return dm_tree_node_add_error_target(node, len);
 }
 
-static int _errseg_target_present(void)
+static int _errseg_target_present(const struct lv_segment *seg __attribute((unused)))
 {
 	static int _errseg_checked = 0;
 	static int _errseg_present = 0;
--- LVM2/lib/metadata/mirror.c	2006/09/19 19:13:41	1.33
+++ LVM2/lib/metadata/mirror.c	2006/10/18 18:01:52	1.34
@@ -562,7 +562,7 @@
 	}
 
         if (activation() && segtype->ops->target_present &&
-            !segtype->ops->target_present()) {
+            !segtype->ops->target_present(NULL)) {
                 log_error("%s: Required device-mapper target(s) not "
                           "detected in your kernel", segtype->name);
                 return 0;
--- LVM2/lib/metadata/segtype.h	2006/10/03 17:55:19	1.13
+++ LVM2/lib/metadata/segtype.h	2006/10/18 18:01:52	1.14
@@ -76,7 +76,7 @@
 			       struct lv_segment *seg, char *params,
 			       uint64_t *total_numerator,
 			       uint64_t *total_denominator, float *percent);
-	int (*target_present) (void);
+	int (*target_present) (const struct lv_segment *seg);
 	int (*modules_needed) (struct dm_pool *mem,
 			       const struct lv_segment *seg,
 			       struct list *modules);
--- LVM2/lib/mirror/mirrored.c	2006/10/03 17:55:19	1.36
+++ LVM2/lib/mirror/mirrored.c	2006/10/18 18:01:52	1.37
@@ -336,7 +336,7 @@
 	return add_areas_line(dm, seg, node, start_area, area_count);
 }
 
-static int _mirrored_target_present(void)
+static int _mirrored_target_present(const struct lv_segment *seg __attribute((unused)))
 {
 	static int _mirrored_checked = 0;
 	static int _mirrored_present = 0;
--- LVM2/lib/snapshot/snapshot.c	2006/10/03 17:55:20	1.18
+++ LVM2/lib/snapshot/snapshot.c	2006/10/18 18:01:52	1.19
@@ -112,7 +112,7 @@
 	return 1;
 }
 
-static int _snap_target_present(void)
+static int _snap_target_present(const struct lv_segment *seg __attribute((unused)))
 {
 	static int _snap_checked = 0;
 	static int _snap_present = 0;
--- LVM2/lib/striped/striped.c	2006/10/03 18:02:06	1.19
+++ LVM2/lib/striped/striped.c	2006/10/18 18:01:52	1.20
@@ -174,7 +174,7 @@
 	return add_areas_line(dm, seg, node, 0u, seg->area_count);
 }
 
-static int _striped_target_present(void)
+static int _striped_target_present(const struct lv_segment *seg __attribute((unused)))
 {
 	static int _striped_checked = 0;
 	static int _striped_present = 0;
--- LVM2/lib/zero/zero.c	2006/10/03 17:55:20	1.10
+++ LVM2/lib/zero/zero.c	2006/10/18 18:01:52	1.11
@@ -49,7 +49,7 @@
 	return dm_tree_node_add_zero_target(node, len);
 }
 
-static int _zero_target_present(void)
+static int _zero_target_present(const struct lv_segment *seg __attribute((unused)))
 {
 	static int _zero_checked = 0;
 	static int _zero_present = 0;
--- LVM2/tools/lvconvert.c	2006/09/19 19:13:41	1.21
+++ LVM2/tools/lvconvert.c	2006/10/18 18:01:53	1.22
@@ -212,7 +212,7 @@
 	}
 
 	if (activation() && lp->segtype->ops->target_present &&
-	    !lp->segtype->ops->target_present()) {
+	    !lp->segtype->ops->target_present(NULL)) {
 		log_error("%s: Required device-mapper target(s) not "
 			  "detected in your kernel", lp->segtype->name);
 		return 0;
--- LVM2/tools/lvcreate.c	2006/10/16 16:47:56	1.127
+++ LVM2/tools/lvcreate.c	2006/10/18 18:01:53	1.128
@@ -386,7 +386,7 @@
 	}
 
 	if (activation() && lp->segtype->ops->target_present &&
-	    !lp->segtype->ops->target_present()) {
+	    !lp->segtype->ops->target_present(NULL)) {
 		log_error("%s: Required device-mapper target(s) not "
 			  "detected in your kernel", lp->segtype->name);
 		return 0;


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2006-04-28 17:01 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2006-04-28 17:01 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-04-28 17:01:07

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/misc       : lvm-string.c 
	tools          : toollib.c 

Log message:
	Fix activation code to check for pre-existing mirror logs.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.373&r2=1.374
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.106&r2=1.107
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2005-11-09 13:05 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2005-11-09 13:05 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-11-09 13:05:18

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c targets.h 
	lib/error      : errseg.c 
	lib/metadata   : segtype.h 
	lib/mirror     : mirrored.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 

Log message:
	rename deptree

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.320&r2=1.321
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.98&r2=1.99
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/targets.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2005-10-27 19:58 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2005-10-27 19:58 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-10-27 19:58:22

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/metadata   : lv_manip.c merge.c metadata.h mirror.c 

Log message:
	Add mirror_seg pointer to lv_segment struct. (incomplete & untested)

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.315&r2=1.316
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.96&r2=1.97
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.84&r2=1.85
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.130&r2=1.131
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2005-08-10 17:19 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2005-08-10 17:19 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-08-10 17:19:46

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c targets.h 
	lib/mirror     : mirrored.c 

Log message:
	Move compose_log_line() into mirror directory.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.277&r2=1.278
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.81&r2=1.82
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/targets.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2005-05-03 17:28 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2005-05-03 17:28 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-05-03 17:28:23

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/commands   : toolcontext.c 
	lib/config     : config.c 
	lib/device     : dev-cache.c dev-cache.h dev-io.c device.h 
	lib/display    : display.c 
	lib/format1    : import-export.c import-extents.c 
	lib/format_pool: import_export.c 
	lib/format_text: export.c import_vsn1.c 
	lib/log        : log.c 
	lib/metadata   : lv_alloc.h lv_manip.c merge.c metadata.c 
	                 metadata.h mirror.c pv_alloc.h pv_manip.c 
	                 pv_map.c 
	lib/report     : report.c 
	lib/striped    : striped.c 
	tools          : vgreduce.c vgremove.c vgsplit.c 

Log message:
	Reinstate full PV size when removing from VG.
	Support loopfiles for testing.
	Complete the pv_segment support.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.230&r2=1.231
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.75&r2=1.76
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.h.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.h.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.72&r2=1.73
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-extents.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_alloc.h.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.117&r2=1.118
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_alloc.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgremove.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgsplit.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2005-01-19 17:19 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2005-01-19 17:19 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-01-19 17:19:40

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/format1    : import-export.c 
	lib/format_text: export.c 
	lib/metadata   : metadata.h snapshot_manip.c 
	lib/snapshot   : snapshot.c 
	tools          : lvcreate.c 

Log message:
	Store snapshot and origin sizes separately.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.156&r2=1.157
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.72&r2=1.73
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.h.diff?cvsroot=lvm2&r1=1.108&r2=1.109
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/snapshot_manip.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvcreate.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87


^ permalink raw reply	[flat|nested] 25+ messages in thread
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c li ...
@ 2004-09-15 15:02 agk
  0 siblings, 0 replies; 25+ messages in thread
From: agk @ 2004-09-15 15:02 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-09-15 15:02:36

Modified files:
	.              : WHATS_NEW 
	lib/activate   : dev_manager.c 
	lib/misc       : lvm-string.c lvm-string.h 

Log message:
	Export dm name build & split functions.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.85&r2=1.86
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.68&r2=1.69
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.h.diff?cvsroot=lvm2&r1=1.8&r2=1.9


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

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

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-14 17:54 LVM2 ./WHATS_NEW lib/activate/dev_manager.c li agk
  -- strict thread matches above, loose matches on Subject: below --
2012-03-05 15:05 zkabelac
2012-01-20 22:02 snitzer
2011-10-14 13:23 zkabelac
2011-10-06 14:45 jbrassow
2011-08-18 19:38 jbrassow
2010-10-13 21:26 snitzer
2010-04-23 14:16 prajnoha
2010-02-17 22:59 snitzer
2010-01-15 16:35 snitzer
2009-10-26 10:02 agk
2009-10-22 13:00 prajnoha
2008-07-15  0:25 agk
2008-04-10 17:09 wysochanski
2008-01-30 13:19 agk
2007-05-15 14:42 mbroz
2006-11-30 23:11 agk
2006-10-18 18:01 agk
2006-04-28 17:01 agk
2005-11-09 13:05 agk
2005-10-27 19:58 agk
2005-08-10 17:19 agk
2005-05-03 17:28 agk
2005-01-19 17:19 agk
2004-09-15 15:02 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).