public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2009-08-03 18:09 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2009-08-03 18:09 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2009-08-03 18:09:26

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

Log message:
	Only create LV symlinks on ACTIVATE not PRELOAD.
	(This is the udev behaviour - but does this change break anything?)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1228&r2=1.1229
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.156&r2=1.157

--- LVM2/WHATS_NEW	2009/08/02 21:59:21	1.1228
+++ LVM2/WHATS_NEW	2009/08/03 18:09:25	1.1229
@@ -1,5 +1,6 @@
 Version 2.02.51 - 
 ================================
+  Only change LV symlinks on ACTIVATE not PRELOAD.
   Make lvconvert honour log mirror options combined with downconversion.
   Allow LV suspend while --ignorelockingfailure is in force.
   Update synopsis in lvconvert manpage to mention --repair.
--- LVM2/lib/activate/dev_manager.c	2009/08/03 18:01:45	1.156
+++ LVM2/lib/activate/dev_manager.c	2009/08/03 18:09:26	1.157
@@ -1212,12 +1212,12 @@
 				stack;
 			if (!r)
 				goto_out;
+			if (!_create_lv_symlinks(dm, root)) {
+				log_error("Failed to create symlinks for %s.", lv->name);
+				goto out;
+			}
 		}
 
-		if (!_create_lv_symlinks(dm, root)) {
-			log_error("Failed to create symlinks for %s.", lv->name);
-			goto out;
-		}
 		break;
 	default:
 		log_error("_tree_action: Action %u not supported.", action);


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2012-05-16 12:50 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2012-05-16 12:50 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2012-05-16 12:50:16

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

Log message:
	Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90)
	- The test should be checking the LV as a whole, not just individual segments.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2405&r2=1.2406
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.278&r2=1.279

--- LVM2/WHATS_NEW	2012/05/14 16:18:58	1.2405
+++ LVM2/WHATS_NEW	2012/05/16 12:50:14	1.2406
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90)
   Fix alloc cling to cling to PVs already found with contiguous policy.
   Fix cling policy not to behave like normal policy if no previous LV seg.
   Fix allocation loop not to use later policies when --alloc cling without tags.
--- LVM2/lib/activate/dev_manager.c	2012/04/24 00:51:26	1.278
+++ LVM2/lib/activate/dev_manager.c	2012/05/16 12:50:15	1.279
@@ -1581,22 +1581,6 @@
 				  seg->lv->vg->name, seg->lv->name);
 			return 0;
 		}
-
-		/*
-		 * Mirrors activate LVs replaced with error targets and
-		 * RAID can handle non-accessible sub-LVs.
-		 *
-		 * TODO: Can we eventually skip to activate such LVs ?
-		 */
-		if (!num_existing_areas &&
-		    !strstr(seg->lv->name, "_rmeta_") &&
-		    !strstr(seg->lv->name, "_rimage_") &&
-		    !strstr(seg->lv->name, "_mimage_") &&
-		    !((name = strstr(seg->lv->name, "_mlog")) && !name[5])) {
-			log_error("Cannot activate %s/%s: all segments missing.",
-				  seg->lv->vg->name, seg->lv->name);
-			return 0;
-		}
 	}
 
 	return 1;


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2012-04-20 14:17 jbrassow
  0 siblings, 0 replies; 39+ messages in thread
From: jbrassow @ 2012-04-20 14:17 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2012-04-20 14:17:44

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

Log message:
	Unlike 'mirror' segtype, 'raid1' should perform flush	on suspend.
	
	The 'mirror' segtype and 'raid1' segtype both set the 'MIRRORED' flag.
	However, due to differences in the way these device-mapper targets behave
	'mirror' must be suspended with the 'noflush' option and 'raid1' does not
	have to be.
	
	This patch ensures that when the 'MIRRORED' flag is checked to see if
	'noflush' is needed that it does not also set it for 'raid1' by mistake.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2385&r2=1.2386
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.276&r2=1.277

--- LVM2/WHATS_NEW	2012/04/18 15:26:02	1.2385
+++ LVM2/WHATS_NEW	2012/04/20 14:17:44	1.2386
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Unlike 'mirror' segtype, 'raid1' should perform flush on suspend.
   Add udev info and context to lvmdump.
   Fix RAID device replacement code so that it works under snapshot.
   Fix inability to split RAID1 image while specifying a particular PV.
--- LVM2/lib/activate/dev_manager.c	2012/03/14 17:12:05	1.276
+++ LVM2/lib/activate/dev_manager.c	2012/04/20 14:17:44	1.277
@@ -2178,7 +2178,8 @@
 		break;
 	case SUSPEND:
 		dm_tree_skip_lockfs(root);
-		if (!dm->flush_required && (lv->status & MIRRORED) && !(lv->status & PVMOVE))
+		if (!dm->flush_required && !seg_is_raid(first_seg(lv)) &&
+		    (lv->status & MIRRORED) && !(lv->status & PVMOVE))
 			dm_tree_use_no_flush_suspend(root);
 		/* Fall through */
 	case SUSPEND_WITH_LOCKFS:


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2012-03-05 14:15 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2012-03-05 14:15 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

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

Log message:
	Improve warning
	
	Use thin_dump --repair suggestion in log error message
	and use just warning on  deactivation path without repair info
	(since node has been deactivated).
	
	Also check whether there is not 16 args for thin_check configured.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2342&r2=1.2343
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.273&r2=1.274

--- LVM2/WHATS_NEW	2012/03/05 14:12:57	1.2342
+++ LVM2/WHATS_NEW	2012/03/05 14:15:50	1.2343
@@ -1,5 +1,6 @@
 Version 2.02.95 -
 ================================
+  Print just warning on thin pool check callback path for failing check.
   Use 64bit math for verification of thin pool and snapshot chunk size.
   Validate udev structures in _insert_udev_dir().
   Scan all devices for lvmetad if 'pvscan --cache' used without device list.
--- LVM2/lib/activate/dev_manager.c	2012/03/02 21:49:44	1.273
+++ LVM2/lib/activate/dev_manager.c	2012/03/05 14:15:50	1.274
@@ -1231,15 +1231,28 @@
 	}
 
 	args = dm_split_words(split, 16, 0, argv);
+
+	if (args == 16) {
+		log_error("Too many options for thin check command.");
+		return 0;
+	}
 	argv[args++] = meta_path;
 	argv[args] = NULL;
 
 	if (!(ret = exec_cmd(data->pool_lv->vg->cmd, (const char * const *)argv,
 			     &status, 0))) {
-		log_err_once("Check of thin pool %s/%s failed (status:%d). "
-			     "Manual repair required (thin_repair %s)!",
-			     data->pool_lv->vg->name, data->pool_lv->name,
-			     status, meta_path);
+		switch (type) {
+		case DM_NODE_CALLBACK_PRELOADED:
+			log_err_once("Check of thin pool %s/%s failed (status:%d). "
+				     "Manual repair required (thin_dump --repair %s)!",
+				     data->pool_lv->vg->name, data->pool_lv->name,
+				     status, meta_path);
+			break;
+		default:
+			log_warn("WARNING: Integrity check of metadata for thin pool "
+				 "%s/%s failed.",
+				 data->pool_lv->vg->name, data->pool_lv->name);
+		}
 		/*
 		 * FIXME: What should we do here??
 		 *


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2012-02-01 13:47 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2012-02-01 13:47 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

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

Log message:
	Disable partial activation for thin LVs and LVs with all missing segments
	
	Count number of error and existing areas and if there is no existing area
	for the LV avoid its activation.
	
	Always disable partial activatio for thin volumes.
	
	For mirrors currently put in hack to let it pass with a special name
	since current mirror code needs to activate such LV during some operations.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2252&r2=1.2253
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.269&r2=1.270

--- LVM2/WHATS_NEW	2012/02/01 13:42:18	1.2252
+++ LVM2/WHATS_NEW	2012/02/01 13:47:27	1.2253
@@ -1,5 +1,6 @@
 Version 2.02.90 - 
 ===================================
+  Disable partial activation for thin LVs and LVs with all missing segments.
   Do not print warning for pv_min_size set in range between 512KB and 2MB.
   Clean up systemd unit ordering and requirements.
   Fix lcov reports when srcdir != builddir.
--- LVM2/lib/activate/dev_manager.c	2012/01/28 20:12:29	1.269
+++ LVM2/lib/activate/dev_manager.c	2012/02/01 13:47:27	1.270
@@ -1373,6 +1373,8 @@
 	char *dlid;
 	struct stat info;
 	const char *name;
+	unsigned num_error_areas = 0;
+	unsigned num_existing_areas = 0;
 
 	/* FIXME Avoid repeating identical stat in dm_tree_node_add_target_area */
 	for (s = start_area; s < areas; s++) {
@@ -1388,10 +1390,12 @@
 			}
 			if (!_add_error_area(dm, node, seg, s))
 				return_0;
+			num_error_areas++;
 		} else if (seg_type(seg, s) == AREA_PV) {
 			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;
+			num_existing_areas++;
 		} else if (seg_is_raid(seg)) {
 			/*
 			 * RAID can handle unassigned areas.  It simple puts
@@ -1436,6 +1440,28 @@
 		}
 	}
 
+        if (num_error_areas) {
+		/* Thins currently do not support partial activation */
+		if (lv_is_thin_type(seg->lv)) {
+			log_error("Cannot activate %s%s: pool incomplete.",
+				  seg->lv->vg->name, seg->lv->name);
+			return 0;
+		}
+
+		/*
+		 * Mirrors activate LVs replaced with error targets
+		 *
+		 * TODO: Can we eventually skip to activate such LVs ?
+		 */
+		if (!num_existing_areas &&
+		    !strstr(seg->lv->name, "_mimage_") &&
+		    !((name = strstr(seg->lv->name, "_mlog")) && !name[5])) {
+			log_error("Cannot activate %s/%s: all segments missing.",
+				  seg->lv->vg->name, seg->lv->name);
+			return 0;
+		}
+	}
+
 	return 1;
 }
 


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2012-01-28 20:12 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2012-01-28 20:12 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-01-28 20:12:29

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

