public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/daemons/clvmd lvm-functions.c
@ 2007-08-23 12:44 pcaulfield
  0 siblings, 0 replies; 15+ messages in thread
From: pcaulfield @ 2007-08-23 12:44 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2007-08-23 12:44:10

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Force a device scan after init_full_scan_done() per agk.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33

--- LVM2/daemons/clvmd/lvm-functions.c	2007/08/23 12:19:13	1.32
+++ LVM2/daemons/clvmd/lvm-functions.c	2007/08/23 12:44:09	1.33
@@ -42,6 +42,7 @@
 
 /* LVM2 headers */
 #include "toolcontext.h"
+#include "lvmcache.h"
 #include "log.h"
 #include "activate.h"
 #include "locking.h"
@@ -448,6 +449,7 @@
 
 	ret = refresh_toolcontext(cmd);
 	init_full_scan_done(0);
+	lvmcache_label_scan(cmd, 2);
 
 	return ret==1?0:-1;
 }


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2012-03-01 22:55 zkabelac
  0 siblings, 0 replies; 15+ messages in thread
From: zkabelac @ 2012-03-01 22:55 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-01 22:55:21

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Add traceback for failpath

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.132&r2=1.133

--- LVM2/daemons/clvmd/lvm-functions.c	2012/03/01 21:18:38	1.132
+++ LVM2/daemons/clvmd/lvm-functions.c	2012/03/01 22:55:21	1.133
@@ -729,7 +729,7 @@
 	if (dm_asprintf(&lvs_cmd, "%s lvs  --config 'log{command_names=0 prefix=\"\"}' "
 			"--nolocking --noheadings -o vg_uuid,lv_uuid,lv_attr,vg_attr",
 			lvm_binary) < 0)
-		return 0;
+		return_0;
 
 	/* FIXME: Maybe link and use liblvm2cmd directly instead of fork */
 	if (!(lvs = popen(lvs_cmd, "r"))) {


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2012-03-01 21:18 zkabelac
  0 siblings, 0 replies; 15+ messages in thread
From: zkabelac @ 2012-03-01 21:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2012-03-01 21:18:39

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Debug log for hold_lock failure

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.131&r2=1.132

--- LVM2/daemons/clvmd/lvm-functions.c	2012/03/01 09:54:24	1.131
+++ LVM2/daemons/clvmd/lvm-functions.c	2012/03/01 21:18:38	1.132
@@ -767,7 +767,8 @@
 					LCK_EXCL : LCK_READ;
 
 				DEBUGLOG("getting initial lock for %s\n", uuid);
-				hold_lock(uuid, lock_mode, LCKF_NOQUEUE);
+				if (hold_lock(uuid, lock_mode, LCKF_NOQUEUE))
+					DEBUGLOG("Failed to hold lock %s\n", uuid);
 			}
 		}
 	}


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2010-11-29 11:05 zkabelac
  0 siblings, 0 replies; 15+ messages in thread
From: zkabelac @ 2010-11-29 11:05 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2010-11-29 11:05:15

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Remove printing of LCK_CACHE
	
	LCK_CACHE is defined as 0x100 so it cannot be passed through
	unsigned char parameter - remove it from the sprintf code.
	
	If the LCK_CLUSTER should be printed here - lot of code need
	to be reworked - so adding FIXME comment.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.100&r2=1.101

--- LVM2/daemons/clvmd/lvm-functions.c	2010/11/23 01:55:58	1.100
+++ LVM2/daemons/clvmd/lvm-functions.c	2010/11/29 11:05:15	1.101
@@ -44,6 +44,10 @@
 	int lock_mode;
 };
 
+/*
+ * FIXME: 8bit value passed here -
+ *        so only LCK_XXX defines < 0x100 can be decoded
+ */
 static const char *decode_locking_cmd(unsigned char cmdl)
 {
 	static char buf[128];
@@ -109,12 +113,11 @@
 		break;
 	}
 
