public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2009-04-02 20:46 taka
  0 siblings, 0 replies; 15+ messages in thread
From: taka @ 2009-04-02 20:46 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	taka@sourceware.org	2009-04-02 20:46:11

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Fix error message when archive initialization fails.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1074&r2=1.1075
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.73&r2=1.74

--- LVM2/WHATS_NEW	2009/04/01 07:51:05	1.1074
+++ LVM2/WHATS_NEW	2009/04/02 20:46:11	1.1075
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Fix error message when archive initialization fails.
   Make sure clvmd-corosync releases the lockspace when it exits.
   Fix segfault for vgcfgrestore on VG with missing PVs.
   Block SIGTERM & SIGINT in clvmd subthreads.
--- LVM2/lib/commands/toolcontext.c	2009/02/22 21:14:38	1.73
+++ LVM2/lib/commands/toolcontext.c	2009/04/02 20:46:11	1.74
@@ -955,7 +955,7 @@
 
 	if (!archive_init(cmd, dir, days, min,
 			  cmd->default_settings.archive)) {
-		log_debug("backup_init failed.");
+		log_debug("archive_init failed.");
 		return 0;
 	}
 


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

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

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Fix error path
	
	Do not increase nr_filt in case of NULL ret value, since the error path
	doesn't handle NULL pointers.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2408&r2=1.2409
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.156&r2=1.157

--- LVM2/WHATS_NEW	2012/05/16 13:09:09	1.2408
+++ LVM2/WHATS_NEW	2012/05/23 13:02:36	1.2409
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Fix error paths for regex filter initialization.
   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.
--- LVM2/lib/commands/toolcontext.c	2012/03/23 09:42:36	1.156
+++ LVM2/lib/commands/toolcontext.c	2012/05/23 13:02:37	1.157
@@ -759,17 +759,19 @@
 		log_very_verbose("devices/filter not found in config file: "
 				 "no regex filter installed");
 
-	else if (!(filters[nr_filt++] = regex_filter_create(cn->v))) {
+	else if (!(filters[nr_filt] = regex_filter_create(cn->v))) {
 		log_error("Failed to create regex device filter");
 		goto bad;
-	}
+	} else
+		nr_filt++;
 
 	/* device type filter. Required. */
 	cn = find_config_tree_node(cmd, "devices/types");