Log message:
	Fix data% reporting
	
	For reading % of mapped size of thin volume use as origin for
	old style snapshot '-real' device needs to be queried.
	Fix log_error report given for lvs -a in this case.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2246&r2=1.2247
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.268&r2=1.269

--- LVM2/WHATS_NEW	2012/01/27 01:23:40	1.2246
+++ LVM2/WHATS_NEW	2012/01/28 20:12:26	1.2247
@@ -1,5 +1,6 @@
 Version 2.02.90 - 
 ===================================
+  Fix data% report for thin volume used as origin for non-thin snapshot.
 
 Version 2.02.89 - 26th January 2012
 ===================================
--- LVM2/lib/activate/dev_manager.c	2012/01/25 11:10:06	1.268
+++ LVM2/lib/activate/dev_manager.c	2012/01/28 20:12:29	1.269
@@ -953,12 +953,13 @@
 {
 	char *name;
 	const char *dlid;
+	const char *layer = lv_is_origin(lv) ? "real" : NULL;
 
 	/* Build a name for the top layer */
-	if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, NULL)))
+	if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, layer)))
 		return_0;
 
-	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, NULL)))
+	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, layer)))
 		return_0;
 
 	log_debug("Getting device status percentage for %s", name);


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2012-01-23 20:56 jbrassow
  0 siblings, 0 replies; 39+ messages in thread
From: jbrassow @ 2012-01-23 20:56 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2012-01-23 20:56:43

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

Log message:
	Fix the way RAID meta LVs are added to the dependency tree.
	
	Similar to the "mirror" segment type's log device, _add_dev_to_dtree should
	be called and not _add_lv_to_dtree when adding metadata sub-LVs to the deptree.
	Since _add_lv_to_dtree was being called, 'origin_only' could be set if a
	snapshot sits on top of the RAID device.  This would cause the actual device
	that needed to be added to be skipped in favor of the non-existant device,
	"<foo>-real".

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2234&r2=1.2235
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.263&r2=1.264

--- LVM2/WHATS_NEW	2012/01/21 05:29:51	1.2234
+++ LVM2/WHATS_NEW	2012/01/23 20:56:42	1.2235
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix the way RAID meta LVs are added to the dependency tree.
   Change exclusive LV activation logic to try local node before remote nodes.
   Add CLVMD_FLAG_REMOTE to skip processing on local node.
   Prompt if request is made to remove a snapshot whose "Merge failed".
--- LVM2/lib/activate/dev_manager.c	2012/01/20 22:02:04	1.263
+++ LVM2/lib/activate/dev_manager.c	2012/01/23 20:56:43	1.264
@@ -1176,8 +1176,8 @@
 
 	if (lv->status & RAID)
 		for (s = 0; s < seg->area_count; s++)
-			if (!_add_lv_to_dtree(dm, dtree,
-					      seg_metalv(seg, s), origin_only))
+			if (!_add_dev_to_dtree(dm, dtree,
+					       seg_metalv(seg, s), NULL))
 				return_0;
 
 	/* Add any LVs referencing a PVMOVE LV unless told not to. */


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2012-01-20 21:56 snitzer
  0 siblings, 0 replies; 39+ messages in thread
From: snitzer @ 2012-01-20 21:56 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2012-01-20 21:56:01

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

Log message:
	Lookup snapshot usage percent of origin when a snapshot is merging.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2228&r2=1.2229
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.261&r2=1.262

--- LVM2/WHATS_NEW	2012/01/20 16:59:58	1.2228
+++ LVM2/WHATS_NEW	2012/01/20 21:56:01	1.2229
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Lookup snapshot usage percent of origin 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/19 15:27:54	1.261
+++ LVM2/lib/activate/dev_manager.c	2012/01/20 21:56:01	1.262
@@ -742,6 +742,7 @@
 				 const struct logical_volume *lv,
 				 percent_t *percent)
 {
+	const struct logical_volume *snap_lv;
 	char *name;
 	const char *dlid;
 	int fail_if_percent_unsupported = 0;
@@ -761,13 +762,19 @@
 		fail_if_percent_unsupported = 1;
 	}
 
+	if (lv_is_merging_cow(lv)) {
+		/* must check percent of origin for a merging snapshot */
+		snap_lv = origin_from_cow(lv);
+	} else
+		snap_lv = lv;
+
 	/*
 	 * Build a name for the top layer.
 	 */
-	if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, NULL)))
+	if (!(name = dm_build_dm_name(dm->mem, snap_lv->vg->name, snap_lv->name, NULL)))
 		return_0;
 
-	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, NULL)))
+	if (!(dlid = build_dm_uuid(dm->mem, snap_lv->lvid.s, NULL)))
 		return_0;
 
 	/*


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

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

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

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

Log message:
	Check lv pointer for NULL before derefence.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2207&r2=1.2208
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.254&r2=1.255

--- LVM2/WHATS_NEW	2011/12/21 12:49:00	1.2207
+++ LVM2/WHATS_NEW	2011/12/21 12:59:22	1.2208
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Do not derefence lv pointer in _percent_run() function before NULL check.
   Allow empty strings for description and creation_host config fields.
   Issue deprecation warning when removing last lvm1-format snapshot.
   Reinstate support for snapshot removal with lvm1 format. (2.02.86)
--- LVM2/lib/activate/dev_manager.c	2011/12/21 12:55:22	1.254
+++ LVM2/lib/activate/dev_manager.c	2011/12/21 12:59:22	1.255
@@ -507,7 +507,7 @@
 	uint64_t start, length;
 	char *type = NULL;
 	char *params = NULL;
-	const struct dm_list *segh = &lv->segments;
+	const struct dm_list *segh = lv ? &lv->segments : NULL;
 	struct lv_segment *seg = NULL;
 	struct segment_type *segtype;
 	int first_time = 1;


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2011-11-18 19:42 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2011-11-18 19:42 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-11-18 19:42:04

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

Log message:
	Drop pool memory allocated in lv_has_target_type
	
	Remove FIXMES - there should not be any pool free call since
	the memory pool is from device manager, and pool is detroyed
	after the operation, so doing extra free here would not help here.
	
	However lv_has_target_type() is using cmd mempool so here the extra
	call for dm_pool_free makes sence.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2191&r2=1.2192
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.251&r2=1.252

--- LVM2/WHATS_NEW	2011/11/18 19:31:09	1.2191
+++ LVM2/WHATS_NEW	2011/11/18 19:42:03	1.2192
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Drop pool memory allocated within lv_has_target_type().
   Reduce stack allocation of some PATH_MAX sized char buffers.
   Unlock memory before writing metadata.
   Add query before removing snapshots when inactive snapshot origin is removed.
--- LVM2/lib/activate/dev_manager.c	2011/11/15 17:25:05	1.251
+++ LVM2/lib/activate/dev_manager.c	2011/11/18 19:42:03	1.252
@@ -411,7 +411,7 @@
 
 	if (!(dmt = _setup_task(NULL, dlid, 0,
 				DM_DEVICE_STATUS, 0, 0)))
-		return_0;
+		goto_bad;
 
 	if (!dm_task_no_open_count(dmt))
 		log_error("Failed to disable open_count");
@@ -433,8 +433,11 @@
 		}
 	} while (next);
 
- out:
+out:
 	dm_task_destroy(dmt);
+bad:
+	dm_pool_free(mem, dlid);
+
 	return r;
 }
 
@@ -737,8 +740,6 @@
 		       NULL, fail_if_percent_unsupported)))
 		return_0;
 
-	/* FIXME dm_pool_free ? */
-
 	/* If the snapshot isn't available, percent will be -1 */
 	return 1;
 }
@@ -760,8 +761,6 @@
 	if (!(name = dm_build_dm_name(dm->mem, lv->vg->name, lv->name, layer)))
 		return_0;
 
-	/* FIXME dm_pool_free ? */
-
 	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, layer))) {
 		log_error("dlid build failed for %s", lv->name);
 		return 0;


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2011-10-11  8:59 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2011-10-11  8:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-11 08:59:42

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

Log message:
	Improve backtrace reporting
	
	Add <backtrace> so the function appears logged for the fail path.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2153&r2=1.2154
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.239&r2=1.240

--- LVM2/WHATS_NEW	2011/10/11 08:57:13	1.2153
+++ LVM2/WHATS_NEW	2011/10/11 08:59:42	1.2154
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Improve backtrace reporting for some dev_manager_ functions.
   Change message severity to log_warn when symlink creation fails.
   Add ability to convert mirror segtype to RAID1 segtype.
   Add ability to convert from linear to RAID1.
--- LVM2/lib/activate/dev_manager.c	2011/10/11 08:57:16	1.239
+++ LVM2/lib/activate/dev_manager.c	2011/10/11 08:59:42	1.240
@@ -1941,7 +1941,10 @@
 	if (!_tree_action(dm, lv, laopts, ACTIVATE))
 		return_0;
 
-	return _tree_action(dm, lv, laopts, CLEAN);
+	if (!_tree_action(dm, lv, laopts, CLEAN))
+		return_0;
+
+	return 1;
 }
 
 /* origin_only may only be set if we are resuming (not activating) an origin LV */