-	sprintf(buf, "0x%x %s (%s|%s%s%s%s%s%s)", cmdl, command, type, scope,
+	sprintf(buf, "0x%x %s (%s|%s%s%s%s%s)", cmdl, command, type, scope,
 		cmdl & LCK_NONBLOCK   ? "|NONBLOCK" : "",
 		cmdl & LCK_HOLD       ? "|HOLD" : "",
 		cmdl & LCK_LOCAL      ? "|LOCAL" : "",
-		cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "",
-		cmdl & LCK_CACHE      ? "|CACHE" : "");
+		cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "");
 
 	return buf;
 }


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2010-06-30 21:40 mornfall
  0 siblings, 0 replies; 15+ messages in thread
From: mornfall @ 2010-06-30 21:40 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2010-06-30 21:40:27

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Maintain memlock balance in clvmd.
	
	When a mirror is being downconverted in a cluster, a series of suspends and
	resumes is executed.
	
	With the change to using UUIDs in dev_manager instead of names, the behaviour
	has changed with regards to including an _mlog in the deptree of a logical
	volume. In the old (pre-UUID-enabled) code, the _mlog would appear in a deptree
	of any volume purely based on a name match: a linear volume foo would include
	foo_mlog in its dependencies if that happened to exist. This behaviour was
	fixed and the mlog is now only included for mirrors.
	
	By a coincidence, this mlog bug had been hiding a different bug in clvmd. When
	a mirror is being dismantled (and converted to a linear volume), it is first
	suspended as a whole, then later resumed in parts. Nevertheless, the overall
	memlock balance is maintained in this operation. The problem kicks in, because
	even though the mirror log was suspended as part of the mirror, when the
	dismantled mirror is resumed again, it is no longer a mirror and therefore the
	mirror log stays suspended. This would not be a problem in itself, since
	_delete_lv (from metadata/mirror.c) is called on it subsequently, which does an
	activate/deactivate cycle and removes the LV. The activate/deactivate cycle
	correctly prompts clvmd to resume the device: however, in doing this, it will
	issue an unpaired resume operation (the suspend that caused the mirror log to
	be suspended is paired with resuming the dismantled mirror later). We have
	concluded that the path in clvmd should never affect memlock_count, since there
	should never be an unmatched explicit suspend preceding this resume.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.94&r2=1.95

--- LVM2/daemons/clvmd/lvm-functions.c	2010/06/21 15:56:58	1.94
+++ LVM2/daemons/clvmd/lvm-functions.c	2010/06/30 21:40:27	1.95
@@ -354,9 +354,13 @@
 	if (!lv_info_by_lvid(cmd, resource, &lvi, 0, 0))
 		goto error;
 
-	if (lvi.suspended)
-		if (!lv_resume(cmd, resource))
+	if (lvi.suspended) {
+		memlock_inc(cmd);
+		if (!lv_resume(cmd, resource)) {
+			memlock_dec(cmd);
 			goto error;
+		}
+	}
 
 	/* Now activate it */
 	if (!lv_activate(cmd, resource, exclusive))


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2009-12-09 19:30 mbroz
  0 siblings, 0 replies; 15+ messages in thread
From: mbroz @ 2009-12-09 19:30 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Fix missing include.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.77&r2=1.78

--- LVM2/daemons/clvmd/lvm-functions.c	2009/12/09 19:01:28	1.77
+++ LVM2/daemons/clvmd/lvm-functions.c	2009/12/09 19:30:56	1.78
@@ -52,6 +52,7 @@
 #include "locking.h"
 #include "archiver.h"
 #include "defaults.h"
+#include "memlock.h"
 
 static struct cmd_context *cmd = NULL;
 static struct dm_hash_table *lv_hash = NULL;


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2008-06-06 16:37 agk
  0 siblings, 0 replies; 15+ messages in thread