-	if (!(filters[nr_filt++] = lvm_type_filter_create(cmd->proc_dir, cn))) {
+	if (!(filters[nr_filt] = lvm_type_filter_create(cmd->proc_dir, cn))) {
 		log_error("Failed to create lvm type filter");
 		goto bad;
 	}
+	nr_filt++;
 
 	/* md component filter. Optional, non-critical. */
 	if (find_config_tree_bool(cmd, "devices/md_component_detection",


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

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-23 09:42:37

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Fix typo in config option check

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2362&r2=1.2363
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.155&r2=1.156

--- LVM2/WHATS_NEW	2012/03/23 09:39:03	1.2362
+++ LVM2/WHATS_NEW	2012/03/23 09:42:36	1.2363
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Fix global/detect_internal_vg_cache_corruption config check.
   Update lcov Makefile target to support all dmeventd plugins.
   Fix initializiation of thin monitoring (2.02.92).
   Support improperly formated device numbers in /proc/devices (2.02.91).
--- LVM2/lib/commands/toolcontext.c	2012/03/12 14:35:57	1.155
+++ LVM2/lib/commands/toolcontext.c	2012/03/23 09:42:36	1.156
@@ -387,7 +387,7 @@
 	init_pv_min_size((uint64_t)pv_min_kb * (1024 >> SECTOR_SHIFT));
 
 	init_detect_internal_vg_cache_corruption
-		(find_config_tree_int(cmd, "global/detect_internal_vg_cache_corruption()",
+		(find_config_tree_int(cmd, "global/detect_internal_vg_cache_corruption",
 				      DEFAULT_DETECT_INTERNAL_VG_CACHE_CORRUPTION));
 
 	lvmetad_set_active(find_config_tree_int(cmd, "global/use_lvmetad", 0));


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

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-02-27 10:05:36

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Test result of _init_tags.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2312&r2=1.2313
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.151&r2=1.152

--- LVM2/WHATS_NEW	2012/02/27 10:00:23	1.2312
+++ LVM2/WHATS_NEW	2012/02/27 10:05:35	1.2313
@@ -1,5 +1,6 @@
 Version 2.02.94 - 
 ====================================                       
+  Check for errors in _init_tags() during config loading.
   Always check result of _set_vg_name() in lvcreate.
   Drop unused call to uname() during clvmd initialization.
   Test allocation result in sysfs filter creation.
--- LVM2/lib/commands/toolcontext.c	2012/02/23 13:11:09	1.151
+++ LVM2/lib/commands/toolcontext.c	2012/02/27 10:05:35	1.152
@@ -532,9 +532,10 @@
 	dm_list_add(&cmd->config_files, &cfl->list);
 
       out:
-	if (*tag)
-		_init_tags(cmd, cfl->cft);
-	else
+	if (*tag) {
+		if (!_init_tags(cmd, cfl->cft))
+			return_0;
+	} else
 		/* Use temporary copy of lvm.conf while loading other files */
 		cmd->cft = cfl->cft;
 


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

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

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Release allocated resources in error path
	
	If composite_filter_create() fails, release filters.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2258&r2=1.2259
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.148&r2=1.149

--- LVM2/WHATS_NEW	2012/02/08 10:43:42	1.2258
+++ LVM2/WHATS_NEW	2012/02/08 10:46:24	1.2259
@@ -1,5 +1,6 @@
 Version 2.02.91 -
 ===================================
+  Release allocated resources in error path for composite_filter_create().
   Do not use lstat() results when failed in _rm_link().
   Remove a "waiting for another thread" log message from dmeventd plugins.
 
--- LVM2/lib/commands/toolcontext.c	2012/02/01 13:42:19	1.148
+++ LVM2/lib/commands/toolcontext.c	2012/02/08 10:46:24	1.149
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
  *
@@ -728,6 +728,7 @@
 	unsigned nr_filt = 0;
 	const struct dm_config_node *cn;
 	struct dev_filter *filters[MAX_FILTERS];
+	struct dev_filter *composite;
 
 	memset(filters, 0, sizeof(filters));
 
@@ -781,8 +782,16 @@
 	}
 
 	/* Only build a composite filter if we really need it. */
-	return (nr_filt == 1) ?
-	    filters[0] : composite_filter_create(nr_filt, filters);
+	if (nr_filt == 1)
+		return filters[0];
+
+	if (!(composite = composite_filter_create(nr_filt, filters))) {
+		stack;
+		nr_filt++; /* compensate skip NULL */
+		goto err;
+	}
+
+	return composite;
 err:
 	nr_filt--; /* skip NULL */
 	while (nr_filt-- > 0)


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2011-07-08 16:49 agk
  0 siblings, 0 replies; 15+ messages in thread
From: agk @ 2011-07-08 16:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-07-08 16:49:04

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Ignore activation/verify_udev_operations if dm kernel driver vsn < 4.18.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2039&r2=1.2040
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.124&r2=1.125

--- LVM2/WHATS_NEW	2011/07/08 15:53:59	1.2039
+++ LVM2/WHATS_NEW	2011/07/08 16:49:04	1.2040
@@ -15,6 +15,7 @@
   Fix to preserve exclusive activation of mirror while up-converting.
   Reject allocation if number of extents is not divisible by area count.
   Fix issue preventing cluster mirror creation.
+  Ignore activation/verify_udev_operations if dm kernel driver vsn < 4.18.
   Add activation/verify_udev_operations to lvm.conf, disabled by default.
   Call vg_mark_partial_lvs() before VG structure is returned from the cache.
   Remove unused internal flag ACTIVATE_EXCL from the code.
--- LVM2/lib/commands/toolcontext.c	2011/07/01 14:09:19	1.124
+++ LVM2/lib/commands/toolcontext.c	2011/07/08 16:49:04	1.125
@@ -200,6 +200,21 @@
 	reset_lvm_errno(1);
 }
 
+/*
+ * Until the DM_UEVENT_GENERATED_FLAG was introduced in kernel patch 
+ * 856a6f1dbd8940e72755af145ebcd806408ecedd
+ * some operations could not be performed by udev, requiring our fallback code.
+ */
+static int _dm_driver_has_stable_udev_support()
+{
+	char vsn[80];
+	unsigned maj, min, patchlevel;
+
+	return driver_version(vsn, sizeof(vsn)) &&
+	       (sscanf(vsn, "%u.%u.%u", &maj, &min, &patchlevel) == 3) &&
+	       (maj == 4 ? min >= 18 : maj > 4);
+}
+
 static int _process_config(struct cmd_context *cmd)
 {
 	mode_t old_umask;
@@ -299,6 +314,13 @@
 		find_config_tree_int(cmd, "activation/verify_udev_operations",
 				     DEFAULT_VERIFY_UDEV_OPERATIONS) : 1;
 
+	/* Do not rely fully on udev if the udev support is known to be incomplete. */
+	if (!cmd->default_settings.udev_fallback && !_dm_driver_has_stable_udev_support()) {
+		log_very_verbose("Kernel driver has incomplete udev support so "
+				 "LVM will check and perform some operations itself.");
+		cmd->default_settings.udev_fallback = 1;
+	}
+
 #else
 	/* We must use old node/symlink creation code if not compiled with udev support at all! */
 	cmd->default_settings.udev_fallback = 1;


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2011-06-28  0:23 agk
  0 siblings, 0 replies; 15+ messages in thread
From: agk @ 2011-06-28  0:23 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Remove enforcement of udev verification when using non-standard /dev location.
	If you change the dev dir, it's your responsibility to adjust udev rules
	or tell lvm not to use udev too.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2027&r2=1.2028
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.122&r2=1.123

--- LVM2/WHATS_NEW	2011/06/27 21:43:58	1.2027
+++ LVM2/WHATS_NEW	2011/06/28 00:23:06	1.2028
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Remove enforcement of udev verification when using non-standard /dev location.
   Fix to preserve exclusive activation of mirror while up-converting.
   Reject allocation if number of extents is not divisible by area count.
   Fix issue preventing cluster mirror creation.
--- LVM2/lib/commands/toolcontext.c	2011/06/27 23:43:04	1.122
+++ LVM2/lib/commands/toolcontext.c	2011/06/28 00:23:06	1.123
@@ -200,51 +200,6 @@
 	reset_lvm_errno(1);
 }
 
-/*
- * Prevent people disabling udev fallback if using a non-standard dev dir.
- * FIXME: Remove this function.  lvm.conf provides sufficient control.
- */
-static int _enforce_udev_fallback(struct cmd_context *cmd)
-{
-#ifdef UDEV_SYNC_SUPPORT
-	const char *udev_dev_dir;
-	size_t udev_dev_dir_len;
-	unsigned dirs_match;
-
-	if (!(udev_dev_dir = udev_get_dev_dir()) ||
-	    !*udev_dev_dir) {
-		log_error("Could not get udev dev path.");
-		return 0;
-	}
-	udev_dev_dir_len = strlen(udev_dev_dir);
-
-	/* There's always a slash at the end of dev_dir. But check udev_dev_dir! */
-	if (udev_dev_dir[udev_dev_dir_len - 1] != '/')
-		dirs_match = (udev_dev_dir_len + 1 == strlen(cmd->dev_dir)) &&
-			    !strncmp(cmd->dev_dir, udev_dev_dir, udev_dev_dir_len);
-	else
-		dirs_match = !strcmp(cmd->dev_dir, udev_dev_dir);
-
-	if (!dirs_match) {
-		log_debug("The path %s used for creating device nodes and "
-			  "symlinks that is set in the configuration differs "
-			  "from the path %s that is used by udev. All warnings "
-			  "about udev not working correctly while processing "
-			  "particular nodes and symlinks will be suppressed. "
-			  "These nodes and symlinks will be managed in each "
-			  "directory separately.",
-			   cmd->dev_dir, udev_dev_dir);
-		dm_udev_set_checking(0);
-		init_udev_checking(0);
-
-		/* Device directories differ - we must use the fallback code! */
-		cmd->default_settings.udev_fallback = 1;
-	}
-
-#endif
-	return 1;
-}
-
 static int _process_config(struct cmd_context *cmd)
 {
 	mode_t old_umask;
@@ -337,11 +292,9 @@
 	 * in runtime and still have only udev to create the nodes and symlinks
 	 * without any fallback.
 	 */
-	if ((cmd->default_settings.udev_fallback = cmd->default_settings.udev_rules ?
+	cmd->default_settings.udev_fallback = cmd->default_settings.udev_rules ?
 		find_config_tree_int(cmd, "activation/verify_udev_operations",
-				     DEFAULT_VERIFY_UDEV_OPERATIONS) : 1) &&
-	    !_enforce_udev_fallback(cmd))
-		return_0;
+				     DEFAULT_VERIFY_UDEV_OPERATIONS) : 1;
 
 #else
 	/* We must use old node/symlink creation code if not compiled with udev support at all! */


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2010-11-24  9:34 zkabelac
  0 siblings, 0 replies; 15+ messages in thread
From: zkabelac @ 2010-11-24  9:34 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-11-24 09:34:35

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Fix resource leak of dlopened pointer
	
	Add missing dlclose in _init_formats() error path.
	Use return_0 to print stack trace from the call.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1806&r2=1.1807
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109

--- LVM2/WHATS_NEW	2010/11/23 21:19:45	1.1806
+++ LVM2/WHATS_NEW	2010/11/24 09:34:34	1.1807
@@ -1,5 +1,6 @@
 Version 2.02.78 - 
 ====================================
+  Fix missing dlclose in _init_formats() error path from init_format call.
   Fix missing fclose for _umount() in dmeventd snapshot plugin.
   Fix out-of-scope variable usage in process_each_lv().
   Fix dm_task_destroy(NULL) call in _node_clear_table() error path.
--- LVM2/lib/commands/toolcontext.c	2010/11/11 17:29:05	1.108
+++ LVM2/lib/commands/toolcontext.c	2010/11/24 09:34:35	1.109
@@ -814,8 +814,11 @@
 				return 0;
 			}
 
-			if (!(fmt = init_format_fn(cmd)))
-				return 0;
+			if (!(fmt = init_format_fn(cmd))) {
+				dlclose(lib);
+				return_0;
+			}
+
 			fmt->library = lib;
 			dm_list_add(&cmd->formats, &fmt->list);
 		}


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2010-04-30 12:37 zkabelac
  0 siblings, 0 replies; 15+ messages in thread
From: zkabelac @ 2010-04-30 12:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-04-30 12:37:05

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Release pools for regex if there is error during processing
	(fixes error messages about unreleased pools).

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1543&r2=1.1544
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.94&r2=1.95

--- LVM2/WHATS_NEW	2010/04/30 12:31:32	1.1543
+++ LVM2/WHATS_NEW	2010/04/30 12:37:04	1.1544
@@ -1,5 +1,6 @@
 Version 2.02.64 -
 =================================
+  Fix memory leak for invalid regex pattern input.
   Display invalid regex pattern for filter configuration in case of error.
   Remove no-longer-used arg_ptr_value.
   Fix -M and --type to use strings not pointers that change on config refresh.
--- LVM2/lib/commands/toolcontext.c	2010/04/29 01:38:14	1.94
+++ LVM2/lib/commands/toolcontext.c	2010/04/30 12:37:05	1.95
@@ -639,14 +639,14 @@
 
 	else if (!(filters[nr_filt++] = regex_filter_create(cn->v))) {
 		log_error("Failed to create regex device filter");
-		return NULL;
+		goto err;
 	}
 
 	/* device type filter. Required. */
 	cn = find_config_tree_node(cmd, "devices/types");
 	if (!(filters[nr_filt++] = lvm_type_filter_create(cmd->proc_dir, cn))) {
 		log_error("Failed to create lvm type filter");
-		return NULL;
+		goto err;
 	}
 
 	/* md component filter. Optional, non-critical. */
@@ -660,6 +660,11 @@
 	/* Only build a composite filter if we really need it. */
 	return (nr_filt == 1) ?
 	    filters[0] : composite_filter_create(nr_filt, filters);
+err:
+	nr_filt--; /* skip NULL */
+	while (nr_filt-- > 0)
+		 filters[nr_filt]->destroy(filters[nr_filt]);
+	return NULL;
 }
 
 static int _init_filters(struct cmd_context *cmd, unsigned load_persistent_cache)


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2009-07-21 20:00 mpatocka
  0 siblings, 0 replies; 15+ messages in thread
