public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/daemons/clvmd clvmd-singlenode.c
@ 2011-03-24 10:45 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-03-24 10:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-03-24 10:45:01

Modified files:
	daemons/clvmd  : clvmd-singlenode.c 

Log message:
	Release allocated memory on closedown
	
	Release allocated buffers before exit() in debug singlenode - so it's not
	poping out in valgrind as memory leak.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-singlenode.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10

--- LVM2/daemons/clvmd/clvmd-singlenode.c	2010/12/13 10:43:56	1.9
+++ LVM2/daemons/clvmd/clvmd-singlenode.c	2011/03/24 10:45:00	1.10
@@ -28,6 +28,8 @@
 
 static const char SINGLENODE_CLVMD_SOCKNAME[] = DEFAULT_RUN_DIR "/clvmd_singlenode.sock";
 static int listen_fd = -1;
+static int *_locks = NULL;
+static char **_resources = NULL;
 
 static void close_comms(void)
 {
@@ -97,6 +99,10 @@
 
 	DEBUGLOG("cluster_closedown\n");
 	destroy_lvhash();
+	dm_free(_locks);
+	dm_free(_resources);
+	_locks = NULL;
+	_resources = NULL;
 }
 
 static void _get_our_csid(char *csid)
@@ -136,8 +142,6 @@
 
 int _lock_file(const char *file, uint32_t flags);
 
-static int *_locks = NULL;
-static char **_resources = NULL;
 static int _lock_max = 1;
 static pthread_mutex_t _lock_mutex = PTHREAD_MUTEX_INITIALIZER;
 


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

* LVM2/daemons/clvmd clvmd-singlenode.c
@ 2011-11-07 17:11 mornfall
  0 siblings, 0 replies; 3+ messages in thread
From: mornfall @ 2011-11-07 17:11 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mornfall@sourceware.org	2011-11-07 17:11:23

Modified files:
	daemons/clvmd  : clvmd-singlenode.c 

Log message:
	Correctly handle concurrent read (CR) locks in singlenode clvmd. This means
	that we can also test clustered volume groups (vgcreate -c y) in the test
	suite. Unfortunately we can't make this the testing default since cluster
	mirrors require further infrastructure, and snapshots probably don't work at
	all. I'll eventually add a few test cases that create clustered VGs
	specifically.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-singlenode.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15

--- LVM2/daemons/clvmd/clvmd-singlenode.c	2011/10/11 09:05:20	1.14
+++ LVM2/daemons/clvmd/clvmd-singlenode.c	2011/11/07 17:11:23	1.15
@@ -157,6 +157,13 @@
 	char **_resources_1;
 	int i, j;
 
+	if (mode == LCK_READ) { /* only track PREAD, aka PROTECTED READ */
+		DEBUGLOG("Not tracking CONCURRENT READ lock: %s, flags=%d, mode=%d\n",
+			 resource, flags, mode);
+		*lockid = -1;
+		return 0;
+	}
+
 	DEBUGLOG("Locking resource %s, flags=%d, mode=%d\n",
 		 resource, flags, mode);
 
@@ -224,6 +231,12 @@
 
 static int _unlock_resource(const char *resource, int lockid)
 {
+	if (lockid < 0) {
+		DEBUGLOG("Not tracking unlock of lockid -1: %s, lockid=%d\n",
+			 resource, lockid);
+		return 0;
+	}
+
 	DEBUGLOG("Unlocking resource %s, lockid=%d\n", resource, lockid);
 	pthread_mutex_lock(&_lock_mutex);
 


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

* LVM2/daemons/clvmd clvmd-singlenode.c
@ 2011-09-29  8:57 zkabelac
  0 siblings, 0 replies; 3+ messages in thread
From: zkabelac @ 2011-09-29  8:57 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-09-29 08:57:22

Modified files:
	daemons/clvmd  : clvmd-singlenode.c 

Log message:
	Typo in debug message

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-singlenode.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13

--- LVM2/daemons/clvmd/clvmd-singlenode.c	2011/09/25 19:37:00	1.12
+++ LVM2/daemons/clvmd/clvmd-singlenode.c	2011/09/29 08:57:21	1.13
@@ -56,7 +56,7 @@
 	}
 	/* Set Close-on-exec */
 	if (fcntl(listen_fd, F_SETFD, 1)) {
-		DEBUGLOG("Setting CLOEXEC on client fd faile: %s\n", strerror(errno));
+		DEBUGLOG("Setting CLOEXEC on client fd failed: %s\n", strerror(errno));
 		goto error;
 	}
 


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

end of thread, other threads:[~2011-11-07 17:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24 10:45 LVM2/daemons/clvmd clvmd-singlenode.c zkabelac
2011-09-29  8:57 zkabelac
2011-11-07 17:11 mornfall

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