From: agk @ 2008-06-06 16:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-06-06 16:37:52

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	cleaner LCK_LV decoding

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44

--- LVM2/daemons/clvmd/lvm-functions.c	2008/06/05 14:24:28	1.43
+++ LVM2/daemons/clvmd/lvm-functions.c	2008/06/06 16:37:51	1.44
@@ -61,6 +61,8 @@
 	int lock_mode;
 };
 
+#define LCK_MASK (LCK_TYPE_MASK | LCK_SCOPE_MASK)
+
 static const char *decode_locking_cmd(unsigned char cmdl)
 {
 	static char buf[128];
@@ -104,23 +106,20 @@
 		break;
 	}
 
-	switch (cmdl) {
-	case LCK_LV_EXCLUSIVE:  
+	switch (cmdl & LCK_MASK) {
+	case LCK_LV_EXCLUSIVE & LCK_MASK:
 		command = "LCK_LV_EXCLUSIVE";  
 		break;
-	case LCK_LV_SUSPEND:    
+	case LCK_LV_SUSPEND & LCK_MASK:    
 		command = "LCK_LV_SUSPEND";    
 		break;
-	case LCK_LV_UNLOCK:        
-		command = "LCK_LV_UNLOCK";     
-		break;
-	case LCK_LV_RESUME:     
+	case LCK_LV_RESUME & LCK_MASK:     
 		command = "LCK_LV_RESUME";     
 		break;
-	case LCK_LV_ACTIVATE:   
+	case LCK_LV_ACTIVATE & LCK_MASK:   
 		command = "LCK_LV_ACTIVATE";   
 		break;
-	case LCK_LV_DEACTIVATE: 
+	case LCK_LV_DEACTIVATE & LCK_MASK: 
 		command = "LCK_LV_DEACTIVATE"; 
 		break;
 	default:


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2007-11-14 13:37 pcaulfield
  0 siblings, 0 replies; 15+ messages in thread
From: pcaulfield @ 2007-11-14 13:37 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2007-11-14 13:37:51

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Make it compile with new lv_info_by_lvid() prototype

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35

--- LVM2/daemons/clvmd/lvm-functions.c	2007/08/24 08:29:39	1.34
+++ LVM2/daemons/clvmd/lvm-functions.c	2007/11/14 13:37:51	1.35
@@ -223,7 +223,7 @@
 	}
 
 	/* If it's suspended then resume it */
-	if (!lv_info_by_lvid(cmd, resource, &lvi, 0))
+	if (!lv_info_by_lvid(cmd, resource, &lvi, 0, 0))
 		return EIO;
 
 	if (lvi.suspended)
@@ -269,7 +269,7 @@
 	}
 
 	/* Only suspend it if it exists */
-	if (!lv_info_by_lvid(cmd, resource, &lvi, 0))
+	if (!lv_info_by_lvid(cmd, resource, &lvi, 0, 0))
 		return EIO;
 
 	if (lvi.exists) {
@@ -414,7 +414,7 @@
 			struct lvinfo lvi;
 
 			pthread_mutex_lock(&lvm_lock);
-			status = lv_info_by_lvid(cmd, resource, &lvi, 0);
+			status = lv_info_by_lvid(cmd, resource, &lvi, 0, 0);
 			pthread_mutex_unlock(&lvm_lock);
 			if (!status)
 				return EIO;


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2006-10-24 18:49 jbrassow
  0 siblings, 0 replies; 15+ messages in thread
From: jbrassow @ 2006-10-24 18:49 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	jbrassow@sourceware.org	2006-10-24 18:49:31

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	- likely cut and paste error.  Fix wrong function name in debug
	output.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25

--- LVM2/daemons/clvmd/lvm-functions.c	2006/10/06 10:06:37	1.24
+++ LVM2/daemons/clvmd/lvm-functions.c	2006/10/24 18:49:31	1.25
@@ -243,7 +243,7 @@
 	/* Is it open ? */
 	oldmode = get_current_lock(resource);
 	if (oldmode == -1) {
-		DEBUGLOG("do_deactivate_lock, lock not already held\n");
+		DEBUGLOG("do_resume_lv, lock not already held\n");
 		return 0;	/* We don't need to do anything */
 	}
 


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2006-10-06 10:06 pcaulfield
  0 siblings, 0 replies; 15+ messages in thread
From: pcaulfield @ 2006-10-06 10:06 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2006-10-06 10:06:37

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Use strncpy rather than strcpy

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24

--- LVM2/daemons/clvmd/lvm-functions.c	2006/10/05 13:55:50	1.23
+++ LVM2/daemons/clvmd/lvm-functions.c	2006/10/06 10:06:37	1.24
@@ -537,7 +537,8 @@
 	if (level != _LOG_ERR && level != _LOG_FATAL)
 		return;
 
-	strcpy(last_error, message);
+	strncpy(last_error, message, sizeof(last_error));
+	last_error[sizeof(last_error)-1] = '\0';
 }
 
 /* This checks some basic cluster-LVM configuration stuff */


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2006-08-22  9:49 pcaulfield
  0 siblings, 0 replies; 15+ messages in thread