From: mpatocka @ 2009-07-21 20:00 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mpatocka@sourceware.org	2009-07-21 20:00:04

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Pass struct cmd_context as a first argument to init_multiple_segtypes.
	
	Remove redundant assignment seglib.cmd = cmd (done already at the beginning
	of the function).
	
	Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1194&r2=1.1195
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83

--- LVM2/WHATS_NEW	2009/07/21 11:10:49	1.1194
+++ LVM2/WHATS_NEW	2009/07/21 20:00:02	1.1195
@@ -1,5 +1,6 @@
 Version 2.02.50 - 
 ================================
+  Pass a pointer to struct cmd_context to init_multiple_segtypes
   Return EINVALID_CMD_LINE not success when invalid VG name format is used.
   Remove unnecessary messages after vgcreate/vgsplit refactor (2.02.49).
   Add log_errno to set a specific errno and replace log_error in due course.
--- LVM2/lib/commands/toolcontext.c	2009/07/16 00:36:59	1.82
+++ LVM2/lib/commands/toolcontext.c	2009/07/21 20:00:04	1.83
@@ -835,7 +835,8 @@
 	return 1;
 }
 
-static int _init_single_segtype(struct segtype_library *seglib)
+static int _init_single_segtype(struct cmd_context *cmd,
+				struct segtype_library *seglib)
 {
 	struct segment_type *(*init_segtype_fn) (struct cmd_context *);
 	struct segment_type *segtype;
@@ -901,9 +902,8 @@
 	    (cn = find_config_tree_node(cmd, "global/segment_libraries"))) {
 
 		struct config_value *cv;
-		int (*init_multiple_segtypes_fn) (struct segtype_library *);
-
-		seglib.cmd = cmd;
+		int (*init_multiple_segtypes_fn) (struct cmd_context *,
+						  struct segtype_library *);
 
 		for (cv = cn->v; cv; cv = cv->next) {
 			if (cv->type != CFG_STRING) {
@@ -928,7 +928,7 @@
 				init_multiple_segtypes_fn =
 				    _init_single_segtype;
  
-			if (!init_multiple_segtypes_fn(&seglib)) {
+			if (!init_multiple_segtypes_fn(cmd, &seglib)) {
 				struct dm_list *sgtl, *tmp;
 				log_error("init_multiple_segtypes() failed: "
 					  "Unloading shared library %s",


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2009-07-14 12:17 mbroz
  0 siblings, 0 replies; 15+ messages in thread
From: mbroz @ 2009-07-14 12:17 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-07-14 12:17:15

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Enable use of new multi-segment registration for static registration too.
	
	so it allows this use:
	
	#ifdef MYNEWSEG_INTERNAL
	if (!init_mynewseg_segtypes(&seglib))
	return 0;
	#endif

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1182&r2=1.1183
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.78&r2=1.79

--- LVM2/WHATS_NEW	2009/07/14 11:01:26	1.1182
+++ LVM2/WHATS_NEW	2009/07/14 12:17:14	1.1183
@@ -1,5 +1,6 @@
 Version 2.02.49 - 
 ================================
+  Enable use of new multi-segment registration for static registration too.
   Exclude VG_GLOBAL from vg_write_lock_held so scans open devs read-only again.
   Add unit test case for liblvm VG create/delete APIs.
   Add liblvm APIs to implement creation and deletion of VGs.
--- LVM2/lib/commands/toolcontext.c	2009/07/08 18:12:08	1.78
+++ LVM2/lib/commands/toolcontext.c	2009/07/14 12:17:15	1.79
@@ -855,10 +855,10 @@
 static int _init_segtypes(struct cmd_context *cmd)
 {
 	struct segment_type *segtype;
+	struct segtype_library seglib = { .cmd = cmd };
 
 #ifdef HAVE_LIBDL
 	const struct config_node *cn;
-	struct segtype_library seglib;
 #endif
 
 	if (!(segtype = init_striped_segtype(cmd)))


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2009-06-15 11:56 mbroz
  0 siblings, 0 replies; 15+ messages in thread
From: mbroz @ 2009-06-15 11:56 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-06-15 11:56:37

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Fix memory leaks in toolcontext error path.
	
	E.g.
	# vgscan
	Parse error at byte 2360 (line 54): expected a value
	Failed to load config file /etc/lvm/lvm.conf
	You have a memory leak (not released memory pool):
	[0x818c788] library (12 bytes)
	
	...

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1147&r2=1.1148
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.74&r2=1.75

--- LVM2/WHATS_NEW	2009/06/12 08:34:15	1.1147
+++ LVM2/WHATS_NEW	2009/06/15 11:56:31	1.1148
@@ -1,5 +1,6 @@
 Version 2.02.48 - 
 ===============================
+  Fix memory leaks in toolcontext error path.
   Re-instate partial activation support in clustered mode. (2.02.40)
   Allow metadata correction even when PVs are missing.
   Use 'lvm lvresize' instead of 'lvresize' in fsadm.
--- LVM2/lib/commands/toolcontext.c	2009/04/02 20:46:11	1.74
+++ LVM2/lib/commands/toolcontext.c	2009/06/15 11:56:36	1.75
@@ -516,15 +516,15 @@
 {
 	struct config_tree_list *cfl;
 
+	dm_list_iterate_items(cfl, &cmd->config_files) {
+		destroy_config_tree(cfl->cft);
+	}
+
 	if (cmd->cft && cmd->cft->root) {
 		destroy_config_tree(cmd->cft);
 		cmd->cft = NULL;
 	}
 
-	dm_list_iterate_items(cfl, &cmd->config_files) {
-		destroy_config_tree(cfl->cft);
-	}
-
 	dm_list_init(&cmd->config_files);
 }
 
@@ -1110,6 +1110,14 @@
 	return cmd;
 
       error:
+	_destroy_tag_configs(cmd);
+	dev_cache_exit();
+	if (cmd->filter)
+		cmd->filter->destroy(cmd->filter);
+	if (cmd->mem)
+		dm_pool_destroy(cmd->mem);
+	if (cmd->libmem)
+		dm_pool_destroy(cmd->libmem);
 	dm_free(cmd);
 	return NULL;
 }


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2007-02-08 17:31 agk
  0 siblings, 0 replies; 15+ messages in thread
From: agk @ 2007-02-08 17:31 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-02-08 17:31:03

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Fix loading of segment_libraries. [gentoo]

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.570&r2=1.571
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48

--- LVM2/WHATS_NEW	2007/02/07 13:29:51	1.570
+++ LVM2/WHATS_NEW	2007/02/08 17:31:02	1.571
@@ -1,5 +1,6 @@
 Version 2.02.22 - 
 ===================================
+  Fix loading of segment_libraries.
   If a PV reappears after it was removed from its VG, make it an orphan.
   Don't update metadata automatically if VGIDs don't match.
   Fix some vgreduce --removemissing command line validation.
--- LVM2/lib/commands/toolcontext.c	2007/01/25 21:22:30	1.47
+++ LVM2/lib/commands/toolcontext.c	2007/02/08 17:31:02	1.48
@@ -754,7 +754,6 @@
 		struct config_value *cv;
 		struct segment_type *(*init_segtype_fn) (struct cmd_context *);
 		void *lib;
-		struct list *sgtl, *tmp;
 		struct segment_type *segtype2;
 
 		for (cv = cn->v; cv; cv = cv->next) {
@@ -781,18 +780,16 @@
 			segtype->library = lib;
 			list_add(&cmd->segtypes, &segtype->list);
 
-			list_iterate_safe(sgtl, tmp, &cmd->segtypes) {
-				segtype2 = list_item(sgtl, struct segment_type);
-				if (!strcmp(segtype2->name, segtype->name)) {
-					log_error("Duplicate segment type %s: "
-						  "unloading shared library %s",
-						  segtype->name, cv->v.str);
-					list_del(&segtype->list);
-					segtype->ops->destroy(segtype);
-					dlclose(lib);
-					break;
-				}
-
+			list_iterate_items(segtype2, &cmd->segtypes) {
+				if ((segtype == segtype2) ||
+				     strcmp(segtype2->name, segtype->name))
+					continue;
+				log_error("Duplicate segment type %s: "
+					  "unloading shared library %s",
+					  segtype->name, cv->v.str);
+				list_del(&segtype->list);
+				segtype->ops->destroy(segtype);
+				dlclose(lib);
 			}
 		}
 	}


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

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2007-01-23 16:03:54

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	Long-lived processes write out persistent dev cache in refresh_toolcontext().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.552&r2=1.553
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45

--- LVM2/WHATS_NEW	2007/01/23 15:58:05	1.552
+++ LVM2/WHATS_NEW	2007/01/23 16:03:53	1.553
@@ -1,5 +1,6 @@
 Version 2.02.20 -
 ===================================
+  Long-lived processes write out persistent dev cache in refresh_toolcontext().
   Fix refresh_toolcontext() always to wipe persistent device filter cache.
   Add is_long_lived to toolcontext.
   Add --clustered to man pages.
--- LVM2/lib/commands/toolcontext.c	2007/01/23 15:58:05	1.44
+++ LVM2/lib/commands/toolcontext.c	2007/01/23 16:03:54	1.45
@@ -1080,6 +1080,13 @@
 	if (!_init_segtypes(cmd))
 		return 0;
 
+	/*
+	 * If we are a long-lived process, write out the updated persistent
+	 * device cache for the benefit of short-lived processes.
+	 */
+	if (cmd->is_long_lived && cmd->dump_filter)
+		persistent_filter_dump(cmd->filter);
+
 	cmd->config_valid = 1;
 	return 1;
 }


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2 ./WHATS_NEW lib/commands/toolcontext.c
@ 2005-01-27 15:50 agk
  0 siblings, 0 replies; 15+ messages in thread
From: agk @ 2005-01-27 15:50 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-01-27 15:50:34

Modified files:
	.              : WHATS_NEW 
	lib/commands   : toolcontext.c 

Log message:
	More informative startup mesg if can't create /etc/lvm.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.171&r2=1.172
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29


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

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

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-02 20:46 LVM2 ./WHATS_NEW lib/commands/toolcontext.c taka
  -- strict thread matches above, loose matches on Subject: below --
2012-05-23 13:02 zkabelac
2012-03-23  9:42 zkabelac
2012-02-27 10:05 zkabelac
2012-02-08 10:46 zkabelac
2011-07-08 16:49 agk
2011-06-28  0:23 agk
2010-11-24  9:34 zkabelac
2010-04-30 12:37 zkabelac
2009-07-21 20:00 mpatocka
2009-07-14 12:17 mbroz
2009-06-15 11:56 mbroz
2007-02-08 17:31 agk
2007-01-23 16:03 agk
2005-01-27 15:50 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).