@@ -1949,7 +1952,7 @@
 			struct lv_activate_opts *laopts, int *flush_required)
 {
 	if (!_tree_action(dm, lv, laopts, PRELOAD))
-		return 0;
+		return_0;
 
 	*flush_required = dm->flush_required;
 
@@ -1959,11 +1962,11 @@
 int dev_manager_deactivate(struct dev_manager *dm, struct logical_volume *lv)
 {
 	struct lv_activate_opts laopts = { 0 };
-	int r;
 
-	r = _tree_action(dm, lv, &laopts, DEACTIVATE);
+	if (!_tree_action(dm, lv, &laopts, DEACTIVATE))
+		return_0;
 
-	return r;
+	return 1;
 }
 
 int dev_manager_suspend(struct dev_manager *dm, struct logical_volume *lv,
@@ -1971,7 +1974,10 @@
 {
 	dm->flush_required = flush_required;
 
-	return _tree_action(dm, lv, laopts, lockfs ? SUSPEND_WITH_LOCKFS : SUSPEND);
+	if (!_tree_action(dm, lv, laopts, lockfs ? SUSPEND_WITH_LOCKFS : SUSPEND))
+		return_0;
+
+	return 1;
 }
 
 /*


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2011-10-11  8:57 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2011-10-11  8:57 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-10-11 08:57:16

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

Log message:
	Change message severity
	
	Using log_warn to report missing symlinks as warning, since the command
	itself returns as successful, we should not produce log_error().
	log_warn is better fit here.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2152&r2=1.2153
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.238&r2=1.239

--- LVM2/WHATS_NEW	2011/10/07 14:56:01	1.2152
+++ LVM2/WHATS_NEW	2011/10/11 08:57:13	1.2153
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Change message severity to log_warn when symlink creation fails.
   Add ability to convert mirror segtype to RAID1 segtype.
   Add ability to convert from linear to RAID1.
   Add ability to extend mirrors with '--nosync' option.
--- LVM2/lib/activate/dev_manager.c	2011/10/11 08:54:01	1.238
+++ LVM2/lib/activate/dev_manager.c	2011/10/11 08:57:16	1.239
@@ -1886,7 +1886,7 @@
 		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);
+			log_warn("Failed to remove all device symlinks associated with %s.", lv->name);
 		break;
 	case SUSPEND:
 		dm_tree_skip_lockfs(root);
@@ -1913,10 +1913,8 @@
 		if (action == ACTIVATE) {
 			if (!dm_tree_activate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1))
 				goto_out;
-			if (!_create_lv_symlinks(dm, root)) {
-				log_error("Failed to create symlinks for %s.", lv->name);
-				goto out;
-			}
+			if (!_create_lv_symlinks(dm, root))
+				log_warn("Failed to create symlinks for %s.", lv->name);
 		}
 
 		break;


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2011-08-11  4:18 jbrassow
  0 siblings, 0 replies; 39+ messages in thread
From: jbrassow @ 2011-08-11  4:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2011-08-11 04:18:17

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

Log message:
	Add RAID metadata devices to considered devices in _add_lv_to_dtree.
	
	_add_lv_to_dtree must also add RAID metadata devices.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2059&r2=1.2060
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.227&r2=1.228

--- LVM2/WHATS_NEW	2011/08/11 03:29:51	1.2059
+++ LVM2/WHATS_NEW	2011/08/11 04:18:17	1.2060
@@ -1,5 +1,6 @@
 Version 2.02.87 - 
 ===============================
+  Add RAID metadata devices to considered devices in _add_lv_to_dtree.
   Fix renaming of RAID logical volumes.
   Replace free_vg with release_vg and move it to vg.c.
   Remove INCONSISTENT_VG flag from the code.
--- LVM2/lib/activate/dev_manager.c	2011/08/02 22:07:21	1.227
+++ LVM2/lib/activate/dev_manager.c	2011/08/11 04:18:17	1.228
@@ -1060,9 +1060,12 @@
 /*
  * Add LV and any known dependencies
  */
-static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, struct logical_volume *lv, int origin_only)
+static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
+			    struct logical_volume *lv, int origin_only)
 {
+	uint32_t s;
 	struct seg_list *sl;
+	struct lv_segment *seg = first_seg(lv);
 
 	if (!origin_only && !_add_dev_to_dtree(dm, dtree, lv, NULL))
 		return_0;
@@ -1074,10 +1077,16 @@
 	if (!origin_only && !_add_dev_to_dtree(dm, dtree, lv, "cow"))
 		return_0;
 
-	if ((lv->status & MIRRORED) && first_seg(lv)->log_lv &&
-	    !_add_dev_to_dtree(dm, dtree, first_seg(lv)->log_lv, NULL))
+	if ((lv->status & MIRRORED) && seg->log_lv &&
+	    !_add_dev_to_dtree(dm, dtree, seg->log_lv, NULL))
 		return_0;
 
+	if (lv->status & RAID)
+		for (s = 0; s < seg->area_count; s++)
+			if (!_add_lv_to_dtree(dm, dtree,
+					      seg_metalv(seg, s), origin_only))
+				return_0;
+
 	/* Add any LVs referencing a PVMOVE LV unless told not to. */
 	if (dm->track_pvmove_deps && lv->status & PVMOVE)
 		dm_list_iterate_items(sl, &lv->segs_using_this_lv)


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2011-07-06  0:29 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2011-07-06  0:29 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-07-06 00:29:45

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

Log message:
	Cope with a PV only discovered missing when creating deptree.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2036&r2=1.2037
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.225&r2=1.226

--- LVM2/WHATS_NEW	2011/07/05 23:10:14	1.2036
+++ LVM2/WHATS_NEW	2011/07/06 00:29:44	1.2037
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Cope with a PV only discovered missing when creating deptree.
   Abort operation if dm_tree_node_add_target_area fails.
   Add activation/checks to lvm.conf to perform additional ioctl validation.
   When suspending, automatically preload newly-visible existing LVs.
--- LVM2/lib/activate/dev_manager.c	2011/07/05 23:10:15	1.225
+++ LVM2/lib/activate/dev_manager.c	2011/07/06 00:29:45	1.226
@@ -1194,13 +1194,21 @@
 	uint64_t extent_size = seg->lv->vg->extent_size;
 	uint32_t s;
 	char *dlid;
+	struct stat info;
+	const char *name;
 
+	/* FIXME Avoid repeating identical stat in dm_tree_node_add_target_area */
 	for (s = start_area; s < areas; s++) {
 		if ((seg_type(seg, s) == AREA_PV &&
-		     (!seg_pvseg(seg, s) ||
-		      !seg_pv(seg, s) ||
-		      !seg_dev(seg, s))) ||
+		     (!seg_pvseg(seg, s) || !seg_pv(seg, s) || !seg_dev(seg, s) ||
+		       !(name = dev_name(seg_dev(seg, s))) || !*name ||
+		       stat(name, &info) < 0 || !S_ISBLK(info.st_mode))) ||
 		    (seg_type(seg, s) == AREA_LV && !seg_lv(seg, s))) {
+			if (!seg->lv->vg->cmd->partial_activation) {
+				log_error("Aborting.  LV %s is now incomplete "
+					  "and --partial was not specified.", seg->lv->name);
+				return 0;
+			}
 			if (!_add_error_area(dm, node, seg, s))
 				return_0;
 		} else if (seg_type(seg, s) == AREA_PV) {


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2011-07-05 23:10 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2011-07-05 23:10 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-07-05 23:10:15

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

Log message:
	Abort operation if dm_tree_node_add_target_area fails.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2035&r2=1.2036
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.224&r2=1.225

--- LVM2/WHATS_NEW	2011/07/01 14:09:19	1.2035
+++ LVM2/WHATS_NEW	2011/07/05 23:10:14	1.2036
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Abort operation if dm_tree_node_add_target_area fails.
   Add activation/checks to lvm.conf to perform additional ioctl validation.
   When suspending, automatically preload newly-visible existing LVs.
   Report internal error when parameters are missing on table load.
--- LVM2/lib/activate/dev_manager.c	2011/07/05 01:01:19	1.224
+++ LVM2/lib/activate/dev_manager.c	2011/07/05 23:10:15	1.225
@@ -1178,12 +1178,11 @@
 		dlid = _add_error_device(dm, *tree, seg, s);
 		if (!dlid)
 			return_0;
-		dm_tree_node_add_target_area(node, NULL, dlid,
-					     extent_size * seg_le(seg, s));
+		if (!dm_tree_node_add_target_area(node, NULL, dlid, extent_size * seg_le(seg, s)))
+			return_0;
 	} else
-		dm_tree_node_add_target_area(node,
-					     dm->cmd->stripe_filler,
-					     NULL, UINT64_C(0));
+		if (!dm_tree_node_add_target_area(node, dm->cmd->stripe_filler, NULL, UINT64_C(0)))
+			return_0;
 
 	return 1;
 }