From: pcaulfield @ 2006-08-22  9:49 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2006-08-22 09:49:21

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Add needed new parameter to create_toolcontext().

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21

--- LVM2/daemons/clvmd/lvm-functions.c	2006/05/16 16:48:30	1.20
+++ LVM2/daemons/clvmd/lvm-functions.c	2006/08/22 09:49:20	1.21
@@ -539,7 +539,7 @@
 /* Called to initialise the LVM context of the daemon */
 int init_lvm(int using_gulm)
 {
-	if (!(cmd = create_toolcontext(NULL))) {
+	if (!(cmd = create_toolcontext(NULL, 0))) {
 		log_error("Failed to allocate command context");
 		return 0;
 	}


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2006-05-15 12:32 pcaulfield
  0 siblings, 0 replies; 15+ messages in thread
From: pcaulfield @ 2006-05-15 12:32 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2006-05-15 12:32:08

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Add needed include.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2006-05-15 11:56 agk
  0 siblings, 0 replies; 15+ messages in thread
From: agk @ 2006-05-15 11:56 UTC (permalink / raw)
  To: lvm2-cvs

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

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	fix compile

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2004-09-22 12:10 pcaulfield
  0 siblings, 0 replies; 15+ messages in thread
From: pcaulfield @ 2004-09-22 12:10 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2004-09-22 12:10:35

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Put some locking round the LV hash table as it could be accessed by
	different threads concurrently.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3


^ permalink raw reply	[flat|nested] 15+ messages in thread
* LVM2/daemons/clvmd lvm-functions.c
@ 2004-06-28 10:26 pcaulfield
  0 siblings, 0 replies; 15+ messages in thread
From: pcaulfield @ 2004-06-28 10:26 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2004-06-28 10:26:43

Modified files:
	daemons/clvmd  : lvm-functions.c 

Log message:
	Make sure errors reach syslog().

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2


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

end of thread, other threads:[~2012-03-01 22:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-23 12:44 LVM2/daemons/clvmd lvm-functions.c pcaulfield
  -- strict thread matches above, loose matches on Subject: below --
2012-03-01 22:55 zkabelac
2012-03-01 21:18 zkabelac
2010-11-29 11:05 zkabelac
2010-06-30 21:40 mornfall
2009-12-09 19:30 mbroz
2008-06-06 16:37 agk
2007-11-14 13:37 pcaulfield
2006-10-24 18:49 jbrassow
2006-10-06 10:06 pcaulfield
2006-08-22  9:49 pcaulfield
2006-05-15 12:32 pcaulfield
2006-05-15 11:56 agk
2004-09-22 12:10 pcaulfield
2004-06-28 10:26 pcaulfield

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).