@@ -1204,19 +1203,15 @@
 		    (seg_type(seg, s) == AREA_LV && !seg_lv(seg, s))) {
 			if (!_add_error_area(dm, node, seg, s))
 				return_0;
-		} else if (seg_type(seg, s) == AREA_PV)
-			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))));
-		else if (seg_type(seg, s) == AREA_LV) {
-			if (!(dlid = build_dm_uuid(dm->mem,
-						   seg_lv(seg, s)->lvid.s,
-						   NULL)))
+		} else if (seg_type(seg, s) == AREA_PV) {
+			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 (!(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;
-			dm_tree_node_add_target_area(node, NULL, dlid,
-							extent_size * seg_le(seg, s));
 		} else {
 			log_error(INTERNAL_ERROR "Unassigned area found in LV %s.",
 				  seg->lv->name);


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2011-01-05 14:03 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2011-01-05 14:03 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-05 14:03:37

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

Log message:
	Add missing error path tests

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1859&r2=1.1860
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.210&r2=1.211

--- LVM2/WHATS_NEW	2011/01/05 12:59:46	1.1859
+++ LVM2/WHATS_NEW	2011/01/05 14:03:36	1.1860
@@ -1,5 +1,6 @@
 Version 2.02.80 - 
 ====================================
+  Add missing tests in _setup_task().
   Fail poll daemon creation when lvmcache_init() fails.
   Return defined value for errors in _copy_percent() and _snap_percent().
   Correct return code of cmirrord when issuing 'start' when already running.
--- LVM2/lib/activate/dev_manager.c	2010/12/22 15:32:15	1.210
+++ LVM2/lib/activate/dev_manager.c	2011/01/05 14:03:37	1.211
@@ -75,19 +75,22 @@
 	if (!(dmt = dm_task_create(task)))
 		return_NULL;
 
-	if (name)
-		dm_task_set_name(dmt, name);
+	if (name && !dm_task_set_name(dmt, name))
+		goto_out;
 
-	if (uuid && *uuid)
-		dm_task_set_uuid(dmt, uuid);
+	if (uuid && *uuid && !dm_task_set_uuid(dmt, uuid))
+		goto_out;
 
-	if (event_nr)
-		dm_task_set_event_nr(dmt, *event_nr);
+	if (event_nr && !dm_task_set_event_nr(dmt, *event_nr))
+		goto_out;
 
-	if (major)
-		dm_task_set_major_minor(dmt, major, minor, 1);
+	if (major && !dm_task_set_major_minor(dmt, major, minor, 1))
+		goto_out;
 
 	return dmt;
+      out:
+	dm_task_destroy(dmt);
+	return NULL;
 }
 
 static int _info_run(const char *name, const char *dlid, struct dm_info *info,


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-12-08 19:26 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2010-12-08 19:26 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-12-08 19:26:36

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

Log message:
	Cope better with an undefined target_percent operation in _percent_run.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1830&r2=1.1831
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.207&r2=1.208

--- LVM2/WHATS_NEW	2010/12/08 10:45:37	1.1830
+++ LVM2/WHATS_NEW	2010/12/08 19:26:35	1.1831
@@ -1,6 +1,7 @@
 Version 2.02.79 -
 ===================================
-  Fix write to released memory in vg_relase().  (2.02.78)
+  Cope better with an undefined target_percent operation in _percent_run.
+  Fix write to released memory in vg_release().  (2.02.78)
 
 Version 2.02.78 - 6th December 2010
 ===================================
--- LVM2/lib/activate/dev_manager.c	2010/11/30 22:28:06	1.207
+++ LVM2/lib/activate/dev_manager.c	2010/12/08 19:26:36	1.208
@@ -507,8 +507,10 @@
 				continue;
 		}
 
-		if (segtype->ops->target_percent &&
-		    !segtype->ops->target_percent(&dm->target_state,
+		if (!segtype->ops->target_percent)
+			continue;
+
+		if (!segtype->ops->target_percent(&dm->target_state,
 						  &percent, dm->mem,
 						  dm->cmd, seg, params,
 						  &total_numerator,


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-10-25 10:37 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2010-10-25 10:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-10-25 10:37:35

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

Log message:
	restrict last checkin to devs consisting entirely of error target

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1766&r2=1.1767
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.204&r2=1.205

--- LVM2/WHATS_NEW	2010/10/24 17:36:58	1.1766
+++ LVM2/WHATS_NEW	2010/10/25 10:37:34	1.1767
@@ -1,6 +1,6 @@
 Version 2.02.75 - 
 =====================================
-  Never scan a device which is using the error target.
+  Skip dm devices in scan if they contain only error targets.
   Fix strict-aliasing compile warning in partition table scanning.
   Add an option to automatically extend snapshots through dmeventd.
   Remove dependency on libm, floor() is replaced with integer algorithm.
--- LVM2/lib/activate/dev_manager.c	2010/10/24 17:36:59	1.204
+++ LVM2/lib/activate/dev_manager.c	2010/10/25 10:37:35	1.205
@@ -135,10 +135,11 @@
 	char *target_type = NULL;
 	char *params, *vgname = NULL, *lvname, *layer;
 	void *next = NULL;
+	int only_error_target = 1;
 	int r = 0;
 
 	if (!(dmt = dm_task_create(DM_DEVICE_STATUS))) {
-		log_error("Failed to allocate dm_task struct to check dev status");
+		log_error("Failed to create dm_task struct to check dev status");
 		return 0;
 	}
 
@@ -159,6 +160,11 @@
 	name = dm_task_get_name(dmt);
 	uuid = dm_task_get_uuid(dmt);
 
+	if (!info.target_count) {
+		log_debug("%s: Empty device %s not usable.", dev_name(dev), name);
+		goto out;
+	}
+
 	if (info.suspended && ignore_suspended_devices()) {
 		log_debug("%s: Suspended device %s not usable.", dev_name(dev), name);
 		goto out;
@@ -191,13 +197,18 @@
 			goto out;
 		}
 
-		if (target_type && !strcmp(target_type, "error")) {
-			log_debug("%s: Error device %s not usable.",
-				  dev_name(dev), name);
-			goto out;
-		}
+		if (target_type && strcmp(target_type, "error"))
+			only_error_target = 0;
 	} while (next);
 
+	/* Skip devices consisting entirely of error targets. */
+	/* FIXME Deal with device stacked above error targets? */
+	if (only_error_target) {
+		log_debug("%s: Error device %s not usable.",
+			  dev_name(dev), name);
+		goto out;
+	}
+
 	/* FIXME Also check dependencies? */
 
 	/* Check internal lvm devices */


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-10-24 17:37 snitzer
  0 siblings, 0 replies; 39+ messages in thread
From: snitzer @ 2010-10-24 17:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-10-24 17:36:59

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

Log message:
	Never scan a device which is using the error target
	
	A merged snapshot's DM device is made to use the "error" target as part
	of lvm's transaction to merge a snapshot.  This snapshot merge use-case
	aside, any device using the error target shouldn't be scanned.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1765&r2=1.1766
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.203&r2=1.204

--- LVM2/WHATS_NEW	2010/10/20 15:07:30	1.1765
+++ LVM2/WHATS_NEW	2010/10/24 17:36:58	1.1766
@@ -1,5 +1,6 @@
 Version 2.02.75 - 
 =====================================
+  Never scan a device which is using the error target.
   Fix strict-aliasing compile warning in partition table scanning.
   Add an option to automatically extend snapshots through dmeventd.
   Remove dependency on libm, floor() is replaced with integer algorithm.
--- LVM2/lib/activate/dev_manager.c	2010/10/13 21:26:37	1.203
+++ LVM2/lib/activate/dev_manager.c	2010/10/24 17:36:59	1.204
@@ -190,6 +190,12 @@
 				  dev_name(dev), name);
 			goto out;
 		}
+
+		if (target_type && !strcmp(target_type, "error")) {
+			log_debug("%s: Error device %s not usable.",
+				  dev_name(dev), name);
+			goto out;
+		}
 	} while (next);
 
 	/* FIXME Also check dependencies? */


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-08-26 14:21 jbrassow
  0 siblings, 0 replies; 39+ messages in thread
From: jbrassow @ 2010-08-26 14:21 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2010-08-26 14:21:52

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

Log message:
	This patch fixes a potential for I/O to hang and LVM commands
	to block when a mirror under a snapshot suffers a failure.
	
	The problem has to do with label scanning.  When a mirror suffers
	a failure, the kernel blocks I/O to prevent corruption.  When
	LVM attempts to repair the mirror, it scans the devices on the
	system for LVM labels.  While mirrors are skipped during this
	scanning process, snapshot-origins are not.  When the origin is
	scanned, it kicks up I/O to the mirror (which is blocked)
	underneath - causing the label scan (an thus the repair operation)
	to hang.
	
	This patch simply bypasses snapshot-origin devices when doing
	labels scans (while ignore_suspended_devices() is set).  This
	fixes the issue.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1724&r2=1.1725
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.201&r2=1.202

--- LVM2/WHATS_NEW	2010/08/26 12:08:19	1.1724
+++ LVM2/WHATS_NEW	2010/08/26 14:21:50	1.1725
@@ -1,5 +1,6 @@
 Version 2.02.74 - 
 ==================================
+  Like mirrors, don't scan origins if ignore_suspended_devices() is set.
   Fix return type qualifier to avoid compiler warning. (2.02.69)
   Automatically generate LSB Requires-Start for clvmd init script.
   Fix return code of pvmove --abort PV.
--- LVM2/lib/activate/dev_manager.c	2010/08/17 19:25:05	1.201
+++ LVM2/lib/activate/dev_manager.c	2010/08/26 14:21:51	1.202
@@ -175,6 +175,21 @@
 			log_debug("%s: Mirror device %s not usable.", dev_name(dev), name);
 			goto out;
 		}
+
+		/*
+		 * Snapshot origin could be sitting on top of a mirror which
+		 * could be blocking I/O.  Skip snapshot origins entirely for
+		 * now.
+		 *
+		 * FIXME: rather than skipping origin, check if mirror is
+		 * underneath and if the mirror is blocking I/O.
+		 */
+		if (target_type && !strcmp(target_type, "snapshot-origin") &&
+		    ignore_suspended_devices()) {
+			log_debug("%s: Snapshot-origin device %s not usable.",
+				  dev_name(dev), name);
+			goto out;
+		}
 	} while (next);
 
 	/* FIXME Also check dependencies? */


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-08-17  1:51 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2010-08-17  1:51 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2010-08-17 01:51:12

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

Log message:
	Fix dev_manager_transient to access -real device not snapshot-origin. (brassow)
	
	Another reminder why cloning functions impedes maintenance.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1706&r2=1.1707
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.198&r2=1.199

--- LVM2/WHATS_NEW	2010/08/17 01:16:41	1.1706
+++ LVM2/WHATS_NEW	2010/08/17 01:51:12	1.1707
@@ -1,5 +1,6 @@
 Version 2.02.73 - 
 ================================
+  Fix dev_manager_transient to access -real device not snapshot-origin.
   Monitor origin -real device below snapshot instead of overlay device.
   Don't really change monitoring status when in test mode.
   Fix some exit statuses when starting/stopping monitoring fails.
--- LVM2/lib/activate/dev_manager.c	2010/08/09 14:05:16	1.198
+++ LVM2/lib/activate/dev_manager.c	2010/08/17 01:51:12	1.199
@@ -548,6 +548,7 @@
 	return 0;
 }
 
+/* FIXME Merge with the percent function */
 int dev_manager_transient(struct dev_manager *dm, struct logical_volume *lv)
 {
 	int r = 0;
@@ -558,10 +559,11 @@
 	char *type = NULL;
 	char *params = NULL;
 	char *dlid = NULL;
+	char *suffix = lv_is_origin(lv) ? "real" : NULL;
 	const struct dm_list *segh = &lv->segments;
 	struct lv_segment *seg = NULL;
 
-	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, NULL)))
+	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, suffix)))
 		return_0;
 
 	if (!(dmt = _setup_task(0, dlid, NULL, DM_DEVICE_STATUS, 0, 0)))


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-08-03 13:13 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2010-08-03 13:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-08-03 13:13:01

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

Log message:
	Fix const warning in dev_manager_info() and _dev_manager_lv_rmnodes().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1690&r2=1.1691
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.196&r2=1.197

--- LVM2/WHATS_NEW	2010/08/03 13:09:21	1.1690
+++ LVM2/WHATS_NEW	2010/08/03 13:13:01	1.1691
@@ -1,6 +1,7 @@
 Version 2.02.73 - 
 ================================
-  Fix constness warning in archive_file structure from archive.c.
+  Fix const warning in dev_manager_info() and _dev_manager_lv_rmnodes().
+  Fix const warning in archive_file structure from archive.c.
   Clean generated files .exported_symbols_generated, example.conf for distclean.
   Handle failure of all mirrored log devices and all but one mirror leg. 
   Disallow 'mirrored' log type for cluster mirrors.
--- LVM2/lib/activate/dev_manager.c	2010/07/09 15:34:42	1.196
+++ LVM2/lib/activate/dev_manager.c	2010/08/03 13:13:01	1.197
@@ -220,7 +220,7 @@
 		     int with_open_count, int with_read_ahead,
 		     struct dm_info *info, uint32_t *read_ahead)
 {
-	const char *dlid, *name;
+	char *dlid, *name;
 	int r;
 
 	if (!(name = build_dm_name(mem, lv->vg->name, lv->name, NULL))) {
@@ -236,7 +236,7 @@
 	log_debug("Getting device info for %s [%s]", name, dlid);
 	r = _info(dlid, with_open_count, with_read_ahead, info, read_ahead);
 
-	dm_pool_free(mem, (char*)name);
+	dm_pool_free(mem, name);
 	return r;
 }
 
@@ -812,7 +812,7 @@
 int dev_manager_mknodes(const struct logical_volume *lv)
 {
 	struct dm_info dminfo;
-	const char *name;
+	char *name;
 	int r = 0;
 
 	if (!(name = build_dm_name(lv->vg->cmd->mem, lv->vg->name, lv->name, NULL)))
@@ -826,7 +826,7 @@
 			r = _dev_manager_lv_rmnodes(lv);
 	}
 
-	dm_pool_free(lv->vg->cmd->mem, (char*)name);
+	dm_pool_free(lv->vg->cmd->mem, name);
 	return r;
 }
 


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-05-24  9:01 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2010-05-24  9:01 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-05-24 09:01:05

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

Log message:
	Replicator: add replicator to dtree
	
	Adding all replicator related LVs to dtree.
	Start of one replicator_dev initiate start of all other related.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1592&r2=1.1593
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.192&r2=1.193

--- LVM2/WHATS_NEW	2010/05/24 08:59:29	1.1592
+++ LVM2/WHATS_NEW	2010/05/24 09:01:05	1.1593
@@ -1,5 +1,6 @@
 Version 2.02.67 -
 ===============================
+  Add Replicators' LVs to dtree for activation.
   Avoid print activation message if there is a missing VG (Replicator).
   Fixed scripts/relpath.awk to work in mawk
   Add _add_partial_replicator_to_dtree().
--- LVM2/lib/activate/dev_manager.c	2010/05/21 14:47:59	1.192
+++ LVM2/lib/activate/dev_manager.c	2010/05/24 09:01:05	1.193
@@ -1200,6 +1200,61 @@
 static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
 				  struct logical_volume *lv, const char *layer);
 
+/* Add all replicators' LVs */
+static int _add_replicator_dev_target_to_dtree(struct dev_manager *dm,
+					       struct dm_tree *dtree,
+					       struct lv_segment *seg)
+{
+	struct replicator_device *rdev;
+	struct replicator_site *rsite;
+
+	/* For inactive replicator add linear mapping */
+	if (!lv_is_active_replicator_dev(seg->lv)) {
+		if (!_add_new_lv_to_dtree(dm, dtree, seg->lv->rdevice->lv, NULL))
+			return_0;
+		return 1;
+	}
+
+	/* Add rlog and replicator nodes */
+	if (!seg->replicator ||
+            !first_seg(seg->replicator)->rlog_lv ||
+	    !_add_new_lv_to_dtree(dm, dtree,
+				  first_seg(seg->replicator)->rlog_lv, NULL) ||
+	    !_add_new_lv_to_dtree(dm, dtree, seg->replicator, NULL))
+	    return_0;
+
+	/* Activation of one replicator_dev node activates all other nodes */
+	dm_list_iterate_items(rsite, &seg->replicator->rsites) {
+		dm_list_iterate_items(rdev, &rsite->rdevices) {
+			if (rdev->lv &&
+			    !_add_new_lv_to_dtree(dm, dtree, rdev->lv, NULL))
+				return_0;
+
+			if (rdev->slog &&
+			    !_add_new_lv_to_dtree(dm, dtree,
+						  rdev->slog, NULL))
+				return_0;
+		}
+	}
+	/* Add remaining replicator-dev nodes in the second loop
+	 * to avoid multiple retries for inserting all elements */
+	dm_list_iterate_items(rsite, &seg->replicator->rsites) {
+		if (rsite->state != REPLICATOR_STATE_ACTIVE)
+			continue;
+		dm_list_iterate_items(rdev, &rsite->rdevices) {
+			if (rdev->replicator_dev->lv == seg->lv)
+				continue;
+			if (!rdev->replicator_dev->lv ||
+			    !_add_new_lv_to_dtree(dm, dtree,
+						  rdev->replicator_dev->lv,
+						  NULL))
+				return_0;
+		}
+	}
+
+	return 1;
+}
+
 static int _add_segment_to_dtree(struct dev_manager *dm,
 				   struct dm_tree *dtree,
 				   struct dm_tree_node *dnode,
@@ -1230,9 +1285,12 @@
 	    !_add_new_lv_to_dtree(dm, dtree, seg->log_lv, NULL))
 		return_0;
 
+	if (seg_is_replicator_dev(seg)) {
+		if (!_add_replicator_dev_target_to_dtree(dm, dtree, seg))
+			return_0;
 	/* If this is a snapshot origin, add real LV */
 	/* If this is a snapshot origin + merging snapshot, add cow + real LV */
-	if (lv_is_origin(seg->lv) && !layer) {
+	} else if (lv_is_origin(seg->lv) && !layer) {
 		if (vg_is_clustered(seg->lv->vg)) {
 			log_error("Clustered snapshots are not yet supported");
 			return 0;


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-05-21 14:48 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2010-05-21 14:48 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-05-21 14:47:59

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

Log message:
	Replicator: update _create_partial_dtree()
	
	Adding function _add_partial_replicator_to_dtree() to create
	partial tree for Replicator target.
	
	Using dm_tree_node_set_presuspend_node() for Replicator.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1589&r2=1.1590
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.191&r2=1.192

--- LVM2/WHATS_NEW	2010/05/21 14:34:01	1.1589
+++ LVM2/WHATS_NEW	2010/05/21 14:47:58	1.1590
@@ -1,5 +1,6 @@
 Version 2.02.67 -
 ===============================
+  Add _add_partial_replicator_to_dtree().
   Activation code read and releases also remote VGs (Replicator).
   Check for missing VGs before taking lock_vol (Replicator).
   Update process_each_lv_in_vg() to use cmd_vg structure.
--- LVM2/lib/activate/dev_manager.c	2010/05/14 12:39:52	1.191
+++ LVM2/lib/activate/dev_manager.c	2010/05/21 14:47:59	1.192
@@ -865,6 +865,84 @@
 }
 
 /*
+ * Add replicator devices
+ *
+ * Using _add_dev_to_dtree() directly instead of _add_lv_to_dtree()
+ * to avoid extra checks with extensions.
+ */
+static int _add_partial_replicator_to_dtree(struct dev_manager *dm,
+					    struct dm_tree *dtree,
+					    struct logical_volume *lv)
+{
+	struct logical_volume *rlv = first_seg(lv)->replicator;
+	struct replicator_device *rdev;
+	struct replicator_site *rsite;
+	struct dm_tree_node *rep_node, *rdev_node;
+	const char *uuid;
+
+	if (!lv_is_active_replicator_dev(lv)) {
+		if (!_add_dev_to_dtree(dm, dtree, lv->rdevice->lv,
+				      NULL))
+			return_0;
+		return 1;
+	}
+
+	/* Add _rlog and replicator device */
+	if (!_add_dev_to_dtree(dm, dtree, first_seg(rlv)->rlog_lv, NULL))
+		return_0;
+
+	if (!_add_dev_to_dtree(dm, dtree, rlv, NULL))
+		return_0;
+
+	if (!(uuid = build_dm_uuid(dm->mem, rlv->lvid.s, NULL)))
+		return_0;
+
+	rep_node = dm_tree_find_node_by_uuid(dtree, uuid);
+
+	/* Add all related devices for replicator */
+	dm_list_iterate_items(rsite, &rlv->rsites)
+		dm_list_iterate_items(rdev, &rsite->rdevices) {
+			if (rsite->state == REPLICATOR_STATE_ACTIVE) {
+				/* Add _rimage LV */
+				if (!_add_dev_to_dtree(dm, dtree, rdev->lv, NULL))
+					return_0;
+
+				/* Add replicator-dev LV, except of the already added one */
+				if ((lv != rdev->replicator_dev->lv) &&
+				    !_add_dev_to_dtree(dm, dtree,
+						       rdev->replicator_dev->lv, NULL))
+					return_0;
+
+				/* If replicator exists - try connect existing heads */
+				if (rep_node) {
+					uuid = build_dm_uuid(dm->mem,
+							     rdev->replicator_dev->lv->lvid.s,
+							     NULL);
+					if (!uuid)
+						return_0;
+
+					rdev_node = dm_tree_find_node_by_uuid(dtree, uuid);
+					if (rdev_node)
+						dm_tree_node_set_presuspend_node(rdev_node,
+										 rep_node);
+				}
+			}
+
+			if (!rdev->rsite->vg_name)
+				continue;
+
+			if (!_add_dev_to_dtree(dm, dtree, rdev->lv, NULL))
+				return_0;
+
+			if (rdev->slog &&
+			    !_add_dev_to_dtree(dm, dtree, rdev->slog, NULL))
+				return_0;
+		}
+
+	return 1;
+}
+
+/*
  * Add LV and any known dependencies
  */
 static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, struct logical_volume *lv)
@@ -883,6 +961,11 @@
 	    !_add_dev_to_dtree(dm, dtree, first_seg(lv)->log_lv, NULL))
 		return_0;
 
+	/* Adding LV head of replicator adds all other related devs */
+	if (lv_is_replicator_dev(lv) &&
+	    !_add_partial_replicator_to_dtree(dm, dtree, lv))
+		return_0;
+
 	return 1;
 }
 


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-02-08 23:28 snitzer
  0 siblings, 0 replies; 39+ messages in thread
From: snitzer @ 2010-02-08 23:28 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-02-08 23:28:06

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

Log message:
	Remove false "failed to find tree node for <lv>" error from _cached_info().
	
	When activating a merging origin it is valid, and expected, to not have
	a node in the deptree for both the origin and its merging snapshot.  The
	_cached_info() caller is only concerned with whether a device is open.
	If there isn't a node in the tree the associated device is definitely
	not open.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1423&r2=1.1424
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.178&r2=1.179

--- LVM2/WHATS_NEW	2010/02/06 07:44:16	1.1423
+++ LVM2/WHATS_NEW	2010/02/08 23:28:06	1.1424
@@ -1,5 +1,6 @@
 Version 2.02.61 - 
 ===================================
+  Remove false "failed to find tree node for" error when activating merging origin.
   Make lvconvert --repair --use-policies exit with success when no action is needed.
   Add multiple snapshot lv 'lvconvert --merge @tag' support via process_each_lv().
   Fix inappropriate second resync when adding mimage to core-logged mirror.
--- LVM2/lib/activate/dev_manager.c	2010/01/26 07:58:23	1.178
+++ LVM2/lib/activate/dev_manager.c	2010/02/08 23:28:06	1.179
@@ -264,10 +264,9 @@
 		return NULL;
 	}
 
-	if (!(dnode = dm_tree_find_node_by_uuid(dtree, dlid))) {
-		log_error("failed to find tree node for %s", lv->name);
+	/* An activating merging origin won't have a node in the tree yet */
+	if (!(dnode = dm_tree_find_node_by_uuid(dtree, dlid)))
 		return NULL;
-	}
 
 	if (!(dinfo = dm_tree_node_get_info(dnode))) {
 		log_error("failed to get info from tree node for %s", lv->name);


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-01-26  7:58 mbroz
  0 siblings, 0 replies; 39+ messages in thread
From: mbroz @ 2010-01-26  7:58 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-01-26 07:58:23

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

Log message:
	Fix return code of info callbacks.
	
	In dev_manager_info 0 means error and 1 info is returned,
	not that device exists (that value is part of info struct).
	
	Fix query by uuid only (no name) which returns 0 when device
	does not exist.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1407&r2=1.1408
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.177&r2=1.178

--- LVM2/WHATS_NEW	2010/01/23 02:14:30	1.1407
+++ LVM2/WHATS_NEW	2010/01/26 07:58:23	1.1408
@@ -1,5 +1,6 @@
 Version 2.02.60 - 23rd January 2010
 ===================================
+  Fix return code of info call for query by uuid.
   Extend cmirrord man page.
   Sleep before first progress check if pvmove/lvconvert interval has prefix '+'.
   Default to checking progress before waiting in _wait_for_single_lv.
--- LVM2/lib/activate/dev_manager.c	2010/01/22 15:40:32	1.177
+++ LVM2/lib/activate/dev_manager.c	2010/01/26 07:58:23	1.178
@@ -209,14 +209,16 @@
 		 int with_open_count, int with_read_ahead,
 		 struct dm_info *info, uint32_t *read_ahead)
 {
+	int r = 0;
+
 	if (!mknodes && dlid && *dlid) {
-		if (_info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
-			      with_read_ahead, 0, 0) &&
+		if ((r = _info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
+			      with_read_ahead, 0, 0)) &&
 	    	    info->exists)
 			return 1;
-		else if (_info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
+		else if ((r = _info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
 				   read_ahead, 0, with_open_count,
-				   with_read_ahead, 0, 0) &&
+				   with_read_ahead, 0, 0)) &&
 			 info->exists)
 			return 1;
 	}
@@ -225,7 +227,7 @@
 		return _info_run(name, NULL, info, read_ahead, mknodes,
 				 with_open_count, with_read_ahead, 0, 0);
 
-	return 0;
+	return r;
 }
 
 static int _info_by_dev(uint32_t major, uint32_t minor, struct dm_info *info)


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2010-01-22 15:40 snitzer
  0 siblings, 0 replies; 39+ messages in thread
From: snitzer @ 2010-01-22 15:40 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	snitzer@sourceware.org	2010-01-22 15:40:32

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

Log message:
	Eliminate extra ioctls just to check open_count in _add_new_lv_to_dtree.
	
	DM >= 4.7.0 always returns open_count so just use the associated nodes'
	existing info.
	
	Introduce _cached_info() to get an LV's cached info.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1403&r2=1.1404
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.176&r2=1.177

--- LVM2/WHATS_NEW	2010/01/22 14:33:33	1.1403
+++ LVM2/WHATS_NEW	2010/01/22 15:40:31	1.1404
@@ -1,5 +1,6 @@
 Version 2.02.60
 ===================================
+  Eliminate extra ioctls just to check open_count in _add_new_lv_to_dtree.
   Disable not thread-safe memory debugging if dmeventd is configured.
   Fix first log message prefix in syslog for dmeventd plugins.
   Fix exported symbols names for dmeventd lvm2 wrapper plugin.
--- LVM2/lib/activate/dev_manager.c	2010/01/22 13:28:54	1.176
+++ LVM2/lib/activate/dev_manager.c	2010/01/22 15:40:32	1.177
@@ -249,6 +249,35 @@
 		     info, read_ahead);
 }
 
+static const struct dm_info *_cached_info(struct dm_pool *mem,
+					  const struct logical_volume *lv,
+					  struct dm_tree *dtree)
+{
+	const char *dlid;
+	struct dm_tree_node *dnode;
+	const struct dm_info *dinfo;
+
+	if (!(dlid = _build_dlid(mem, lv->lvid.s, NULL))) {
+		log_error("dlid build failed for %s", lv->name);
+		return NULL;
+	}
+
+	if (!(dnode = dm_tree_find_node_by_uuid(dtree, dlid))) {
+		log_error("failed to find tree node for %s", lv->name);
+		return NULL;
+	}
+
+	if (!(dinfo = dm_tree_node_get_info(dnode))) {
+		log_error("failed to get info from tree node for %s", lv->name);
+		return NULL;
+	}
+
+	if (!dinfo->exists)
+		return NULL;
+
+	return dinfo;
+}
+
 /* FIXME Interface must cope with multiple targets */
 static int _status_run(const char *name, const char *uuid,
 		       unsigned long long *s, unsigned long long *l,
@@ -1117,7 +1146,7 @@
 	struct lv_segment *seg;
 	struct lv_layer *lvlayer;
 	struct dm_tree_node *dnode;
-	struct dm_info dinfo;
+	const struct dm_info *dinfo;
 	char *name, *dlid, *lv_name;
 	uint32_t max_stripe_size = UINT32_C(0);
 	uint32_t read_ahead = lv->read_ahead;
@@ -1130,15 +1159,14 @@
 		/*
 		 * Clear merge attributes if merge isn't currently possible:
 		 * either origin or merging snapshot are open
-		 * - must refresh info's open_count, so using the tree's
-		 *   existing nodes' info isn't an option
-		 * - but use "snapshot-merge" if it is already being used
+		 * - but use "snapshot-merge" if it is already in use
+		 * - open_count is always retrieved (as of dm-ioctl 4.7.0)
+		 *   so just use the tree's existing nodes' info
 		 */
-		/* FIXME Avoid this - open_count is always returned by kernel now. */
-		if ((dev_manager_info(dm->mem, NULL, lv,
-				      0, 1, 0, &dinfo, NULL) && dinfo.open_count) ||
-		    (dev_manager_info(dm->mem, NULL, find_merging_cow(lv)->cow,
-				      0, 1, 0, &dinfo, NULL) && dinfo.open_count)) {
+		if (((dinfo = _cached_info(dm->mem, lv,
+					   dtree)) && dinfo->open_count) ||
+		    ((dinfo = _cached_info(dm->mem, find_merging_cow(lv)->cow,
+					   dtree)) && dinfo->open_count)) {
 			/* FIXME Is there anything simpler to check for instead? */
 			if (!_lv_has_target_type(dm, lv, NULL, "snapshot-merge"))
 				clear_snapshot_merge(lv);


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2009-05-28  1:11 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2009-05-28  1:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

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

Log message:
	Remove /dev/vgname/lvname symlink automatically if LV is no longer visible.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1130&r2=1.1131
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.150&r2=1.151

--- LVM2/WHATS_NEW	2009/05/28 00:29:14	1.1130
+++ LVM2/WHATS_NEW	2009/05/28 01:11:29	1.1131
@@ -1,5 +1,6 @@
 Version 2.02.48 - 
 ===============================
+  Remove /dev/vgname/lvname symlink automatically if LV is no longer visible.
   Rename internal vorigin LV to match visible LV.
   Suppress 'removed' messages displayed when internal LVs are removed.
   Fix lvchange -a and -p for sparse LVs.
--- LVM2/lib/activate/dev_manager.c	2009/05/20 11:09:49	1.150
+++ LVM2/lib/activate/dev_manager.c	2009/05/28 01:11:30	1.151
@@ -1067,7 +1067,14 @@
 			}
 			if (!fs_rename_lv(lvlayer->lv, name, old_vgname, old_lvname))
 				r = 0;
-		} else if (!dev_manager_lv_mknodes(lvlayer->lv))
+			continue;
+		}
+		if (lv_is_visible(lvlayer->lv)) {
+			if (!dev_manager_lv_mknodes(lvlayer->lv))
+				r = 0;
+			continue;
+		}
+		if (!dev_manager_lv_rmnodes(lvlayer->lv))
 			r = 0;
 	}
 


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2009-05-13 14:13 zkabelac
  0 siblings, 0 replies; 39+ messages in thread
From: zkabelac @ 2009-05-13 14:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2009-05-13 14:13:55

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

Log message:
	Do not query nonexistent devices for readahead.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1102&r2=1.1103
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.147&r2=1.148

--- LVM2/WHATS_NEW	2009/05/13 13:02:52	1.1102
+++ LVM2/WHATS_NEW	2009/05/13 14:13:54	1.1103
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Do not query nonexistent devices for readahead.
   Remove NON_BLOCKING lock flag from tools and set a policy to auto-set.
   Remove snapshot_count from VG and use function instead.
   Fix first_seg() call for empty segment list.
--- LVM2/lib/activate/dev_manager.c	2009/05/07 12:01:21	1.147
+++ LVM2/lib/activate/dev_manager.c	2009/05/13 14:13:55	1.148
@@ -141,7 +141,7 @@
 	if (!dm_task_get_info(dmt, info))
 		goto_out;
 
-	if (with_read_ahead) {
+	if (with_read_ahead && info->exists) {
 		if (!dm_task_get_read_ahead(dmt, read_ahead))
 			goto_out;
 	} else if (read_ahead)


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2008-12-19 15:23 mbroz
  0 siblings, 0 replies; 39+ messages in thread
From: mbroz @ 2008-12-19 15:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

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

Log message:
	Fail add tree node when requested major/minor is used.
	
	Check for major/minor collision is added in _add_dev_to_dtree()
	where we already read info by uuid,
	so in the case of requesting major/minor it queries device-mapper
	by major/minor for device availability.
	
	Fixes https://bugzilla.redhat.com/show_bug.cgi?id=204992

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1011&r2=1.1012
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.143&r2=1.144

--- LVM2/WHATS_NEW	2008/12/19 14:43:02	1.1011
+++ LVM2/WHATS_NEW	2008/12/19 15:23:03	1.1012
@@ -1,5 +1,6 @@
 Version 2.02.44 - 
 ====================================
+  Check if requested major/minor pair is already used.
   Fix incorrect return value in help function.
   Fix vgrename using UUID in case there are VGs with the same name.
   Fix segfault when invalid field given in reporting commands.
--- LVM2/lib/activate/dev_manager.c	2008/12/19 14:22:48	1.143
+++ LVM2/lib/activate/dev_manager.c	2008/12/19 15:23:03	1.144
@@ -93,7 +93,8 @@
  * Low level device-layer operations.
  */
 static struct dm_task *_setup_task(const char *name, const char *uuid,
-				   uint32_t *event_nr, int task)
+				   uint32_t *event_nr, int task,
+				   uint32_t major, uint32_t minor)
 {
 	struct dm_task *dmt;
 
@@ -109,12 +110,17 @@
 	if (event_nr)
 		dm_task_set_event_nr(dmt, *event_nr);
 
+	if (major) {
+		dm_task_set_major(dmt, major);
+		dm_task_set_minor(dmt, minor);
+	}
+
 	return dmt;
 }
 
 static int _info_run(const char *name, const char *dlid, struct dm_info *info,
 		     uint32_t *read_ahead, int mknodes, int with_open_count,
-		     int with_read_ahead)
+		     int with_read_ahead, uint32_t major, uint32_t minor)
 {
 	int r = 0;
 	struct dm_task *dmt;
@@ -122,7 +128,7 @@
 
 	dmtask = mknodes ? DM_DEVICE_MKNODES : DM_DEVICE_INFO;
 
-	if (!(dmt = _setup_task(name, dlid, 0, dmtask)))
+	if (!(dmt = _setup_task(name, dlid, 0, dmtask, major, minor)))
 		return_0;
 
 	if (!with_open_count)
@@ -206,23 +212,28 @@
 {
 	if (!mknodes && dlid && *dlid) {
 		if (_info_run(NULL, dlid, info, read_ahead, 0, with_open_count,
-			      with_read_ahead) &&
+			      with_read_ahead, 0, 0) &&
 	    	    info->exists)
 			return 1;
 		else if (_info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
 				   read_ahead, 0, with_open_count,
-				   with_read_ahead) &&
+				   with_read_ahead, 0, 0) &&
 			 info->exists)
 			return 1;
 	}
 
 	if (name)
 		return _info_run(name, NULL, info, read_ahead, mknodes,
-				 with_open_count, with_read_ahead);
+				 with_open_count, with_read_ahead, 0, 0);
 
 	return 0;
 }
 
+static int _info_by_dev(uint32_t major, uint32_t minor, struct dm_info *info)
+{
+	return _info_run(NULL, NULL, info, NULL, 0, 0, 0, major, minor);
+}
+
 int dev_manager_info(struct dm_pool *mem, const char *name,
 		     const struct logical_volume *lv, int with_mknodes,
 		     int with_open_count, int with_read_ahead,
@@ -252,7 +263,7 @@
 	char *type = NULL;
 	char *params = NULL;
 
-	if (!(dmt = _setup_task(name, uuid, 0, DM_DEVICE_STATUS)))
+	if (!(dmt = _setup_task(name, uuid, 0, DM_DEVICE_STATUS, 0, 0)))
 		return_0;
 
 	if (!dm_task_no_open_count(dmt))
@@ -339,7 +350,7 @@
 	*percent = -1;
 
 	if (!(dmt = _setup_task(name, dlid, event_nr,
-				wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS)))
+				wait ? DM_DEVICE_WAITEVENT : DM_DEVICE_STATUS, 0, 0)))
 		return_0;
 
 	if (!dm_task_no_open_count(dmt))
@@ -610,7 +621,7 @@
 			       struct logical_volume *lv, const char *layer)
 {
 	char *dlid, *name;
-	struct dm_info info;
+	struct dm_info info, info2;
 
 	if (!(name = build_dm_name(dm->mem, lv->vg->name, lv->name, layer)))
 		return_0;
@@ -624,6 +635,27 @@
 		return 0;
 	}
 
+	/*
+	 * For top level volumes verify that existing device match
+	 * requested major/minor and that major/minor pair is available for use
+	 */
+	if (!layer && lv->major != -1 && lv->minor != -1) {
+		if (info.exists && (info.major != lv->major || info.minor != lv->minor)) {
+			log_error("Volume %s (%" PRIu32 ":%" PRIu32")"
+				  " differs from already active device "
+				  "(%" PRIu32 ":%" PRIu32")",
+				  lv->name, lv->major, lv->minor, info.major, info.minor);
+			return 0;
+		}
+		if (!info.exists && _info_by_dev(lv->major, lv->minor, &info2) &&
+		    info2.exists) {
+			log_error("The requested major:minor pair "
+				  "(%" PRIu32 ":%" PRIu32") is already used",
+				  lv->major, lv->minor);
+			return 0;
+		}
+	}
+
 	if (info.exists && !dm_tree_add_dev(dtree, info.major, info.minor)) {
 		log_error("Failed to add device (%" PRIu32 ":%" PRIu32") to dtree",
 			  info.major, info.minor);


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2008-06-05 12:45 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2008-06-05 12:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-06-05 12:45:55

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

Log message:
	When removing LV symlinks, skip any where the VG name is not determined.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.880&r2=1.881
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.136&r2=1.137

--- LVM2/WHATS_NEW	2008/06/03 17:56:54	1.880
+++ LVM2/WHATS_NEW	2008/06/05 12:45:53	1.881
@@ -9,6 +9,7 @@
 
 Version 2.02.37 - 
 =================================
+  When removing LV symlinks, skip any where the VG name is not determined.
   Drop metadata cache if update fails in vg_revert or vg_commit.
   Avoid spurious duplicate VG messages referring to VGs that are gone.
   Drop dev_name_confirmed error message to debug level.
--- LVM2/lib/activate/dev_manager.c	2008/04/10 17:09:30	1.136
+++ LVM2/lib/activate/dev_manager.c	2008/06/05 12:45:55	1.137
@@ -995,6 +995,9 @@
 			continue;
 		}
 
+		if (!*vgname)
+			continue;
+
 		/* only top level layer has symlinks */
 		if (*layer)
 			continue;


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2007-05-14 11:27 mbroz
  0 siblings, 0 replies; 39+ messages in thread
From: mbroz @ 2007-05-14 11:27 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2007-05-14 11:27:34

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

Log message:
	Fix a segfault if a device has no target (no table)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.615&r2=1.616
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.122&r2=1.123

--- LVM2/WHATS_NEW	2007/05/02 12:22:40	1.615
+++ LVM2/WHATS_NEW	2007/05/14 11:27:33	1.616
@@ -1,5 +1,6 @@
 Version 2.02.26 -
 =================================
+  Fix a segfault if a device has no target (no table)
   Add some more debuglogs to clvmd startup.
   Misc clvmd cleanups
 
--- LVM2/lib/activate/dev_manager.c	2007/04/26 16:44:58	1.122
+++ LVM2/lib/activate/dev_manager.c	2007/05/14 11:27:34	1.123
@@ -187,7 +187,7 @@
                 next = dm_get_next_target(dmt, next, &start, &length,
                                           &target_type, &params);
                 /* Skip if target type doesn't match */
-                if (!strcmp(target_type, "mirror"))
+                if (target_type && !strcmp(target_type, "mirror"))
 			goto out;
         } while (next);
 


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2007-03-08 19:58 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2007-03-08 19:58 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-03-08 19:58:04

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

Log message:
	Remove no-longer-used uuid_out parameter from activation info functions.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.578&r2=1.579
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.120&r2=1.121

--- LVM2/WHATS_NEW	2007/03/08 19:22:52	1.578
+++ LVM2/WHATS_NEW	2007/03/08 19:58:04	1.579
@@ -1,5 +1,6 @@
 Version 2.02.23 - 
 ====================================
+  Remove no-longer-used uuid_out parameter from activation info functions.
   Fix two more segfaults if an empty config file section encountered.
   Move .cache file into a new /etc/lvm/cache directory by default.
   Add devices/cache_dir & devices/cache_file_prefix, deprecating devices/cache.
--- LVM2/lib/activate/dev_manager.c	2007/01/25 23:03:47	1.120
+++ LVM2/lib/activate/dev_manager.c	2007/03/08 19:58:04	1.121
@@ -118,12 +118,10 @@
 }
 
 static int _info_run(const char *name, const char *dlid, struct dm_info *info,
-		     int mknodes, int with_open_count, struct dm_pool *mem,
-		     char **uuid_out)
+		     int mknodes, int with_open_count)
 {
 	int r = 0;
 	struct dm_task *dmt;
-	const char *u;
 	int dmtask;
 
 	dmtask = mknodes ? DM_DEVICE_MKNODES : DM_DEVICE_INFO;
@@ -143,11 +141,6 @@
 	if (!dm_task_get_info(dmt, info))
 		goto_out;
 
-	if (info->exists && uuid_out) {
-		if (!(u = dm_task_get_uuid(dmt)))
-			goto_out;
-		*uuid_out = dm_pool_strdup(mem, u);
-	}
 	r = 1;
 
       out:
@@ -208,23 +201,20 @@
 }
 
 static int _info(const char *name, const char *dlid, int mknodes,
-		 int with_open_count, struct dm_info *info,
-		 struct dm_pool *mem, char **uuid_out)
+		 int with_open_count, struct dm_info *info)
 {
 	if (!mknodes && dlid && *dlid) {
-		if (_info_run(NULL, dlid, info, 0, with_open_count, mem,
-			      uuid_out) &&
+		if (_info_run(NULL, dlid, info, 0, with_open_count) &&
 	    	    info->exists)
 			return 1;
 		else if (_info_run(NULL, dlid + sizeof(UUID_PREFIX) - 1, info,
-				   0, with_open_count, mem, uuid_out) &&
+				   0, with_open_count) &&
 			 info->exists)
 			return 1;
 	}
 
 	if (name)
-		return _info_run(name, NULL, info, mknodes, with_open_count,
-				 mem, uuid_out);
+		return _info_run(name, NULL, info, mknodes, with_open_count);
 
 	return 0;
 }
@@ -240,8 +230,7 @@
 		return 0;
 	}
 
-	return _info(name, dlid, with_mknodes, with_open_count, info,
-		     NULL, NULL);
+	return _info(name, dlid, with_mknodes, with_open_count, info);
 }
 
 /* FIXME Interface must cope with multiple targets */
@@ -646,7 +635,7 @@
 		return_0;
 
         log_debug("Getting device info for %s [%s]", name, dlid);
-        if (!_info(name, dlid, 0, 1, &info, dm->mem, NULL)) {
+        if (!_info(name, dlid, 0, 1, &info)) {
                 log_error("Failed to get info for %s [%s].", name, dlid);
                 return 0;
         }


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2006-11-20 16:45 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2006-11-20 16:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

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

Log message:
	Fix check for snapshot module when activating snapshot.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.500&r2=1.501
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.115&r2=1.116

--- LVM2/WHATS_NEW	2006/11/17 02:45:51	1.500
+++ LVM2/WHATS_NEW	2006/11/20 16:45:45	1.501
@@ -1,5 +1,6 @@
 Version 2.02.15 -
 ====================================
+  Fix check for snapshot module when activating snapshot.
   Fix pvremove error path for case when PV is in use.
   Warn if certain duplicate config file entries are seen.
   Enhance lvm_dump.sh for sysreport integration and add man page.
--- LVM2/lib/activate/dev_manager.c	2006/10/18 18:01:51	1.115
+++ LVM2/lib/activate/dev_manager.c	2006/11/20 16:45:45	1.116
@@ -782,12 +782,19 @@
 {
 	uint32_t s;
 	struct list *snh;
+	struct lv_segment *seg_present;
 
 	/* Ensure required device-mapper targets are loaded */
-	if (seg->segtype->ops->target_present &&
-	    !seg->segtype->ops->target_present(seg)) {
+	seg_present = find_cow(seg->lv) ? : seg;
+
+	log_debug("Checking kernel supports %s segment type for %s%s%s",
+		  seg_present->segtype->name, seg->lv->name,
+		  layer ? "-" : "", layer ? : "");
+
+	if (seg_present->segtype->ops->target_present &&
+	    !seg_present->segtype->ops->target_present(seg_present)) {
 		log_error("Can't expand LV %s: %s target support missing "
-			  "from kernel?", seg->lv->name, seg->segtype->name);
+			  "from kernel?", seg->lv->name, seg_present->segtype->name);
 		return 0;
 	}
 


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2006-07-10 19:17 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2006-07-10 19:17 UTC (permalink / raw)
  To: lvm2-cvs

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

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

Log message:
	Don't ignore persistent minor numbers when activating.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.407&r2=1.408
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.111&r2=1.112

--- LVM2/WHATS_NEW	2006/07/04 19:40:27	1.407
+++ LVM2/WHATS_NEW	2006/07/10 19:17:40	1.408
@@ -1,5 +1,6 @@
 Version 2.02.07 - 
 =================================
+  Don't ignore persistent minor numbers when activating.
   Use RTLD_GLOBAL when loading shared libraries.
   Add some forgotten memlock checks to _vg_read to protect against full scans.
   Add mutex to dmeventd_mirror to avoid concurrent execution.
--- LVM2/lib/activate/dev_manager.c	2006/05/16 20:53:13	1.111
+++ LVM2/lib/activate/dev_manager.c	2006/07/10 19:17:40	1.112
@@ -866,8 +866,8 @@
 	 * Major/minor settings only apply to the visible layer.
 	 */
 	if (!(dnode = dm_tree_add_new_dev(dtree, name, dlid,
-					     layer ? (uint32_t) lv->major : UINT32_C(0),
-					     layer ? (uint32_t) lv->minor : UINT32_C(0),
+					     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)))


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2005-10-18 12:39 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2005-10-18 12:39 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-10-18 12:39:20

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

Log message:
	Move deactivation code into libdevmapper.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.305&r2=1.306
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.86&r2=1.87


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2005-08-04  1:27 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2005-08-04  1:27 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-08-04 01:27:26

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

Log message:
	Prevent snapshots getting activated in a clustered VG.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.271&r2=1.272
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2005-08-04  1:15 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2005-08-04  1:15 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-08-04 01:15:30

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

Log message:
	Separate out _build_dev_string.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.270&r2=1.271
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.78&r2=1.79


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

* LVM2 ./WHATS_NEW lib/activate/dev_manager.c
@ 2004-05-12 20:43 agk
  0 siblings, 0 replies; 39+ messages in thread
From: agk @ 2004-05-12 20:43 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2004-05-12 20:43:34

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

Log message:
	Ensure presence of virtual targets before attempting activation.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.66&r2=1.67


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

end of thread, other threads:[~2012-05-16 12:50 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 18:09 LVM2 ./WHATS_NEW lib/activate/dev_manager.c agk
  -- strict thread matches above, loose matches on Subject: below --
2012-05-16 12:50 agk
2012-04-20 14:17 jbrassow
2012-03-05 14:15 zkabelac
2012-02-01 13:47 zkabelac
2012-01-28 20:12 zkabelac
2012-01-23 20:56 jbrassow
2012-01-20 21:56 snitzer
2011-12-21 12:59 zkabelac
2011-11-18 19:42 zkabelac
2011-10-11  8:59 zkabelac
2011-10-11  8:57 zkabelac
2011-08-11  4:18 jbrassow
2011-07-06  0:29 agk
2011-07-05 23:10 agk
2011-01-05 14:03 zkabelac
2010-12-08 19:26 agk
2010-10-25 10:37 agk
2010-10-24 17:37 snitzer
2010-08-26 14:21 jbrassow
2010-08-17  1:51 agk
2010-08-03 13:13 zkabelac
2010-05-24  9:01 zkabelac
2010-05-21 14:48 zkabelac
2010-02-08 23:28 snitzer
2010-01-26  7:58 mbroz
2010-01-22 15:40 snitzer
2009-05-28  1:11 agk
2009-05-13 14:13 zkabelac
2008-12-19 15:23 mbroz
2008-06-05 12:45 agk
2007-05-14 11:27 mbroz
2007-03-08 19:58 agk
2006-11-20 16:45 agk
2006-07-10 19:17 agk
2005-10-18 12:39 agk
2005-08-04  1:27 agk
2005-08-04  1:15 agk
2004-05-12 20:43 agk

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