public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-06-01 21:16 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2011-06-01 21:16 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2011-06-01 21:16:56

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c lvm-functions.c 
	lib/locking    : cluster_locking.c locking.h 

Log message:
	Propagate test mode to clvmd to skip activation and changes to held locks.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2004&r2=1.2005
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.116&r2=1.117
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.65&r2=1.66

--- LVM2/WHATS_NEW	2011/06/01 19:29:31	1.2004
+++ LVM2/WHATS_NEW	2011/06/01 21:16:55	1.2005
@@ -1,5 +1,6 @@
 Version 2.02.86 -  
 =================================
+  Propagate test mode to clvmd to skip activation and changes to held locks.
   Defer writing PV labels to vg_write.
   Store label_sector only in struct physical_volume.
   Permit --available with lvcreate so non-snapshot LVs need not be activated.
--- LVM2/daemons/clvmd/clvmd-command.c	2011/04/08 14:40:18	1.54
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/06/01 21:16:56	1.55
@@ -80,6 +80,9 @@
 	unsigned char lock_cmd;
 	unsigned char lock_flags;
 
+	/* Reset test mode before we start */
+	init_test(0);
+
 	/* Do the command */
 	switch (msg->cmd) {
 		/* Just a test message */
@@ -109,6 +112,8 @@
 		lockname = &args[2];
 		/* Check to see if the VG is in use by LVM1 */
 		status = do_check_lvm1(lockname);
+		if (lock_flags & LCK_TEST_MODE)
+			init_test(1);
 		do_lock_vg(lock_cmd, lock_flags, lockname);
 		break;
 
@@ -117,6 +122,8 @@
 		lock_cmd = args[0] & (LCK_NONBLOCK | LCK_HOLD | LCK_SCOPE_MASK | LCK_TYPE_MASK);
 		lock_flags = args[1];
 		lockname = &args[2];
+		if (lock_flags & LCK_TEST_MODE)
+			init_test(1);
 		status = do_lock_lv(lock_cmd, lock_flags, lockname);
 		/* Replace EIO with something less scary */
 		if (status == EIO) {
@@ -251,6 +258,7 @@
 	int status = 0;
 	char *lockname;
 
+	init_test(0);
 	switch (header->cmd) {
 	case CLVMD_CMD_TEST:
 		status = sync_lock("CLVMD_TEST", LCK_EXCL, 0, &lockid);
@@ -269,6 +277,8 @@
 		lock_cmd = args[0];
 		lock_flags = args[1];
 		lockname = &args[2];
+		if (lock_flags & LCK_TEST_MODE)
+			init_test(1);
 		status = pre_lock_lv(lock_cmd, lock_flags, lockname);
 		break;
 
@@ -300,6 +310,7 @@
 	char *args = header->node + strlen(header->node) + 1;
 	char *lockname;
 
+	init_test(0);
 	switch (header->cmd) {
 	case CLVMD_CMD_TEST:
 		status =
@@ -311,6 +322,8 @@
 		lock_cmd = args[0];
 		lock_flags = args[1];
 		lockname = &args[2];
+		if (lock_flags & LCK_TEST_MODE)
+			init_test(1);
 		status = post_lock_lv(lock_cmd, lock_flags, lockname);
 		break;
 
--- LVM2/daemons/clvmd/lvm-functions.c	2011/05/07 13:50:13	1.116
+++ LVM2/daemons/clvmd/lvm-functions.c	2011/06/01 21:16:56	1.117
@@ -137,6 +137,7 @@
 		flags & LCK_MIRROR_NOSYNC_MODE	  ? "MIRROR_NOSYNC|" : "",
 		flags & LCK_DMEVENTD_MONITOR_MODE ? "DMEVENTD_MONITOR|" : "",
 		flags & LCK_ORIGIN_ONLY_MODE ? "ORIGIN_ONLY|" : "",
+		flags & LCK_TEST_MODE ? "TEST|" : "",
 		flags & LCK_CONVERT ? "CONVERT|" : "");
 
 	if (len > 1)
@@ -235,6 +236,9 @@
 	int saved_errno;
 	struct lv_info *lvi;
 
+	if (test_mode())
+		return 0;
+
 	/* Mask off invalid options */
 	flags &= LCKF_NOQUEUE | LCKF_CONVERT;
 
@@ -298,6 +302,9 @@
 	int status;
 	int saved_errno;
 
+	if (test_mode())
+		return 0;
+
 	if (!(lvi = lookup_info(resource))) {
 		DEBUGLOG("hold_unlock, lock not already held\n");
 		return 0;
--- LVM2/lib/locking/cluster_locking.c	2011/04/08 14:40:19	1.55
+++ LVM2/lib/locking/cluster_locking.c	2011/06/01 21:16:56	1.56
@@ -329,6 +329,9 @@
 	if (mirror_in_sync())
 		args[1] |= LCK_MIRROR_NOSYNC_MODE;
 
+	if (test_mode())
+		args[1] |= LCK_TEST_MODE;
+
 	/*
 	 * Must handle tri-state return from dmeventd_monitor_mode.
 	 * But DMEVENTD_MONITOR_IGNORE is not propagated across the cluster.
--- LVM2/lib/locking/locking.h	2011/04/29 00:21:14	1.65
+++ LVM2/lib/locking/locking.h	2011/06/01 21:16:56	1.66
@@ -106,6 +106,7 @@
 #define LCK_DMEVENTD_MONITOR_MODE	0x04	/* Register with dmeventd */
 #define LCK_CONVERT			0x08	/* Convert existing lock */
 #define LCK_ORIGIN_ONLY_MODE		0x20	/* Same as above */
+#define LCK_TEST_MODE			0x10    /* Test mode: No activation */
 
 /*
  * Special cases of VG locks.


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-09-26  7:51 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-09-26  7:51 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-09-26 07:51:25

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	test           : t-clvmd-restart.sh 

Log message:
	Use execvp for clvmd restart
	
	Since execve passed only NULL as environ, we had lost all environment vars on
	restart - thus actually running  'different' clvmd then the one at start.
	
	Preserving environ allows to restart clvmd with the same settings
	(i.e. LD_LIBRARY_PATH)
	
	Add test for second restart.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2139&r2=1.2140
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.60&r2=1.61
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-clvmd-restart.sh.diff?cvsroot=lvm2&r1=1.1&r2=1.2

--- LVM2/WHATS_NEW	2011/09/25 19:37:00	1.2139
+++ LVM2/WHATS_NEW	2011/09/26 07:51:23	1.2140
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Use execvp for CLVMD restart to preserve environment settings.
   Restart CLVMD with same cluster manager.
   Fix log_error() usage in raid and unknown segtype initialisation.
   Improve testing Makefile.
--- LVM2/daemons/clvmd/clvmd-command.c	2011/09/25 19:37:00	1.60
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/09/26 07:51:24	1.61
@@ -418,7 +418,7 @@
 	for (argc = 1; argv[argc]; argc++) DEBUGLOG("--- %d: %s\n", argc, argv[argc]);
 
 	/* NOTE: This will fail when downgrading! */
-	execve(clvmd, (char **)argv, NULL);
+	execvp(clvmd, (char **)argv);
 out:
 	/* We failed */
 	DEBUGLOG("Restart of clvmd failed.\n");
--- LVM2/test/t-clvmd-restart.sh	2011/09/25 19:37:00	1.1
+++ LVM2/test/t-clvmd-restart.sh	2011/09/26 07:51:24	1.2
@@ -9,13 +9,15 @@
 # along with this program; if not, write to the Free Software Foundation,
 # Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
-export LVM_CLVMD_BINARY="lib/clvmd"
-export LVM_BINARY="lib/lvm"
+# set before test's clvmd is started, so it's passed in environ
+export LVM_CLVMD_BINARY=clvmd
+export LVM_BINARY=lvm
 
 . lib/test
 
 # only clvmd based test, skip otherwise
 test -e LOCAL_CLVMD || skip
+read LOCAL_CLVMD < LOCAL_CLVMD
 
 aux prepare_devs 1
 
@@ -30,15 +32,22 @@
 
 "$LVM_CLVMD_BINARY" -S
 sleep .2
-# restarted clvmd has the same PID (no fork, only execve)
+# restarted clvmd has the same PID (no fork, only execvp)
+NEW_LOCAL_CLVMD=$(pgrep clvmd)
+test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
+
+# try restart once more
+
+"$LVM_CLVMD_BINARY" -S
+sleep .2
+# restarted clvmd has the same PID (no fork, only execvp)
 NEW_LOCAL_CLVMD=$(pgrep clvmd)
-read LOCAL_CLVMD < LOCAL_CLVMD
 test "$LOCAL_CLVMD" -eq "$NEW_LOCAL_CLVMD"
 
 # FIXME: Hmm - how could we test exclusivity is preserved in singlenode ?
 lvchange -an $vg/$lv1
 lvchange -ay $vg/$lv1
 
-lib/clvmd -R
+"$LVM_CLVMD_BINARY" -R
 
 vgremove -ff $vg


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-04-08 14:40 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-04-08 14:40 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-04-08 14:40:21

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c clvmd.c refresh_clvmd.c 
	lib/activate   : fs.c 
	lib/device     : dev-swap.c 
	lib/locking    : cluster_locking.c 
	lib/metadata   : lv_manip.c metadata.c mirror.c 
	lib/misc       : lvm-string.c 
	lib/mm         : memlock.c 
	libdm          : libdm-file.c libdm-report.c 
	libdm/regex    : matcher.c 
	tools          : dmsetup.c lvconvert.c lvmcmdline.c 

Log message:
	Fix some unmatching sign comparation gcc warnings
	
	Simple replacement for unsigned type - usually in for() loops.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1968&r2=1.1969
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.53&r2=1.54
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.103&r2=1.104
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/refresh_clvmd.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.61&r2=1.62
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-swap.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.256&r2=1.257
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.453&r2=1.454
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.147&r2=1.148
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/mm/memlock.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-file.c.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/libdm-report.c.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/matcher.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.158&r2=1.159
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvconvert.c.diff?cvsroot=lvm2&r1=1.159&r2=1.160
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.137&r2=1.138

--- LVM2/WHATS_NEW	2011/04/07 21:49:29	1.1968
+++ LVM2/WHATS_NEW	2011/04/08 14:40:18	1.1969
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Fix some unmatching sign comparation gcc warnings in the code.
   Allow lv_extend() to work on zero length intrinsically layered LVs.
   Keep the cache content when the exported vg buffer is matching.
   Extend the set of memory regions, that are not locked to memory.
--- LVM2/daemons/clvmd/clvmd-command.c	2011/02/18 16:17:56	1.53
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/04/08 14:40:18	1.54
@@ -377,7 +377,7 @@
 	/* Propogate debug options */
 	if (clvmd_get_debug()) {
 		if (!(debug_arg = malloc(16)) ||
-		    dm_snprintf(debug_arg, 16, "-d%d", (int)clvmd_get_debug()) < 0)
+		    dm_snprintf(debug_arg, 16, "-d%u", clvmd_get_debug()) < 0)
 			goto_out;
 		argv[argc++] = debug_arg;
 		debug_arg = NULL;
--- LVM2/daemons/clvmd/clvmd.c	2011/03/30 12:48:16	1.103
+++ LVM2/daemons/clvmd/clvmd.c	2011/04/08 14:40:18	1.104
@@ -2157,7 +2157,7 @@
 {
 	struct local_client *thisfd;
 	for (thisfd = &local_client_head; thisfd != NULL; thisfd = thisfd->next) {
-		if (thisfd->fd == ntohl(clientid))
+		if (thisfd->fd == (int)ntohl(clientid))
 			return thisfd;
 	}
 	return NULL;
--- LVM2/daemons/clvmd/refresh_clvmd.c	2011/03/29 21:05:39	1.14
+++ LVM2/daemons/clvmd/refresh_clvmd.c	2011/04/08 14:40:18	1.15
@@ -80,7 +80,7 @@
 	char outbuf[PIPE_BUF];
 	struct clvm_header *outheader = (struct clvm_header *) outbuf;
 	int len;
-	int off;
+	unsigned off;
 	int buflen;
 	int err;
 
--- LVM2/lib/activate/fs.c	2011/02/18 14:16:11	1.61
+++ LVM2/lib/activate/fs.c	2011/04/08 14:40:19	1.62
@@ -327,7 +327,7 @@
 /* Check if there is other the type of fs operation stacked */
 static int _other_fs_ops(fs_op_t type)
 {
-	int i;
+	unsigned i;
 
 	for (i = 0; i < NUM_FS_OPS; i++)
 		if (type != i && _count_fs_ops[i])
--- LVM2/lib/device/dev-swap.c	2010/08/19 23:05:45	1.2
+++ LVM2/lib/device/dev-swap.c	2011/04/08 14:40:19	1.3
@@ -42,7 +42,8 @@
 {
 	char buf[10];
 	uint64_t size;
-	int page, ret = 0;
+	unsigned page;
+	int ret = 0;
 
 	if (!dev_get_size(dev, &size)) {
 		stack;
--- LVM2/lib/locking/cluster_locking.c	2011/03/29 21:05:39	1.54
+++ LVM2/lib/locking/cluster_locking.c	2011/04/08 14:40:19	1.55
@@ -100,7 +100,7 @@
 	char outbuf[PIPE_BUF] __attribute__((aligned(8)));
 	struct clvm_header *outheader = (struct clvm_header *) outbuf;
 	int len;
-	int off;
+	unsigned off;
 	int buflen;
 	int err;
 
--- LVM2/lib/metadata/lv_manip.c	2011/04/07 21:49:29	1.256
+++ LVM2/lib/metadata/lv_manip.c	2011/04/08 14:40:19	1.257
@@ -976,7 +976,7 @@
 					       (le - seg->le) / area_multiple,
 					       area_len, NULL, max_seg_len, 0,
 					       (stripes_per_mimage == 1) && only_single_area_segments ? 1U : 0U,
-					       top_level_area_index != -1 ? top_level_area_index : (int) s * stripes_per_mimage,
+					       (top_level_area_index != -1) ? top_level_area_index : (int) (s * stripes_per_mimage),
 					       only_single_area_segments, fn,
 					       data)))
 				stack;
--- LVM2/lib/metadata/metadata.c	2011/04/01 14:54:20	1.453
+++ LVM2/lib/metadata/metadata.c	2011/04/08 14:40:20	1.454
@@ -1987,7 +1987,7 @@
 			       int (*fn)(struct logical_volume *lv, void *data),
 			       void *data)
 {
-	int i, s;
+	unsigned i, s;
 	struct lv_segment *lvseg;
 
 	struct logical_volume *deps[] = {
@@ -2111,7 +2111,7 @@
 
 static int _lv_mark_if_partial_single(struct logical_volume *lv, void *data)
 {
-	int s;
+	unsigned s;
 	struct _lv_mark_if_partial_baton baton;
 	struct lv_segment *lvseg;
 
@@ -2200,7 +2200,7 @@
 	struct validate_hash *vhash = data;
 	struct lv_segment *lvseg;
 	struct physical_volume *pv;
-	int s;
+	unsigned s;
 	int r = 1;
 
 	if (lv != dm_hash_lookup_binary(vhash->lvid, &lv->lvid.id[1],
--- LVM2/lib/metadata/mirror.c	2011/04/06 21:32:20	1.147
+++ LVM2/lib/metadata/mirror.c	2011/04/08 14:40:20	1.148
@@ -200,7 +200,7 @@
  */
 int shift_mirror_images(struct lv_segment *mirrored_seg, unsigned mimage)
 {
-	int i;
+	unsigned i;
 	struct lv_segment_area area;
 
 	if (mimage >= mirrored_seg->area_count) {
@@ -1836,7 +1836,7 @@
 	int in_sync;
 	struct logical_volume *log_lv;
 	struct lvinfo info;
-	int old_log_count;
+	unsigned old_log_count;
 	int r = 0;
 
 	if (dm_list_size(&lv->segments) != 1) {
--- LVM2/lib/misc/lvm-string.c	2011/03/13 23:18:30	1.26
+++ LVM2/lib/misc/lvm-string.c	2011/04/08 14:40:20	1.27
@@ -144,7 +144,7 @@
  * process several characters in one go.
  */
 static void _unquote_characters(char *src, const char *orig_chars,
-				const int num_orig_chars, 
+				size_t num_orig_chars,
 				const char quote_char,
 				char *arr_substr_first_unquoted[])
 {
--- LVM2/lib/mm/memlock.c	2011/03/30 13:06:13	1.39
+++ LVM2/lib/mm/memlock.c	2011/04/08 14:40:20	1.40
@@ -151,7 +151,8 @@
 {
 	const struct config_value *cv;
 	long from, to;
-	int pos, i;
+	int pos;
+	unsigned i;
 	char fr, fw, fx, fp;
 	size_t sz;
 
--- LVM2/libdm/libdm-file.c	2010/10/20 15:12:12	1.14
+++ LVM2/libdm/libdm-file.c	2011/04/08 14:40:20	1.15
@@ -149,7 +149,7 @@
 		goto fail_close_unlink;
 	}
 
-	if ((write_out == 0) || (write_out < bufferlen)) {
+	if ((write_out == 0) || ((size_t)write_out < bufferlen)) {
 		log_error("Cannot write pid to pidfile [%s], shortwrite of"
 			  "[%" PRIsize_t "] bytes, expected [%" PRIsize_t "]\n",
 			  lockfile, write_out, bufferlen);
--- LVM2/libdm/libdm-report.c	2011/02/18 23:09:55	1.43
+++ LVM2/libdm/libdm-report.c	2011/04/08 14:40:20	1.44
@@ -734,8 +734,8 @@
 			return 0;
 		}
 
-		if ((strlen(field->report_string) > field->props->width))
-			field->props->width = strlen(field->report_string);
+		if (((int) strlen(field->report_string) > field->props->width))
+			field->props->width = (int) strlen(field->report_string);
 
 		if ((rh->flags & RH_SORT_REQUIRED) &&
 		    (field->props->flags & FLD_SORT_KEY)) {
@@ -775,8 +775,8 @@
 	}
 
 	dm_list_iterate_items(fp, &rh->field_props) {
-		if (buf_size < fp->width)
-			buf_size = fp->width;
+		if ((int) buf_size < fp->width)
+			buf_size = (size_t) fp->width;
 	}
 	/* Including trailing '\0'! */
 	buf_size++;
--- LVM2/libdm/regex/matcher.c	2010/12/20 13:23:12	1.16
+++ LVM2/libdm/regex/matcher.c	2011/04/08 14:40:21	1.17
@@ -100,7 +100,7 @@
 
 static void _create_bitsets(struct dm_regex *m)
 {
-	int i;
+	unsigned i;
 
 	for (i = 0; i < m->num_nodes; i++) {
 		struct rx_node *n = m->nodes[i];
@@ -112,7 +112,7 @@
 
 static void _calc_functions(struct dm_regex *m)
 {
-	int i, j, final = 1;
+	unsigned i, j, final = 1;
 	struct rx_node *rx, *c1, *c2;
 
 	for (i = 0; i < m->num_nodes; i++) {
@@ -253,7 +253,8 @@
 {
 	unsigned iwidth = (m->num_charsets / DM_BITS_PER_INT) + 1;
 	struct dfa_state *dfa;
-	int i, a;
+	unsigned i;
+	int a;
 
 	m->tt = ttree_create(m->scratch, iwidth);
 	if (!m->tt)
@@ -314,7 +315,7 @@
 				 unsigned num_patterns)
 {
 	char *all, *ptr;
-	int i;
+	unsigned i;
 	size_t len = 0;
 	struct rx_node *rx;
 	struct dm_regex *m;
--- LVM2/tools/dmsetup.c	2011/03/29 21:56:53	1.158
+++ LVM2/tools/dmsetup.c	2011/04/08 14:40:21	1.159
@@ -2412,7 +2412,7 @@
 			 void *private)
 {
 	const struct dm_deps *deps = data;
-	int i;
+	unsigned i;
 	char buf[DM_MAX_TYPE_NAME], *repstr;
 
 	if (!dm_pool_begin_object(mem, 16)) {
--- LVM2/tools/lvconvert.c	2011/03/29 12:51:58	1.159
+++ LVM2/tools/lvconvert.c	2011/04/08 14:40:21	1.160
@@ -555,7 +555,7 @@
 {
 	struct lv_segment *lvseg;
 	int ret = 0;
-	int s;
+	unsigned s;
 
 	dm_list_iterate_items(lvseg, &lv->segments) {
 		if (!seg_is_mirrored(lvseg))
--- LVM2/tools/lvmcmdline.c	2011/01/13 15:00:29	1.137
+++ LVM2/tools/lvmcmdline.c	2011/04/08 14:40:21	1.138
@@ -1274,7 +1274,7 @@
 	if (getenv("LVM_SUPPRESS_FD_WARNINGS"))
 		suppress_warnings = 1;
 
-	for (fd = 3; fd < rlim.rlim_cur; fd++)
+	for (fd = 3; fd < (int)rlim.rlim_cur; fd++)
 		_close_descriptor(fd, suppress_warnings, command, ppid,
 				  parent_cmdline);
 }


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-02-18 16:18 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-02-18 16:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-02-18 16:17:57

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	tools          : dmsetup.c vgconvert.c 

Log message:
	Fix gcc warnings for unused variables
	
	Put dead assigment code into comment.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1921&r2=1.1922
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/dmsetup.c.diff?cvsroot=lvm2&r1=1.153&r2=1.154
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgconvert.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45

--- LVM2/WHATS_NEW	2011/02/18 15:02:25	1.1921
+++ LVM2/WHATS_NEW	2011/02/18 16:17:56	1.1922
@@ -1,5 +1,6 @@
 Version 2.02.85 - 
 ===================================
+  Fix gcc warnings for unused variables.
   Add stack backtraces for error paths in process_each_lv().
   Fixing some const cast gcc warnings in the code.
   Use char* arithmetic in _text_write(), _text_read() & send_message().
--- LVM2/daemons/clvmd/clvmd-command.c	2011/02/04 19:18:17	1.52
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/02/18 16:17:56	1.53
@@ -185,7 +185,6 @@
     struct clvm_header *header =
 	(struct clvm_header *) client->bits.localsock.cmd;
     unsigned char lock_cmd;
-    unsigned char lock_flags;
     int lock_mode;
     char *args = header->node + strlen(header->node) + 1;
     int lkid;
@@ -207,7 +206,7 @@
 
     lock_cmd = args[0] & (LCK_NONBLOCK | LCK_HOLD | LCK_SCOPE_MASK | LCK_TYPE_MASK);
     lock_mode = ((int)lock_cmd & LCK_TYPE_MASK);
-    lock_flags = args[1];
+    /* lock_flags = args[1]; */
     lockname = &args[2];
     DEBUGLOG("doing PRE command LOCK_VG '%s' at %x (client=%p)\n", lockname, lock_cmd, client);
 
--- LVM2/tools/dmsetup.c	2011/02/04 22:17:55	1.153
+++ LVM2/tools/dmsetup.c	2011/02/18 16:17:57	1.154
@@ -2998,7 +2998,6 @@
 static int _process_losetup_switches(const char *base, int *argc, char ***argv,
 				     const char *dev_dir)
 {
-	static int ind;
 	int c;
 	int encrypt_loop = 0, delete = 0, find = 0, show_all = 0;
 	char *device_name = NULL;
@@ -3013,8 +3012,8 @@
 
 	optarg = 0;
 	optind = OPTIND_INIT;
-	while ((ind = -1, c = GETOPTLONG_FN(*argc, *argv, "ade:fo:v",
-					    long_options, NULL)) != -1 ) {
+	while ((c = GETOPTLONG_FN(*argc, *argv, "ade:fo:v",
+				  long_options, NULL)) != -1 ) {
 		if (c == ':' || c == '?')
 			return 0;
 		if (c == 'a')
--- LVM2/tools/vgconvert.c	2010/08/17 16:25:35	1.44
+++ LVM2/tools/vgconvert.c	2011/02/18 16:17:57	1.45
@@ -26,7 +26,7 @@
 	struct dm_list mdas;
 	int pvmetadatacopies = 0;
 	uint64_t pvmetadatasize = 0;
-	uint64_t pe_end = 0, pe_start = 0;
+	uint64_t pe_start = 0;
 	struct pv_list *pvl;
 	int change_made = 0;
 	struct lvinfo info;
@@ -119,8 +119,7 @@
 		existing_pv = pvl->pv;
 
 		pe_start = pv_pe_start(existing_pv);
-		pe_end = pv_pe_count(existing_pv) * pv_pe_size(existing_pv)
-		    + pe_start - 1;
+		/* pe_end = pv_pe_count(existing_pv) * pv_pe_size(existing_pv) + pe_start - 1; */
 
 		dm_list_init(&mdas);
 		if (!(pv = pv_create(cmd, pv_dev(existing_pv),


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-02-04 19:18 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-02-04 19:18 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

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

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	lib/locking    : external_locking.c file_locking.c locking.h 

Log message:
	Use cluster-wide message to request device name sync
	
	Thanks to CLVMD_CMD_SYNC_NAMES propagation fix the message passing started
	to work. So starts to send a message before the VG is unlocked.
	Removing also implicit sync in VG unlock from clmvd as now the message
	is delievered and processed in do_command().
	Also add support for this new message into external locking
	and mask this event from further processing.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1903&r2=1.1904
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.51&r2=1.52
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/external_locking.c.diff?cvsroot=lvm2&r1=1.17&r2=1.18
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.56&r2=1.57
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.60&r2=1.61

--- LVM2/WHATS_NEW	2011/02/04 19:14:39	1.1903
+++ LVM2/WHATS_NEW	2011/02/04 19:18:16	1.1904
@@ -1,5 +1,6 @@
 Version 2.02.83 - 
 ===================================
+  Use cluster-wide message to request device name sync.
   Fix operation node stacking for consecutive dm ops.
   Increase hash table size to 1024 lv names and 64 pv uuids.
   Remove fs_unlock() from lv_resume path.
--- LVM2/daemons/clvmd/clvmd-command.c	2011/02/02 13:34:00	1.51
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/02/04 19:18:17	1.52
@@ -217,7 +217,6 @@
 	if (lkid == 0)
 	    return EINVAL;
 
-	lvm_do_fs_unlock(); /* Wait for devices */
 	status = sync_unlock(lockname, lkid);
 	if (status)
 	    status = errno;
--- LVM2/lib/locking/external_locking.c	2009/05/21 03:04:53	1.17
+++ LVM2/lib/locking/external_locking.c	2011/02/04 19:18:17	1.18
@@ -18,6 +18,8 @@
 #include "defaults.h"
 #include "sharedlib.h"
 #include "toolcontext.h"
+#include "activate.h"
+#include "locking.h"
 
 static void *_locking_lib = NULL;
 static void (*_reset_fn) (void) = NULL;
@@ -31,10 +33,16 @@
 static int _lock_resource(struct cmd_context *cmd, const char *resource,
 			  uint32_t flags)
 {
-	if (_lock_fn)
-		return _lock_fn(cmd, resource, flags);
-	else
+	if (!_lock_fn)
 		return 0;
+
+	if (!strcmp(resource, VG_SYNC_NAMES)) {
+		/* Hide this lock request from external locking */
+		fs_unlock();
+		return 1;
+	}
+
+	return _lock_fn(cmd, resource, flags);
 }
 
 static void _fin_external_locking(void)
--- LVM2/lib/locking/file_locking.c	2011/02/02 13:34:00	1.56
+++ LVM2/lib/locking/file_locking.c	2011/02/04 19:18:17	1.57
@@ -215,7 +215,6 @@
 		state = 'W';
 		break;
 	case LCK_UNLOCK:
-		fs_unlock(); /* Wait until devices are available */
 		return _release_lock(file, 1);
 	default:
 		log_error("Unrecognised lock type: %d", flags & LCK_TYPE_MASK);
--- LVM2/lib/locking/locking.h	2011/01/12 20:42:51	1.60
+++ LVM2/lib/locking/locking.h	2011/02/04 19:18:17	1.61
@@ -143,7 +143,12 @@
 		lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv)) : \
 		0)
 
-#define unlock_vg(cmd, vol)	lock_vol(cmd, vol, LCK_VG_UNLOCK)
+#define unlock_vg(cmd, vol)	\
+	do { \
+		if (is_real_vg(vol)) \
+			sync_dev_names(cmd); \
+		lock_vol(cmd, vol, LCK_VG_UNLOCK); \
+	} while (0)
 #define unlock_and_free_vg(cmd, vg, vol) \
 	do { \
 		unlock_vg(cmd, vol); \
@@ -172,6 +177,8 @@
 	lock_vol((vg)->cmd, (vg)->name, LCK_VG_BACKUP)
 #define sync_local_dev_names(cmd)	\
 	lock_vol(cmd, VG_SYNC_NAMES, LCK_NONE | LCK_CACHE | LCK_LOCAL)
+#define sync_dev_names(cmd)	\
+	lock_vol(cmd, VG_SYNC_NAMES, LCK_NONE | LCK_CACHE)
 
 /* Process list of LVs */
 int suspend_lvs(struct cmd_context *cmd, struct dm_list *lvs);


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-01-31 19:52 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-01-31 19:52 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-31 19:52:41

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	lib/locking    : file_locking.c locking.c 
Added files:
	test           : t-vgchange-sysinit.sh 

Log message:
	Fix udev synchronization for no-locking mode
	
	Instead of implicitly syncing udev operation in clustered and
	file locking code -  call synchronization directly in lock_vol() when
	the operation unlocks VG
	
	The problem is missing implicit fs_unlock() in the no_locking code.
	This is used with --sysinit on read-only filesystem locking dir.
	In this case vgchange -ay could exit before all udev nodes are properly
	synchronised and may cause problems with accessing such node right after
	vgchange --sysinint command is finished.
	
	Add test case for vgchange --sysinit.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1895&r2=1.1896
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.89&r2=1.90
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/test/t-vgchange-sysinit.sh.diff?cvsroot=lvm2&r1=NONE&r2=1.1

--- LVM2/WHATS_NEW	2011/01/28 16:03:38	1.1895
+++ LVM2/WHATS_NEW	2011/01/31 19:52:40	1.1896
@@ -1,5 +1,6 @@
 Version 2.02.83 - 
 ===================================
+  Fix udev synchronization with no-locking --sysinit (2.02.80).
   Updating man pages for pvcreate, pvremove, pvresize, pvscan.
   Avoid rebuilding of uuid validation table.
   Always use O_DIRECT when opening block devices to check for partitioning.
--- LVM2/daemons/clvmd/clvmd-command.c	2011/01/19 23:09:31	1.49
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/01/31 19:52:41	1.50
@@ -217,7 +217,6 @@
 	if (lkid == 0)
 	    return EINVAL;
 
-	lvm_do_fs_unlock(); /* Wait for devices */
 	status = sync_unlock(lockname, lkid);
 	if (status)
 	    status = errno;
--- LVM2/lib/locking/file_locking.c	2011/01/12 20:42:50	1.54
+++ LVM2/lib/locking/file_locking.c	2011/01/31 19:52:41	1.55
@@ -215,7 +215,6 @@
 		state = 'W';
 		break;
 	case LCK_UNLOCK:
-		fs_unlock(); /* Wait until devices are available */
 		return _release_lock(file, 1);
 	default:
 		log_error("Unrecognised lock type: %d", flags & LCK_TYPE_MASK);
--- LVM2/lib/locking/locking.c	2011/01/13 14:56:17	1.89
+++ LVM2/lib/locking/locking.c	2011/01/31 19:52:41	1.90
@@ -442,6 +442,10 @@
 		/* If LVM1 driver knows about the VG, it can't be accessed. */
 		if (!check_lvm1_vg_inactive(cmd, vol))
 			return_0;
+
+		/* Before unlocking VG wait until devices are available. */
+		if ((flags & LCK_TYPE_MASK) == LCK_UNLOCK)
+			sync_local_dev_names(cmd);
 		break;
 	case LCK_LV:
 		/* All LV locks are non-blocking. */
/cvs/lvm2/LVM2/test/t-vgchange-sysinit.sh,v  -->  standard output
revision 1.1
--- LVM2/test/t-vgchange-sysinit.sh
+++ -	2011-01-31 19:52:42.890998000 +0000
@@ -0,0 +1,50 @@
+#!/bin/bash
+# Copyright (C) 2011 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+. lib/test
+
+which mkfs.ext3 || exit 200
+
+aux prepare_pvs 2 8
+
+var_lock="$DM_DEV_DIR/$vg1/$lv1"
+# keep in sync with aux configured lockingdir
+mount_dir="$TESTDIR/var/lock/lvm"
+
+cleanup_mounted_and_teardown()
+{
+	umount $mount_dir || true
+	aux teardown
+}
+
+vgcreate -c n $vg1 $dev1
+vgcreate -c n $vg2 $dev2
+
+lvcreate -l 1 -n $lv2 $vg2
+vgchange -an $vg2
+
+lvcreate -n $lv1 -l 100%FREE $vg1
+mkfs.ext3 -b4096 -j $var_lock
+
+trap 'cleanup_mounted_and_teardown' EXIT
+mount -n -r $var_lock $mount_dir
+
+# locking must fail on read-only filesystem
+not vgchange -ay $vg2
+
+# no-locking with --sysinit
+vgchange --sysinit -ay $vg2
+test -b "$DM_DEV_DIR/$vg2/$lv2"
+
+vgchange --sysinit -an $vg2
+test ! -b "$DM_DEV_DIR/$vg2/$lv2"
+
+vgchange --ignorelockingfailure -ay $vg2


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-01-17 23:13 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2011-01-17 23:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2011-01-17 23:13:14

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c clvmd.c clvmd.h 
	man            : clvmd.8.in 

Log message:
	Add -f (don't fork) option to clvmd and fix clvmd -d<num> description.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1883&r2=1.1884
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.h.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/clvmd.8.in.diff?cvsroot=lvm2&r1=1.4&r2=1.5

--- LVM2/WHATS_NEW	2011/01/17 18:16:18	1.1883
+++ LVM2/WHATS_NEW	2011/01/17 23:13:14	1.1884
@@ -1,5 +1,6 @@
 Version 2.02.82 -
 ===================================
+  Add -f (don't fork) option to clvmd and fix clvmd -d<num> description.
 
 Version 2.02.81 - 17th January 2011
 ===================================
--- LVM2/daemons/clvmd/clvmd-command.c	2011/01/12 20:42:50	1.47
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/01/17 23:13:14	1.48
@@ -63,7 +63,6 @@
 
 #include <sys/utsname.h>
 
-extern debug_t debug;
 extern struct cluster_ops *clops;
 static int restart_clvmd(void);
 
@@ -144,7 +143,7 @@
 		break;
 
 	case CLVMD_CMD_SET_DEBUG:
-		debug = args[0];
+		clvmd_set_debug(args[0]);
 		break;
 
 	case CLVMD_CMD_RESTART:
@@ -310,19 +309,16 @@
 		client->bits.localsock.private = 0;
 		break;
 
-	case CLVMD_CMD_LOCK_VG:
-	case CLVMD_CMD_VG_BACKUP:
-	case CLVMD_CMD_SYNC_NAMES:
-	case CLVMD_CMD_LOCK_QUERY:
-		/* Nothing to do here */
-		break;
-
 	case CLVMD_CMD_LOCK_LV:
 		lock_cmd = args[0];
 		lock_flags = args[1];
 		lockname = &args[2];
 		status = post_lock_lv(lock_cmd, lock_flags, lockname);
 		break;
+
+	default:
+		/* Nothing to do here */
+		break;
 	}
 	return status;
 }
@@ -381,9 +377,9 @@
 		goto_out;
 
 	/* Propogate debug options */
-	if (debug) {
+	if (clvmd_get_debug()) {
 		if (!(debug_arg = malloc(16)) ||
-		    dm_snprintf(debug_arg, 16, "-d%d", (int)debug) < 0)
+		    dm_snprintf(debug_arg, 16, "-d%d", (int)clvmd_get_debug()) < 0)
 			goto_out;
 		argv[argc++] = debug_arg;
 	}
--- LVM2/daemons/clvmd/clvmd.c	2011/01/05 12:17:19	1.92
+++ LVM2/daemons/clvmd/clvmd.c	2011/01/17 23:13:14	1.93
@@ -81,7 +81,8 @@
 	char **argv;
 };
 
-debug_t debug;
+static debug_t debug = DEBUG_OFF;
+static int foreground_mode = 0;
 static pthread_t lvm_thread;
 static pthread_mutex_t lvm_thread_mutex;
 static pthread_cond_t lvm_thread_cond;
@@ -145,12 +146,11 @@
 
 static void usage(const char *prog, FILE *file)
 {
-	fprintf(file, "Usage:\n"
-		"%s [Vhd]\n\n"
+	fprintf(file, "Usage: %s [options]\n"
 		"   -V       Show version of clvmd\n"
 		"   -h       Show this help information\n"
-		"   -d       Set debug level\n"
-		"            If starting clvmd then don't fork, run in the foreground\n"
+		"   -d[n]    Set debug logging (0:none, 1:stderr (implies -f option), 2:syslog)\n"
+		"   -f       Don't fork, run in the foreground\n"
 		"   -R       Tell all running clvmds in the cluster to reload their device cache\n"
 		"   -S       Restart clvmd, preserving exclusive locks\n"
 		"   -C       Sets debug level (from -d) on all clvmd instances clusterwide\n"
@@ -209,14 +209,15 @@
 	va_list ap;
 	static int syslog_init = 0;
 
-	if (debug == DEBUG_STDERR) {
+	switch (clvmd_get_debug()) {
+	case DEBUG_STDERR:
 		va_start(ap,fmt);
 		time(&P);
 		fprintf(stderr, "CLVMD[%x]: %.15s ", (int)pthread_self(), ctime(&P)+4 );
 		vfprintf(stderr, fmt, ap);
 		va_end(ap);
-	}
-	if (debug == DEBUG_SYSLOG) {
+		break;
+	case DEBUG_SYSLOG:
 		if (!syslog_init) {
 			openlog("clvmd", LOG_PID, LOG_DAEMON);
 			syslog_init = 1;
@@ -225,9 +226,28 @@
 		va_start(ap,fmt);
 		vsyslog(LOG_DEBUG, fmt, ap);
 		va_end(ap);
+		break;
+	case DEBUG_OFF:
+		break;
 	}
 }
 
+void clvmd_set_debug(debug_t new_debug)
+{
+	if (!foreground_mode && new_debug == DEBUG_STDERR)
+		new_debug = DEBUG_SYSLOG;
+
+	if (new_debug > DEBUG_SYSLOG)
+		new_debug = DEBUG_SYSLOG;
+
+	debug = new_debug;
+}
+
+debug_t clvmd_get_debug(void)
+{
+	return debug;
+}
+
 static const char *decode_cmd(unsigned char cmdl)
 {
 	static char buf[128];
@@ -322,13 +342,14 @@
 	sigset_t ss;
 	int using_gulm = 0;
 	int debug_opt = 0;
+	debug_t debug_arg = DEBUG_OFF;
 	int clusterwide_opt = 0;
 	mode_t old_mask;
 
 	/* Deal with command-line arguments */
 	opterr = 0;
 	optind = 0;
-	while ((opt = getopt(argc, argv, "?vVhd::t:RST:CI:E:")) != EOF) {
+	while ((opt = getopt(argc, argv, "?vVhfd::t:RST:CI:E:")) != EOF) {
 		switch (opt) {
 		case 'h':
 			usage(argv[0], stdout);
@@ -352,12 +373,14 @@
 
 		case 'd':
 			debug_opt = 1;
-			if (optarg)
-				debug = atoi(optarg);
-			else
-				debug = DEBUG_STDERR;
+			debug_arg = optarg ? atoi(optarg) : DEBUG_STDERR;
+			if (debug_arg == DEBUG_STDERR)
+				foreground_mode = 1;
 			break;
 
+		case 'f':
+			foreground_mode = 1;
+			break;
 		case 't':
 			cmd_timeout = atoi(optarg);
 			if (!cmd_timeout) {
@@ -391,15 +414,6 @@
 
 	check_permissions();
 
-	/* Setting debug options on an existing clvmd */
-	if (debug_opt && !check_local_clvmd()) {
-
-		/* Sending to stderr makes no sense for a detached daemon */
-		if (debug == DEBUG_STDERR)
-			debug = DEBUG_SYSLOG;
-		return debug_clvmd(debug, clusterwide_opt)==1?0:1;
-	}
-
 	/*
 	 * Switch to C locale to avoid reading large locale-archive file
 	 * used by some glibc (on some distributions it takes over 100MB).
@@ -408,10 +422,15 @@
 	if (setenv("LANG", "C", 1))
 		perror("Cannot set LANG to C");
 
+	/* Setting debug options on an existing clvmd */
+	if (debug_opt && !check_local_clvmd())
+		return debug_clvmd(debug_arg, clusterwide_opt)==1?0:1;
+
+	clvmd_set_debug(debug_opt);
+
 	/* Fork into the background (unless requested not to) */
-	if (debug != DEBUG_STDERR) {
+	if (!foreground_mode)
 		be_daemon(start_timeout);
-	}
 
         dm_prepare_selinux_context(DEFAULT_RUN_DIR, S_IFDIR);
         old_mask = umask(0077);
--- LVM2/daemons/clvmd/clvmd.h	2010/07/28 13:55:43	1.12
+++ LVM2/daemons/clvmd/clvmd.h	2011/01/17 23:13:14	1.13
@@ -117,6 +117,9 @@
 extern void debuglog(const char *fmt, ... )
   __attribute__ ((format(printf, 1, 2)));
 
+void clvmd_set_debug(debug_t new_de);
+debug_t clvmd_get_debug(void);
+
 int sync_lock(const char *resource, int mode, int flags, int *lockid);
 int sync_unlock(const char *resource, int lockid);
 
--- LVM2/man/clvmd.8.in	2010/04/30 14:49:44	1.4
+++ LVM2/man/clvmd.8.in	2011/01/17 23:13:14	1.5
@@ -3,7 +3,7 @@
 clvmd \- cluster LVM daemon
 .SH SYNOPSIS
 .B clvmd
-[\-d [<value>]] [\-C] [\-h]
+[\-d[<value>]] [\-C] [\-h]
 [\-R]
 [\-S]
 [\-t <timeout>]
@@ -15,19 +15,18 @@
 if a node in the cluster does not have this daemon running.
 .SH OPTIONS
 .TP
-.I \-d [<value>]
+.I \-d[<value>]
 Enable debug logging. Value can be 0, 1 or 2.
 .br
-0 disables debug logging in a running clvmd
+0 disables debug logging
 .br
-1 sends debug logs to stderr (clvmd will not fork in this case)
+1 sends debug logs to stderr (implies -f option)
 .br
 2 sends debug logs to syslog
 .br
 If 
 .B -d 
-is specified without a value then 1 is assumed if you are starting a
-new clvmd, 2 if you are enabling debug in a running clvmd.
+is specified without a value then 1 is assumed.
 .TP
 .I \-C
 Only valid if 


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2011-01-10 14:02 zkabelac
  0 siblings, 0 replies; 23+ messages in thread
From: zkabelac @ 2011-01-10 14:02 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	zkabelac@sourceware.org	2011-01-10 14:02:31

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c lvm-functions.c lvm-functions.h 
	lib/activate   : activate.c activate.h dev_manager.c fs.c fs.h 
	lib/locking    : file_locking.c 
	lib/metadata   : lv_manip.c 

Log message:
	Speedup consequent activation calls
	
	Stop calling fs_unlock() from lv_de/activate().
	Start using internal lvm fs cookie for dm_tree.
	Stop directly calling dm_udev_wait() and
	dm_tree_set/get_cookie() from activate code -
	it's now called through fs_unlock() function.
	
	Add lvm_do_fs_unlock()
	
	Call fs_unlock() when unlocking vg where implicit unlock solves the
	problem also for cluster - thus no extra command for clustering
	environment is required - only lvm_do_fs_unlock() function is added
	to call lvm's fs_unlock() while holding lvm_lock mutex in clvmd.
	
	Add fs_unlock() also to set_lv() so the command waits until devices
	are ready for regular open (i.e. wiping its begining).
	
	Move fs_unlock() prototype to activation.h to keep fs.h private
	in lib/activate dir and not expose other functions from this header.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1869&r2=1.1870
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.45&r2=1.46
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.104&r2=1.105
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.h.diff?cvsroot=lvm2&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.184&r2=1.185
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.72&r2=1.73
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.211&r2=1.212
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.54&r2=1.55
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.h.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.241&r2=1.242

--- LVM2/WHATS_NEW	2011/01/10 13:44:39	1.1869
+++ LVM2/WHATS_NEW	2011/01/10 14:02:30	1.1870
@@ -1,5 +1,6 @@
 Version 2.02.80 - 
 ====================================
+  Speedup consequent activation calls by using internal cookie.
   Add internal lvm library cookie.
   Speedup command processing by caching resolved config tree.
   Pass config_tree to renamed function import_vg_from_config_tree().
--- LVM2/daemons/clvmd/clvmd-command.c	2010/12/22 12:14:11	1.45
+++ LVM2/daemons/clvmd/clvmd-command.c	2011/01/10 14:02:30	1.46
@@ -214,6 +214,7 @@
 	if (lkid == 0)
 	    return EINVAL;
 
+	lvm_do_fs_unlock(); /* Wait for devices */
 	status = sync_unlock(lockname, lkid);
 	if (status)
 	    status = errno;
--- LVM2/daemons/clvmd/lvm-functions.c	2010/12/08 20:50:48	1.104
+++ LVM2/daemons/clvmd/lvm-functions.c	2011/01/10 14:02:30	1.105
@@ -894,6 +894,13 @@
 	return v;
 }
 
+void lvm_do_fs_unlock(void)
+{
+	pthread_mutex_lock(&lvm_lock);
+	fs_unlock();
+	pthread_mutex_unlock(&lvm_lock);
+}
+
 /* Called to initialise the LVM context of the daemon */
 int init_clvm(int using_gulm, char **argv)
 {
--- LVM2/daemons/clvmd/lvm-functions.h	2010/08/17 16:25:32	1.14
+++ LVM2/daemons/clvmd/lvm-functions.h	2011/01/10 14:02:30	1.15
@@ -36,5 +36,6 @@
 extern void do_lock_vg(unsigned char command, unsigned char lock_flags,
 		      char *resource);
 extern struct dm_hash_node *get_next_excl_lock(struct dm_hash_node *v, char **name);
+void lvm_do_fs_unlock(void);
 
 #endif
--- LVM2/lib/activate/activate.c	2010/12/20 13:37:26	1.184
+++ LVM2/lib/activate/activate.c	2011/01/10 14:02:31	1.185
@@ -1206,7 +1206,6 @@
 	memlock_inc(cmd);
 	r = _lv_deactivate(lv);
 	memlock_dec(cmd);
-	fs_unlock();
 
 	if (!lv_info(cmd, lv, 0, &info, 1, 0) || info.exists)
 		r = 0;
@@ -1305,7 +1304,6 @@
 	if (!(r = _lv_activate_lv(lv, 0)))
 		stack;
 	memlock_dec(cmd);
-	fs_unlock();
 
 	if (r && !monitor_dev_for_events(cmd, lv, 0, 1))
 		stack;
--- LVM2/lib/activate/activate.h	2010/11/30 11:53:31	1.72
+++ LVM2/lib/activate/activate.h	2011/01/10 14:02:31	1.73
@@ -121,4 +121,9 @@
  */
 int device_is_usable(struct device *dev);
 
+/*
+ * Declaration moved here from fs.h to keep header fs.h hidden
+ */
+void fs_unlock(void);
+
 #endif
--- LVM2/lib/activate/dev_manager.c	2011/01/05 14:03:37	1.211
+++ LVM2/lib/activate/dev_manager.c	2011/01/10 14:02:31	1.212
@@ -1622,7 +1622,6 @@
 	struct dm_tree_node *child;
 	char *vgname, *lvname, *layer;
 	const char *name, *uuid;
-	int r;
 
 	while ((child = dm_tree_next_child(&handle, root, 0))) {
 		if (!(name = dm_tree_node_get_name(child)))
@@ -1644,12 +1643,7 @@
 		if (non_toplevel_tree_dlid && !strcmp(non_toplevel_tree_dlid, uuid))
 			continue;
 
-		dm_tree_set_cookie(root, 0);
-		r = dm_tree_deactivate_children(root, uuid, strlen(uuid));
-		if (!dm_udev_wait(dm_tree_get_cookie(root)))
-			stack;
-
-		if (!r)
+		if (!dm_tree_deactivate_children(root, uuid, strlen(uuid)))
 			return_0;
 	}
 
@@ -1669,9 +1663,12 @@
 
 	if (!(root = dm_tree_find_node(dtree, 0, 0))) {
 		log_error("Lost dependency tree root node");
-		goto out;
+		goto out_no_root;
 	}
 
+	/* Restore fs cookie */
+	dm_tree_set_cookie(root, fs_get_cookie());
+
 	if (!(dlid = build_dm_uuid(dm->mem, lv->lvid.s, origin_only ? "real" : NULL)))
 		goto_out;
 
@@ -1684,10 +1681,7 @@
 		break;
 	case DEACTIVATE:
  		/* Deactivate LV and all devices it references that nothing else has open. */
-		dm_tree_set_cookie(root, 0);
 		r = dm_tree_deactivate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1);
-		if (!dm_udev_wait(dm_tree_get_cookie(root)))
-			stack;
 		if (!r)
 			goto_out;
 		if (!_remove_lv_symlinks(dm, root))
@@ -1708,10 +1702,7 @@
 			goto_out;
 
 		/* Preload any devices required before any suspensions */
-		dm_tree_set_cookie(root, 0);
 		r = dm_tree_preload_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1);
-		if (!dm_udev_wait(dm_tree_get_cookie(root)))
-			stack;
 		if (!r)
 			goto_out;
 
@@ -1719,10 +1710,7 @@
 			dm->flush_required = 1;
 
 		if (action == ACTIVATE) {
-			dm_tree_set_cookie(root, 0);
 			r = dm_tree_activate_children(root, dlid, ID_LEN + sizeof(UUID_PREFIX) - 1);
-			if (!dm_udev_wait(dm_tree_get_cookie(root)))
-				stack;
 			if (!r)
 				goto_out;
 			if (!_create_lv_symlinks(dm, root)) {
@@ -1740,6 +1728,9 @@
 	r = 1;
 
 out:
+	/* Save fs cookie for udev settle, do not wait here */
+	fs_set_cookie(dm_tree_get_cookie(root));
+out_no_root:
 	dm_tree_free(dtree);
 
 	return r;
--- LVM2/lib/activate/fs.c	2011/01/10 13:44:39	1.54
+++ LVM2/lib/activate/fs.c	2011/01/10 14:02:31	1.55
@@ -15,6 +15,7 @@
 
 #include "lib.h"
 #include "fs.h"
+#include "activate.h"
 #include "toolcontext.h"
 #include "lvm-string.h"
 #include "lvm-file.h"
--- LVM2/lib/activate/fs.h	2011/01/10 13:44:39	1.15
+++ LVM2/lib/activate/fs.h	2011/01/10 14:02:31	1.16
@@ -29,7 +29,7 @@
 		     const char *lv_name, int check_udev);
 int fs_rename_lv(struct logical_volume *lv, const char *dev, 
 		 const char *old_vgname, const char *old_lvname);
-void fs_unlock(void);
+/* void fs_unlock(void);  moved to activate.h */
 uint32_t fs_get_cookie(void);
 void fs_set_cookie(uint32_t cookie);
 
--- LVM2/lib/locking/file_locking.c	2011/01/05 15:10:30	1.52
+++ LVM2/lib/locking/file_locking.c	2011/01/10 14:02:31	1.53
@@ -215,6 +215,7 @@
 		state = 'W';
 		break;
 	case LCK_UNLOCK:
+		fs_unlock(); /* Wait until devices are available */
 		return _release_lock(file, 1);
 	default:
 		log_error("Unrecognised lock type: %d", flags & LCK_TYPE_MASK);
--- LVM2/lib/metadata/lv_manip.c	2010/12/20 14:38:22	1.241
+++ LVM2/lib/metadata/lv_manip.c	2011/01/10 14:02:31	1.242
@@ -3022,6 +3022,8 @@
 		return 0;
 	}
 
+	fs_unlock();  /* Wait until devices are available */
+
 	log_verbose("Clearing start of logical volume \"%s\"", lv->name);
 
 	if (!(dev = dev_cache_get(name, NULL))) {


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2010-06-17 12:48 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2010-06-17 12:48 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-06-17 12:48:55

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c clvmd-gulm.c clvmd-gulm.h 
	                 lvm-functions.c 
	lib/locking    : locking.h 

Log message:
	Clean up cluster lock mode and flags definition.
	
	Code is mixing up internal DLM and LVM definitions of lock
	modes and flags.
	
	OpenAIS and singlenode locking do not depend on DLM but
	code currently cannot be compiled without libdlm.h!
	
	LCK_* flags is LVM abstraction, used through all the code.
	Only low-level backend (clvmd-cman etc) should use DLM definitions,
	also this code should do all needed conversions.
	
	Because there are two DLM flags used in generic code
	(NOQUEUE, CONVERT) we define it similar way like lock modes.
	(So all needed binary-compatible flags are on one place in locking.h)
	
	(Further code cleaning still needed, though:-)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1615&r2=1.1616
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.56&r2=1.57

--- LVM2/WHATS_NEW	2010/06/17 12:14:43	1.1615
+++ LVM2/WHATS_NEW	2010/06/17 12:48:54	1.1616
@@ -1,5 +1,6 @@
 Version 2.02.68 -
 ===============================
+  Do not use internal DLM lock definitions in generic LVM2 clvmd code.
   Add dmeventd man page.
   Update lvresize/extend/reduce manpages with --nofsck, --resizefs options.
   Fix lvm2cmd example in documentation.
--- LVM2/daemons/clvmd/clvmd-command.c	2010/06/15 11:00:45	1.37
+++ LVM2/daemons/clvmd/clvmd-command.c	2010/06/17 12:48:55	1.38
@@ -69,7 +69,6 @@
 #include <unistd.h>
 #include <errno.h>
 #include "libdevmapper.h"
-#include <libdlm.h>
 
 #include "locking.h"
 #include "lvm-logging.h"
@@ -239,7 +238,7 @@
 	/* Read locks need to be PR; other modes get passed through */
 	if (lock_mode == LCK_READ)
 	    lock_mode = LCK_PREAD;
-	status = sync_lock(lockname, lock_mode, (lock_cmd & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
+	status = sync_lock(lockname, lock_mode, (lock_cmd & LCK_NONBLOCK) ? LCKF_NOQUEUE : 0, &lkid);
 	if (status)
 	    status = errno;
 	else
@@ -266,7 +265,7 @@
 
 	switch (header->cmd) {
 	case CLVMD_CMD_TEST:
-		status = sync_lock("CLVMD_TEST", LKM_EXMODE, 0, &lockid);
+		status = sync_lock("CLVMD_TEST", LCK_EXCL, 0, &lockid);
 		client->bits.localsock.private = (void *)(long)lockid;
 		break;
 
--- LVM2/daemons/clvmd/clvmd-gulm.c	2010/06/15 11:00:45	1.29
+++ LVM2/daemons/clvmd/clvmd-gulm.c	2010/06/17 12:48:55	1.30
@@ -739,7 +739,7 @@
     pthread_mutex_lock(&lwait.mutex);
 
     /* This needs to be converted from DLM/LVM2 value for GULM */
-    if (flags & LKF_NOQUEUE) flags = lg_lock_flag_Try;
+    if (flags & LCKF_NOQUEUE) flags = lg_lock_flag_Try;
 
     dm_hash_insert(lock_hash, resource, &lwait);
     DEBUGLOG("lock_resource '%s', flags=%d, mode=%d\n", resource, flags, mode);
--- LVM2/daemons/clvmd/clvmd-gulm.h	2007/07/24 15:35:11	1.4
+++ LVM2/daemons/clvmd/clvmd-gulm.h	2010/06/17 12:48:55	1.5
@@ -1,7 +1,3 @@
-
-/* DLM constant that clvmd uses as a generic NONBLOCK lock flag */
-#define LKF_NOQUEUE 1
-
 extern int get_next_node_csid(void **context, char *csid);
 extern void add_down_node(char *csid);
 extern int gulm_fd(void);
--- LVM2/daemons/clvmd/lvm-functions.c	2010/06/15 11:00:45	1.92
+++ LVM2/daemons/clvmd/lvm-functions.c	2010/06/17 12:48:55	1.93
@@ -35,7 +35,6 @@
 #include <syslog.h>
 #include <assert.h>
 #include "libdevmapper.h"
-#include <libdlm.h>
 
 #include "lvm-types.h"
 #include "clvm.h"
@@ -243,7 +242,7 @@
 	struct lv_info *lvi;
 
 	/* Mask off invalid options */
-	flags &= LKF_NOQUEUE | LKF_CONVERT;
+	flags &= LCKF_NOQUEUE | LCKF_CONVERT;
 
 	lvi = lookup_info(resource);
 
@@ -253,7 +252,7 @@
 	}
 
 	/* Only allow explicit conversions */
-	if (lvi && !(flags & LKF_CONVERT)) {
+	if (lvi && !(flags & LCKF_CONVERT)) {
 		errno = EBUSY;
 		return -1;
 	}
@@ -276,7 +275,7 @@
 			return -1;
 
 		lvi->lock_mode = mode;
-		status = sync_lock(resource, mode, flags & ~LKF_CONVERT, &lvi->lock_id);
+		status = sync_lock(resource, mode, flags & ~LCKF_CONVERT, &lvi->lock_id);
 		saved_errno = errno;
 		if (status) {
 			free(lvi);
@@ -346,9 +345,9 @@
 		return 0;	/* Success, we did nothing! */
 
 	/* Do we need to activate exclusively? */
-	if ((activate_lv == 2) || (mode == LKM_EXMODE)) {
+	if ((activate_lv == 2) || (mode == LCK_EXCL)) {
 		exclusive = 1;
-		mode = LKM_EXMODE;
+		mode = LCK_EXCL;
 	}
 
 	/*
@@ -357,7 +356,7 @@
 	 * of exclusive lock to shared one during activation.
 	 */
 	if (lock_flags & LCK_CLUSTER_VG) {
-		status = hold_lock(resource, mode, LKF_NOQUEUE | (lock_flags & LCK_CONVERT?LKF_CONVERT:0));
+		status = hold_lock(resource, mode, LCKF_NOQUEUE | (lock_flags & LCK_CONVERT ? LCKF_CONVERT:0));
 		if (status) {
 			/* Return an LVM-sensible error for this.
 			 * Forcing EIO makes the upper level return this text
@@ -465,12 +464,11 @@
 
 	mode = get_current_lock(resource);
 	switch (mode) {
-		case LKM_NLMODE: type = "NL"; break;
-		case LKM_CRMODE: type = "CR"; break;
-		case LKM_CWMODE: type = "CW"; break;
-		case LKM_PRMODE: type = "PR"; break;
-		case LKM_PWMODE: type = "PW"; break;
-		case LKM_EXMODE: type = "EX"; break;
+		case LCK_NULL: type = "NL"; break;
+		case LCK_READ: type = "CR"; break;
+		case LCK_PREAD:type = "PR"; break;
+		case LCK_WRITE:type = "PW"; break;
+		case LCK_EXCL: type = "EX"; break;
 	}
 
 	DEBUGLOG("do_lock_query: resource '%s', mode %i (%s)\n", resource, mode, type ?: "?");
@@ -511,7 +509,7 @@
 
 	switch (command & LCK_MASK) {
 	case LCK_LV_EXCLUSIVE:
-		status = do_activate_lv(resource, lock_flags, LKM_EXMODE);
+		status = do_activate_lv(resource, lock_flags, LCK_EXCL);
 		break;
 
 	case LCK_LV_SUSPEND:
@@ -528,7 +526,7 @@
 		break;
 
 	case LCK_LV_ACTIVATE:
-		status = do_activate_lv(resource, lock_flags, LKM_CRMODE);
+		status = do_activate_lv(resource, lock_flags, LCK_READ);
 		break;
 
 	case LCK_LV_DEACTIVATE:
@@ -560,14 +558,14 @@
 	/* Nearly all the stuff happens cluster-wide. Apart from SUSPEND. Here we get the
 	   lock out on this node (because we are the node modifying the metadata)
 	   before suspending cluster-wide.
-	   LKF_CONVERT is used always, local node is going to modify metadata
+	   LCKF_CONVERT is used always, local node is going to modify metadata
 	 */
 	if ((command & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_SUSPEND &&
 	    (lock_flags & LCK_CLUSTER_VG)) {
 		DEBUGLOG("pre_lock_lv: resource '%s', cmd = %s, flags = %s\n",
 			 resource, decode_locking_cmd(command), decode_flags(lock_flags));
 
-		if (hold_lock(resource, LKM_PWMODE, LKF_NOQUEUE | LKF_CONVERT))
+		if (hold_lock(resource, LCK_WRITE, LCKF_NOQUEUE | LCKF_CONVERT))
 			return errno;
 	}
 	return 0;
@@ -590,7 +588,7 @@
 
 		/* If the lock state is PW then restore it to what it was */
 		oldmode = get_current_lock(resource);
-		if (oldmode == LKM_PWMODE) {
+		if (oldmode == LCK_WRITE) {
 			struct lvinfo lvi;
 
 			pthread_mutex_lock(&lvm_lock);
@@ -600,7 +598,7 @@
 				return EIO;
 
 			if (lvi.exists) {
-				if (hold_lock(resource, LKM_CRMODE, LKF_CONVERT))
+				if (hold_lock(resource, LCK_READ, LCKF_CONVERT))
 					return errno;
 			} else {
 				if (hold_unlock(resource))
@@ -792,15 +790,15 @@
 				memcpy(&uuid[58], &lv[32], 6);
 				uuid[64] = '\0';
 
-				lock_mode = LKM_CRMODE;
+				lock_mode = LCK_READ;
 
 				/* Look for this lock in the list of EX locks
 				   we were passed on the command-line */
 				if (was_ex_lock(uuid, argv))
-					lock_mode = LKM_EXMODE;
+					lock_mode = LCK_EXCL;
 
 				DEBUGLOG("getting initial lock for %s\n", uuid);
-				hold_lock(uuid, lock_mode, LKF_NOQUEUE);
+				hold_lock(uuid, lock_mode, LCKF_NOQUEUE);
 			}
 		}
 	}
--- LVM2/lib/locking/locking.h	2010/05/21 14:29:49	1.56
+++ LVM2/lib/locking/locking.h	2010/06/17 12:48:55	1.57
@@ -73,6 +73,12 @@
 #define LCK_UNLOCK      0x00000006U	/* This is ours */
 
 /*
+ * Lock flags - these numbers are the same as DLM
+ */
+#define LCKF_NOQUEUE	0x00000001U	/* LKF$_NOQUEUE */
+#define LCKF_CONVERT	0x00000004U	/* LKF$_CONVERT */
+
+/*
  * Lock scope
  */
 #define LCK_SCOPE_MASK	0x00000008U


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2010-06-04 12:59 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2010-06-04 12:59 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-06-04 12:59:31

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

Log message:
	Fix restart of clvmd using -S switch
	
	- allocate environment dynamically (still missing some limit?)
	- try to recover, if destroy failed (do not destroy lvm here) and free memory
	- check strdup() return codes
	- report failure to log
	- do not print NULL in exclusive lock loop

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1606&r2=1.1607
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.90&r2=1.91

--- LVM2/WHATS_NEW	2010/06/03 21:03:53	1.1606
+++ LVM2/WHATS_NEW	2010/06/04 12:59:30	1.1607
@@ -1,5 +1,6 @@
 Version 2.02.67 -
 ===============================
+  Handle failed restart of clvmd using -S switch properly.
   Fix clvmd initscript restart command to start clvmd if not yet running.
   Use absolute paths for clvmd restart.
   Require partial option in lvchange --refresh for partial LVs.
--- LVM2/daemons/clvmd/clvmd-command.c	2010/06/03 13:50:26	1.35
+++ LVM2/daemons/clvmd/clvmd-command.c	2010/06/04 12:59:30	1.36
@@ -361,33 +361,51 @@
 
 static int restart_clvmd(void)
 {
-	char *argv[1024];
-	int argc = 1;
+	char **argv = NULL;
+	char *debug_arg = NULL, *lv_name;
+	int i, argc = 0, max_locks = 0;
 	struct dm_hash_node *hn = NULL;
-	char *lv_name;
 
 	DEBUGLOG("clvmd restart requested\n");
 
+	/* Count exclusively-open LVs */
+	hn = NULL;
+	do {
+		hn = get_next_excl_lock(hn, &lv_name);
+		if (lv_name)
+			max_locks++;
+	} while (hn && *lv_name);
+
+	/* clvmd + locks (-E uuid) + debug (-d X) + NULL */
+	argv = malloc((max_locks * 2 + 4) * sizeof(*argv));
+	if (!argv)
+		goto_out;
+
 	/*
 	 * Build the command-line
 	 */
-	/* FIXME missing strdup error checks */
-	argv[0] = strdup("clvmd");
+	argv[argc++] = strdup("clvmd");
+	if (!argv[0])
+		goto_out;
 
 	/* Propogate debug options */
 	if (debug) {
-		char debug_level[16];
-
-		sprintf(debug_level, "-d%d", debug);
-		argv[argc++] = strdup(debug_level);
+		if (!(debug_arg = malloc(16)) ||
+		    snprintf(debug_arg, 16, "-d%d", (int)debug) < 0)
+			goto_out;
+		argv[argc++] = debug_arg;
 	}
 
 	/* Now add the exclusively-open LVs */
 	do {
 		hn = get_next_excl_lock(hn, &lv_name);
 		if (lv_name) {
-			argv[argc++] = strdup("-E");
-			argv[argc++] = strdup(lv_name);
+			argv[argc] = strdup("-E");
+			if (!argv[argc++])
+				goto_out;
+			argv[argc] = strdup(lv_name);
+			if (!argv[argc++])
+				goto_out;
 
 			DEBUGLOG("excl lock: %s\n", lv_name);
 			hn = get_next_excl_lock(hn, &lv_name);
@@ -395,13 +413,16 @@
 	} while (hn && *lv_name);
 	argv[argc++] = NULL;
 
-	/* Tidy up */
-	destroy_lvm();
-
 	/* Exec new clvmd */
 	/* NOTE: This will fail when downgrading! */
 	execve(CLVMD_PATH, argv, NULL);
-
+out:
 	/* We failed */
+	DEBUGLOG("Restart of clvmd failed.\n");
+
+	for (i = 0; i < argc && argv[i]; i++)
+		free(argv[i]);
+	free(argv);
+
 	return 0;
 }
--- LVM2/daemons/clvmd/lvm-functions.c	2010/06/03 13:50:26	1.90
+++ LVM2/daemons/clvmd/lvm-functions.c	2010/06/04 12:59:30	1.91
@@ -898,7 +898,9 @@
 			v = dm_hash_get_next(lv_hash, v);
 		}
 	} while (v && !*name);
-	DEBUGLOG("returning EXclusive UUID %s\n", *name);
+
+	if (*name)
+		DEBUGLOG("returning EXclusive UUID %s\n", *name);
 	return v;
 }
 


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2010-01-05 16:07 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2010-01-05 16:07 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-01-05 16:07:57

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	lib/locking    : cluster_locking.c 

Log message:
	Proper mask lock mode for vg lock.
	
	Lock mode is int masked by LCK_TYPE_MASK, always.
	
	Patch also remove uneccessary masking lock flag on sender side,
	if masking is needed, it is don on client side already.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1359&r2=1.1360
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40

--- LVM2/WHATS_NEW	2010/01/05 16:06:42	1.1359
+++ LVM2/WHATS_NEW	2010/01/05 16:07:56	1.1360
@@ -1,5 +1,6 @@
 Version 2.02.57 -
 ====================================
+  Use proper mask for VG lock mode in clvmd.
   Add possibility to drop precommitted metadata in lvmcache.
   Move processing of VG locks to separate function in clvmd.
   Properly decode flags even for VG locks.
--- LVM2/daemons/clvmd/clvmd-command.c	2010/01/05 16:05:12	1.30
+++ LVM2/daemons/clvmd/clvmd-command.c	2010/01/05 16:07:57	1.31
@@ -193,6 +193,7 @@
 	(struct clvm_header *) client->bits.localsock.cmd;
     unsigned char lock_cmd;
     unsigned char lock_flags;
+    int lock_mode;
     char *args = header->node + strlen(header->node) + 1;
     int lkid;
     int status = 0;
@@ -212,11 +213,12 @@
     }
 
     lock_cmd = args[0] & (LCK_NONBLOCK | LCK_HOLD | LCK_SCOPE_MASK | LCK_TYPE_MASK);
+    lock_mode = ((int)lock_cmd & LCK_TYPE_MASK);
     lock_flags = args[1];
     lockname = &args[2];
     DEBUGLOG("doing PRE command LOCK_VG '%s' at %x (client=%p)\n", lockname, lock_cmd, client);
 
-    if (lock_cmd == LCK_UNLOCK) {
+    if (lock_mode == LCK_UNLOCK) {
 
 	lkid = (int)(long)dm_hash_lookup(lock_hash, lockname);
 	if (lkid == 0)
@@ -230,11 +232,9 @@
     }
     else {
 	/* Read locks need to be PR; other modes get passed through */
-	if ((lock_cmd & LCK_TYPE_MASK) == LCK_READ) {
-	    lock_cmd &= ~LCK_TYPE_MASK;
-	    lock_cmd |= LCK_PREAD;
-	}
-	status = sync_lock(lockname, (int)lock_cmd, (lock_cmd & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
+	if (lock_mode == LCK_READ)
+	    lock_mode = LCK_PREAD;
+	status = sync_lock(lockname, lock_mode, (lock_cmd & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
 	if (status)
 	    status = errno;
 	else
--- LVM2/lib/locking/cluster_locking.c	2010/01/05 16:03:37	1.39
+++ LVM2/lib/locking/cluster_locking.c	2010/01/05 16:07:57	1.40
@@ -409,7 +409,6 @@
 
 		lock_scope = "VG";
 		clvmd_cmd = CLVMD_CMD_LOCK_VG;
-		flags &= LCK_TYPE_MASK;
 		break;
 
 	case LCK_LV:


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2010-01-05 16:05 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2010-01-05 16:05 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2010-01-05 16:05:12

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c lvm-functions.c lvm-functions.h 

Log message:
	Move processing of VG locks to separate function (similar to LV locks).
	
	And print some debugging info.
	
	No functional change in this patch.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1357&r2=1.1358
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.79&r2=1.80
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.h.diff?cvsroot=lvm2&r1=1.11&r2=1.12

--- LVM2/WHATS_NEW	2010/01/05 16:03:37	1.1357
+++ LVM2/WHATS_NEW	2010/01/05 16:05:12	1.1358
@@ -1,5 +1,6 @@
 Version 2.02.57 -
 ====================================
+  Move processing of VG locks to separate function in clvmd.
   Properly decode flags even for VG locks.
   Properly handle precommitted flag in cache when commited data only present.
   Resume renamed volumes in reverse order to preserve memlock pairing.
--- LVM2/daemons/clvmd/clvmd-command.c	2009/12/09 18:42:03	1.29
+++ LVM2/daemons/clvmd/clvmd-command.c	2010/01/05 16:05:12	1.30
@@ -119,15 +119,12 @@
 		break;
 
 	case CLVMD_CMD_LOCK_VG:
+		lock_cmd = args[0];
+		lock_flags = args[1];
 		lockname = &args[2];
 		/* Check to see if the VG is in use by LVM1 */
 		status = do_check_lvm1(lockname);
-		/* P_#global causes a full cache refresh */
-		if (!strcmp(lockname, "P_" VG_GLOBAL))
-			do_refresh_cache();
-		else
-			drop_metadata(lockname + 2);
-
+		do_lock_vg(lock_cmd, lock_flags, lockname);
 		break;
 
 	case CLVMD_CMD_LOCK_LV:
--- LVM2/daemons/clvmd/lvm-functions.c	2010/01/05 16:03:37	1.79
+++ LVM2/daemons/clvmd/lvm-functions.c	2010/01/05 16:05:12	1.80
@@ -676,12 +676,23 @@
 }
 
 /*
- * Drop lvmcache metadata
+ * Handle VG lock - drop metadata or update lvmcache state
  */
-void drop_metadata(const char *vgname)
+void do_lock_vg(unsigned char command, unsigned char lock_flags, char *resource)
 {
-	DEBUGLOG("Dropping metadata for VG %s\n", vgname);
+	char *vgname = resource + 2;
+
+	DEBUGLOG("do_lock_vg: resource '%s', cmd = %s, flags = %s, memlock = %d\n",
+		 resource, decode_locking_cmd(command), decode_flags(lock_flags), memlock());
+
+	/* P_#global causes a full cache refresh */
+	if (!strcmp(resource, "P_" VG_GLOBAL)) {
+		do_refresh_cache();
+		return;
+	}
+
 	pthread_mutex_lock(&lvm_lock);
+	DEBUGLOG("Dropping metadata for VG %s\n", vgname);
 	lvmcache_drop_metadata(vgname);
 	pthread_mutex_unlock(&lvm_lock);
 }
--- LVM2/daemons/clvmd/lvm-functions.h	2009/06/15 12:15:23	1.11
+++ LVM2/daemons/clvmd/lvm-functions.h	2010/01/05 16:05:12	1.12
@@ -35,6 +35,7 @@
 extern int hold_unlock(char *resource);
 extern int hold_lock(char *resource, int mode, int flags);
 extern char *get_last_lvm_error(void);
-extern void drop_metadata(const char *vgname);
+extern void do_lock_vg(unsigned char command, unsigned char lock_flags,
+		      char *resource);
 
 #endif


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2009-12-09 18:42 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2009-12-09 18:42 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-12-09 18:42:03

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

Log message:
	Get rid of magic masks in cluster locking code - clvmd part.
	
	- do_command and lock_vg expect flags (no change here)
	
	Bug fixes:
	- lock_vg should check for NONBLOCK on lock_cmd, flags have this bit masked-out
	
	- do_pre/post_command expect do not mask flag at all, this causes that
	the code inside is never run! (see following patches, these functions
	expect plain command without flags)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1343&r2=1.1344
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.72&r2=1.73

--- LVM2/WHATS_NEW	2009/12/09 18:09:52	1.1343
+++ LVM2/WHATS_NEW	2009/12/09 18:42:02	1.1344
@@ -1,5 +1,6 @@
 Version 2.02.57 -
 ====================================
+  Replace magic masks in cluster locking code by defined masks.
   Remove log volume from metadata if initial deactivation fails.
   Give better error message for pvmove when all data is skipped.
   Fix memory lock imbalance in lv_suspend if already suspended.
--- LVM2/daemons/clvmd/clvmd-command.c	2009/05/19 10:39:00	1.28
+++ LVM2/daemons/clvmd/clvmd-command.c	2009/12/09 18:42:03	1.29
@@ -132,7 +132,7 @@
 
 	case CLVMD_CMD_LOCK_LV:
 		/* This is the biggie */
-		lock_cmd = args[0] & 0x3F;
+		lock_cmd = args[0] & (LCK_NONBLOCK | LCK_HOLD | LCK_SCOPE_MASK | LCK_TYPE_MASK);
 		lock_flags = args[1];
 		lockname = &args[2];
 		status = do_lock_lv(lock_cmd, lock_flags, lockname);
@@ -214,7 +214,7 @@
 	client->bits.localsock.private = (void *)lock_hash;
     }
 
-    lock_cmd = args[0] & 0x3F;
+    lock_cmd = args[0] & (LCK_NONBLOCK | LCK_HOLD | LCK_SCOPE_MASK | LCK_TYPE_MASK);
     lock_flags = args[1];
     lockname = &args[2];
     DEBUGLOG("doing PRE command LOCK_VG '%s' at %x (client=%p)\n", lockname, lock_cmd, client);
@@ -237,7 +237,7 @@
 	    lock_cmd &= ~LCK_TYPE_MASK;
 	    lock_cmd |= LCK_PREAD;
 	}
-	status = sync_lock(lockname, (int)lock_cmd, (lock_flags & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
+	status = sync_lock(lockname, (int)lock_cmd, (lock_cmd & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
 	if (status)
 	    status = errno;
 	else
--- LVM2/daemons/clvmd/lvm-functions.c	2009/11/23 10:44:51	1.72
+++ LVM2/daemons/clvmd/lvm-functions.c	2009/12/09 18:42:03	1.73
@@ -542,7 +542,7 @@
 	   lock out on this node (because we are the node modifying the metadata)
 	   before suspending cluster-wide.
 	 */
-	if (command == LCK_LV_SUSPEND) {
+	if ((command & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_SUSPEND) {
 		DEBUGLOG("pre_lock_lv: resource '%s', cmd = %s, flags = %s\n",
 			 resource, decode_locking_cmd(command), decode_flags(lock_flags));
 
@@ -559,7 +559,7 @@
 	int status;
 
 	/* Opposite of above, done on resume after a metadata update */
-	if (command == LCK_LV_RESUME) {
+	if ((command & (LCK_SCOPE_MASK | LCK_TYPE_MASK)) == LCK_LV_RESUME) {
 		int oldmode;
 
 		DEBUGLOG


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2009-04-22  9:40 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2009-04-22  9:40 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2009-04-22 09:39:46

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	lib/format_text: archiver.c archiver.h 
	lib/locking    : cluster_locking.c locking.h 

Log message:
	Fix remote metadata backup for clvmd
	
	Run backup of metadata on remote nodes in the
	same place like local node - when calling backup().
	
	Introduce backup_locally() which calls only
	local backup if needed.
	
	Remote backup is now trigerred by LCK_VG_BACKUP flag
	combination (special VG lock).
	
	This lock type will call check_current_backup()
	(including backup_locally() call) and updates
	metadata on all nodes.
	
	(Patch fixes non-functional remote backup,
	current call during VG lock never triggers.)

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1092&r2=1.1093
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.h.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.44&r2=1.45

--- LVM2/WHATS_NEW	2009/04/22 09:31:30	1.1092
+++ LVM2/WHATS_NEW	2009/04/22 09:39:45	1.1093
@@ -1,5 +1,6 @@
 Version 2.02.46 - 
 ================================
+  Fix remote metadata backup for clvmd.
   Alloc PV internal structure from VG mempool if possible.
   Fix metadata backup to run after vg_commit always.
   Tidy clvmd volume lock cache functions.
--- LVM2/daemons/clvmd/clvmd-command.c	2008/11/04 16:41:47	1.26
+++ LVM2/daemons/clvmd/clvmd-command.c	2009/04/22 09:39:45	1.27
@@ -159,7 +159,11 @@
 		break;
 
 	case CLVMD_CMD_VG_BACKUP:
-		lvm_do_backup(&args[2]);
+		/*
+		 * Do not run backup on local node, caller should do that.
+		 */
+		if (!client)
+			lvm_do_backup(&args[2]);
 		break;
 
 	default:
--- LVM2/lib/format_text/archiver.c	2009/04/10 10:00:37	1.23
+++ LVM2/lib/format_text/archiver.c	2009/04/22 09:39:46	1.24
@@ -20,6 +20,7 @@
 #include "lvm-string.h"
 #include "lvmcache.h"
 #include "toolcontext.h"
+#include "locking.h"
 
 #include <unistd.h>
 
@@ -202,7 +203,7 @@
 	return backup_to_file(name, desc, vg);
 }
 
-int backup(struct volume_group *vg)
+int backup_locally(struct volume_group *vg)
 {
 	if (!vg->cmd->backup_params->enabled || !vg->cmd->backup_params->dir) {
 		log_warn("WARNING: This metadata update is NOT backed up");
@@ -231,6 +232,14 @@
 	return 1;
 }
 
+int backup(struct volume_group *vg)
+{
+	if (vg_is_clustered(vg))
+		remote_backup_metadata(vg);
+
+	return backup_locally(vg);
+}
+
 int backup_remove(struct cmd_context *cmd, const char *vg_name)
 {
 	char path[PATH_MAX];
@@ -426,5 +435,5 @@
 		vg_release(vg_backup);
 	}
 	archive(vg);
-	backup(vg);
+	backup_locally(vg);
 }
--- LVM2/lib/format_text/archiver.h	2008/12/11 03:33:35	1.6
+++ LVM2/lib/format_text/archiver.h	2009/04/22 09:39:46	1.7
@@ -46,6 +46,7 @@
 
 void backup_enable(struct cmd_context *cmd, int flag);
 int backup(struct volume_group *vg);
+int backup_locally(struct volume_group *vg);
 int backup_remove(struct cmd_context *cmd, const char *vg_name);
 
 struct volume_group *backup_read_vg(struct cmd_context *cmd,
--- LVM2/lib/locking/cluster_locking.c	2008/12/16 12:30:39	1.32
+++ LVM2/lib/locking/cluster_locking.c	2009/04/22 09:39:46	1.33
@@ -385,6 +385,13 @@
 
 	switch (flags & LCK_SCOPE_MASK) {
 	case LCK_VG:
+		if (flags == LCK_VG_BACKUP) {
+			log_very_verbose("Requesting backup of VG metadata for %s",
+					 resource);
+			return _lock_for_cluster(CLVMD_CMD_VG_BACKUP,
+						 LCK_CLUSTER_VG, resource);
+		}
+
 		/* If the VG name is empty then lock the unused PVs */
 		if (*resource == '#' || (flags & LCK_CACHE))
 			dm_snprintf(lockname, sizeof(lockname), "P_%s",
@@ -436,14 +443,6 @@
 		return 0;
 	}
 
-	/* If we are unlocking a clustered VG, then trigger remote metadata backups */
-	if (clvmd_cmd == CLVMD_CMD_LOCK_VG &&
-	    ((flags & LCK_TYPE_MASK) == LCK_UNLOCK) &&
-	    (flags & LCK_CLUSTER_VG)) {
-		log_very_verbose("Requesing backup of VG metadata for %s", resource);
-		_lock_for_cluster(CLVMD_CMD_VG_BACKUP, LCK_CLUSTER_VG, resource);
-	}
-
 	log_very_verbose("Locking %s %s %s %s%s%s%s (0x%x)", lock_scope, lockname,
 			 lock_type,
 			 flags & LCK_NONBLOCK ? "" : "B",
--- LVM2/lib/locking/locking.h	2009/04/10 09:59:19	1.44
+++ LVM2/lib/locking/locking.h	2009/04/22 09:39:46	1.45
@@ -101,6 +101,7 @@
 #define LCK_VG_WRITE		(LCK_VG | LCK_WRITE | LCK_HOLD)
 #define LCK_VG_UNLOCK		(LCK_VG | LCK_UNLOCK)
 #define LCK_VG_DROP_CACHE	(LCK_VG | LCK_WRITE | LCK_CACHE)
+#define LCK_VG_BACKUP		(LCK_VG | LCK_CACHE)
 
 #define LCK_LV_EXCLUSIVE	(LCK_LV | LCK_EXCL | LCK_NONBLOCK)
 #define LCK_LV_SUSPEND		(LCK_LV | LCK_WRITE | LCK_NONBLOCK)
@@ -131,6 +132,8 @@
 	lock_lv_vol(cmd, lv, LCK_LV_DEACTIVATE | LCK_LOCAL)
 #define drop_cached_metadata(vg)	\
 	lock_vol((vg)->cmd, (vg)->name, LCK_VG_DROP_CACHE)
+#define remote_backup_metadata(vg)	\
+	lock_vol((vg)->cmd, (vg)->name, LCK_VG_BACKUP)
 
 /* Process list of LVs */
 int suspend_lvs(struct cmd_context *cmd, struct dm_list *lvs);


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2008-05-09 18:45 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2008-05-09 18:45 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-05-09 18:45:15

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c lvm-functions.c 
	lib/cache      : lvmcache.c 
	lib/locking    : cluster_locking.c file_locking.c locking.c 

Log message:
	More P_ and V_ lock cleanup.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.873&r2=1.874
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.40&r2=1.41
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49

--- LVM2/WHATS_NEW	2008/05/09 15:13:20	1.873
+++ LVM2/WHATS_NEW	2008/05/09 18:45:14	1.874
@@ -6,6 +6,7 @@
 
 Version 2.02.37 - 
 =================================
+  Add assertions to trap deprecated P_ and V_ lock usage.
   Add missing mutex around clvmd lvmcache_drop_metadata library call.
   Fix uninitialised mutex in clvmd if all daemons are not running at startup.
   Avoid using DLM locks with LCK_CACHE type P_ lock requests.
--- LVM2/daemons/clvmd/clvmd-command.c	2008/05/09 15:13:20	1.22
+++ LVM2/daemons/clvmd/clvmd-command.c	2008/05/09 18:45:14	1.23
@@ -118,10 +118,10 @@
 		lockname = &args[2];
 		/* Check to see if the VG is in use by LVM1 */
 		status = do_check_lvm1(lockname);
-		/* P_#global causes a cache refresh */
-		if (strcmp(lockname, "P_#global") == 0)
-		      do_refresh_cache();
-		else if (strncmp(lockname, "P_", 2) == 0)
+		/* P_#global causes a full cache refresh */
+		if (!strcmp(lockname, "P_#global"))
+			do_refresh_cache();
+		else
 			drop_metadata(lockname + 2);
 
 		break;
@@ -254,9 +254,9 @@
 
 	case CLVMD_CMD_LOCK_VG:
 		lockname = &args[2];
-		/* Do not use lock for cache related commands */
+		/* We take out a real lock unless LCK_CACHE was set */
 		if (!strncmp(lockname, "V_", 2) ||
-		    !strcmp(lockname, "P_#global"))
+		    !strncmp(lockname, "P_#", 3))
 			status = lock_vg(client);
 		break;
 
--- LVM2/daemons/clvmd/lvm-functions.c	2008/05/09 15:13:20	1.40
+++ LVM2/daemons/clvmd/lvm-functions.c	2008/05/09 18:45:14	1.41
@@ -472,7 +472,8 @@
 	    popen
 	    ("lvm pvs  --config 'log{command_names=0 prefix=\"\"}' --nolocking --noheadings -o vg_name", "r");
 
-	sync_unlock("P_orphans", LCK_EXCL);
+	sync_unlock("P_#orphans", LCK_EXCL);
+	sync_unlock("P_#global", LCK_EXCL);
 
 	if (!vgs)
 		return;
--- LVM2/lib/cache/lvmcache.c	2008/05/09 15:13:20	1.49
+++ LVM2/lib/cache/lvmcache.c	2008/05/09 18:45:14	1.50
@@ -162,6 +162,9 @@
 		_drop_metadata(FMT_TEXT_ORPHAN_VG_NAME);
 		_drop_metadata(FMT_LVM1_ORPHAN_VG_NAME);
 		_drop_metadata(FMT_POOL_ORPHAN_VG_NAME);
+
+		/* Indicate that PVs could now be missing from the cache */
+		init_full_scan_done(0);
 	} else
 		_drop_metadata(vgname);
 }
--- LVM2/lib/locking/cluster_locking.c	2008/04/15 14:46:19	1.28
+++ LVM2/lib/locking/cluster_locking.c	2008/05/09 18:45:15	1.29
@@ -387,13 +387,12 @@
 	switch (flags & LCK_SCOPE_MASK) {
 	case LCK_VG:
 		/* If the VG name is empty then lock the unused PVs */
-		if (!*resource)	/* FIXME Deprecated */
-			dm_snprintf(lockname, sizeof(lockname), "P_orphans");
-		else if (*resource == '#' || (flags & LCK_CACHE))
-			dm_snprintf(lockname, sizeof(lockname), "P_%s", resource);
+		if (*resource == '#' || (flags & LCK_CACHE))
+			dm_snprintf(lockname, sizeof(lockname), "P_%s",
+				    resource);
 		else
 			dm_snprintf(lockname, sizeof(lockname), "V_%s",
-				     resource);
+				    resource);
 
 		lock_scope = "VG";
 		cluster_cmd = CLVMD_CMD_LOCK_VG;
--- LVM2/lib/locking/file_locking.c	2008/04/15 14:46:19	1.37
+++ LVM2/lib/locking/file_locking.c	2008/05/09 18:45:15	1.38
@@ -214,10 +214,7 @@
 			lvmcache_drop_metadata(resource);
 			break;
 		}
-		if (!*resource)	/* FIXME Deprecated */
-			dm_snprintf(lockfile, sizeof(lockfile),
-				     "%s/P_orphans", _lock_dir);
-		else if (*resource == '#')
+		if (*resource == '#')
 			dm_snprintf(lockfile, sizeof(lockfile),
 				     "%s/P_%s", _lock_dir, resource + 1);
 		else
--- LVM2/lib/locking/locking.c	2008/05/08 18:35:58	1.48
+++ LVM2/lib/locking/locking.c	2008/05/09 18:45:15	1.49
@@ -323,6 +323,16 @@
 
 	assert(resource);
 
+	if (!*resource) {
+		log_error("Internal error: Use of P_orphans is deprecated.");
+		return 0;
+	}
+
+	if (*resource == '#' && (flags & LCK_CACHE)) {
+		log_error("Internal error: P_%s referenced", resource);
+		return 0;
+	}
+
 	if ((ret = _locking.lock_resource(cmd, resource, flags))) {
 		if ((flags & LCK_SCOPE_MASK) == LCK_VG &&
 		    !(flags & LCK_CACHE)) {


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2008-05-09 15:13 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2008-05-09 15:13 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-05-09 15:13:20

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c lvm-functions.c lvm-functions.h 
	lib/cache      : lvmcache.c 

Log message:
	Add missing mutex around clvmd lvmcache_drop_metadata library call.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.872&r2=1.873
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.h.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49

--- LVM2/WHATS_NEW	2008/05/09 09:59:39	1.872
+++ LVM2/WHATS_NEW	2008/05/09 15:13:20	1.873
@@ -1,13 +1,14 @@
 Version 2.02.38 - 
 =================================
-  Fix uninitialised mutex in clvmd if all daemons are not running at startup.
   Make clvmd-cman use a hash rather than an array for node updown info.
   Check lv_count in vg_validate.
   Add --prefixes to reporting tools for field name prefix output format.
 
 Version 2.02.37 - 
 =================================
-  Avoid unnecessary unlock attempts with LCK_CACHE pseudo-locks.
+  Add missing mutex around clvmd lvmcache_drop_metadata library call.
+  Fix uninitialised mutex in clvmd if all daemons are not running at startup.
+  Avoid using DLM locks with LCK_CACHE type P_ lock requests.
   When asked to drop cached committed VG metadata, invalidate cached PV labels.
   Drop metadata cache before writing precommitted metadata instead of after.
   Don't touch /dev in vgrename if activation is disabled.
--- LVM2/daemons/clvmd/clvmd-command.c	2008/04/15 14:46:18	1.21
+++ LVM2/daemons/clvmd/clvmd-command.c	2008/05/09 15:13:20	1.22
@@ -122,7 +122,7 @@
 		if (strcmp(lockname, "P_#global") == 0)
 		      do_refresh_cache();
 		else if (strncmp(lockname, "P_", 2) == 0)
-			lvmcache_drop_metadata(lockname + 2);
+			drop_metadata(lockname + 2);
 
 		break;
 
@@ -253,7 +253,11 @@
 		break;
 
 	case CLVMD_CMD_LOCK_VG:
-       	        status = lock_vg(client);
+		lockname = &args[2];
+		/* Do not use lock for cache related commands */
+		if (!strncmp(lockname, "V_", 2) ||
+		    !strcmp(lockname, "P_#global"))
+			status = lock_vg(client);
 		break;
 
 	case CLVMD_CMD_LOCK_LV:
--- LVM2/daemons/clvmd/lvm-functions.c	2008/04/08 13:03:13	1.39
+++ LVM2/daemons/clvmd/lvm-functions.c	2008/05/09 15:13:20	1.40
@@ -500,6 +500,16 @@
 }
 
 /*
+ * Drop lvmcache metadata
+ */
+void drop_metadata(const char *vgname)
+{
+	pthread_mutex_lock(&lvm_lock);
+	lvmcache_drop_metadata(vgname);
+	pthread_mutex_unlock(&lvm_lock);
+}
+
+/*
  * Ideally, clvmd should be started before any LVs are active
  * but this may not be the case...
  * I suppose this also comes in handy if clvmd crashes, not that it would!
--- LVM2/daemons/clvmd/lvm-functions.h	2007/12/05 13:17:18	1.7
+++ LVM2/daemons/clvmd/lvm-functions.h	2008/05/09 15:13:20	1.8
@@ -33,5 +33,6 @@
 extern int hold_lock(char *resource, int mode, int flags);
 extern void unlock_all(void);
 extern char *get_last_lvm_error(void);
+extern void drop_metadata(const char *vgname);
 
 #endif
--- LVM2/lib/cache/lvmcache.c	2008/05/08 18:28:27	1.48
+++ LVM2/lib/cache/lvmcache.c	2008/05/09 15:13:20	1.49
@@ -158,7 +158,7 @@
 void lvmcache_drop_metadata(const char *vgname)
 {
 	/* For VG_ORPHANS, we need to invalidate all labels on orphan PVs. */
-	if (strcmp(vgname, VG_ORPHANS)) {
+	if (!strcmp(vgname, VG_ORPHANS)) {
 		_drop_metadata(FMT_TEXT_ORPHAN_VG_NAME);
 		_drop_metadata(FMT_LVM1_ORPHAN_VG_NAME);
 		_drop_metadata(FMT_POOL_ORPHAN_VG_NAME);


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2008-04-15 14:46 mbroz
  0 siblings, 0 replies; 23+ messages in thread
From: mbroz @ 2008-04-15 14:46 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	mbroz@sourceware.org	2008-04-15 14:46:19

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	lib/cache      : lvmcache.c lvmcache.h 
	lib/locking    : cluster_locking.c file_locking.c locking.c 
	                 locking.h 
	lib/metadata   : metadata.c 

Log message:
	Drop cached VG metadata before and after committing changes to it.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.850&r2=1.851
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.h.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.36&r2=1.37
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.39&r2=1.40
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.170&r2=1.171

--- LVM2/WHATS_NEW	2008/04/15 11:36:46	1.850
+++ LVM2/WHATS_NEW	2008/04/15 14:46:18	1.851
@@ -1,5 +1,6 @@
 Version 2.02.35 - 
 =================================
+  Drop cached VG metadata before and after committing changes to it.
   Rename P_global to P_#global.
   Don't attempt remote metadata backups of non-clustered VGs. (2.02.29)
   Don't store fid in VG metadata cache to avoid clvmd segfault. (2.02.34)
--- LVM2/daemons/clvmd/clvmd-command.c	2008/04/15 11:36:46	1.20
+++ LVM2/daemons/clvmd/clvmd-command.c	2008/04/15 14:46:18	1.21
@@ -121,6 +121,8 @@
 		/* P_#global causes a cache refresh */
 		if (strcmp(lockname, "P_#global") == 0)
 		      do_refresh_cache();
+		else if (strncmp(lockname, "P_", 2) == 0)
+			lvmcache_drop_metadata(lockname + 2);
 
 		break;
 
--- LVM2/lib/cache/lvmcache.c	2008/04/14 19:24:15	1.44
+++ LVM2/lib/cache/lvmcache.c	2008/04/15 14:46:18	1.45
@@ -130,6 +130,16 @@
 	_update_cache_vginfo_lock_state(vginfo, locked);
 }
 
+void lvmcache_drop_metadata(const char *vgname)
+{
+	struct lvmcache_vginfo *vginfo;
+
+	if (!(vginfo = vginfo_from_vgname(vgname, NULL)))
+		return;
+
+	_free_cached_vgmetadata(vginfo);
+}
+
 void lvmcache_lock_vgname(const char *vgname, int read_only __attribute((unused)))
 {
 	if (!_lock_hash && !lvmcache_init()) {
--- LVM2/lib/cache/lvmcache.h	2008/04/14 19:24:16	1.21
+++ LVM2/lib/cache/lvmcache.h	2008/04/15 14:46:18	1.22
@@ -111,5 +111,6 @@
 
 /* Returns cached volume group metadata. */
 struct volume_group *lvmcache_get_vg(const char *vgid, unsigned precommitted);
+void lvmcache_drop_metadata(const char *vgname);
 
 #endif
--- LVM2/lib/locking/cluster_locking.c	2008/04/15 11:36:46	1.27
+++ LVM2/lib/locking/cluster_locking.c	2008/04/15 14:46:19	1.28
@@ -389,7 +389,7 @@
 		/* If the VG name is empty then lock the unused PVs */
 		if (!*resource)	/* FIXME Deprecated */
 			dm_snprintf(lockname, sizeof(lockname), "P_orphans");
-		else if (*resource == '#')
+		else if (*resource == '#' || (flags & LCK_CACHE))
 			dm_snprintf(lockname, sizeof(lockname), "P_%s", resource);
 		else
 			dm_snprintf(lockname, sizeof(lockname), "V_%s",
--- LVM2/lib/locking/file_locking.c	2008/04/07 19:17:29	1.36
+++ LVM2/lib/locking/file_locking.c	2008/04/15 14:46:19	1.37
@@ -21,6 +21,7 @@
 #include "defaults.h"
 #include "lvm-file.h"
 #include "lvm-string.h"
+#include "lvmcache.h"
 
 #include <limits.h>
 #include <unistd.h>
@@ -209,6 +210,10 @@
 
 	switch (flags & LCK_SCOPE_MASK) {
 	case LCK_VG:
+		if (flags & LCK_CACHE) {
+			lvmcache_drop_metadata(resource);
+			break;
+		}
 		if (!*resource)	/* FIXME Deprecated */
 			dm_snprintf(lockfile, sizeof(lockfile),
 				     "%s/P_orphans", _lock_dir);
--- LVM2/lib/locking/locking.c	2008/04/09 12:56:34	1.46
+++ LVM2/lib/locking/locking.c	2008/04/15 14:46:19	1.47
@@ -324,7 +324,8 @@
 	assert(resource);
 
 	if ((ret = _locking.lock_resource(cmd, resource, flags))) {
-		if ((flags & LCK_SCOPE_MASK) == LCK_VG) {
+		if ((flags & LCK_SCOPE_MASK) == LCK_VG &&
+		    !(flags & LCK_CACHE)) {
 			if ((flags & LCK_TYPE_MASK) == LCK_UNLOCK)
 				lvmcache_unlock_vgname(resource);
 			else
--- LVM2/lib/locking/locking.h	2008/04/10 17:09:31	1.39
+++ LVM2/lib/locking/locking.h	2008/04/15 14:46:19	1.40
@@ -69,6 +69,7 @@
 #define LCK_HOLD	0x00000020U	/* Hold lock when lock_vol returns? */
 #define LCK_LOCAL	0x00000040U	/* Don't propagate to other nodes */
 #define LCK_CLUSTER_VG	0x00000080U	/* VG is clustered */
+#define LCK_CACHE	0x00000100U	/* Operation on cache using P_ lock */
 
 /*
  * Additional lock bits for cluster communication
@@ -91,6 +92,7 @@
 #define LCK_VG_READ		(LCK_VG | LCK_READ | LCK_HOLD)
 #define LCK_VG_WRITE		(LCK_VG | LCK_WRITE | LCK_HOLD)
 #define LCK_VG_UNLOCK		(LCK_VG | LCK_UNLOCK)
+#define LCK_VG_DROP_CACHE	(LCK_VG | LCK_WRITE | LCK_CACHE)
 
 #define LCK_LV_EXCLUSIVE	(LCK_LV | LCK_EXCL | LCK_NONBLOCK)
 #define LCK_LV_SUSPEND		(LCK_LV | LCK_WRITE | LCK_NONBLOCK)
@@ -116,6 +118,8 @@
 	lock_lv_vol(cmd, lv, LCK_LV_ACTIVATE | LCK_HOLD | LCK_LOCAL)
 #define deactivate_lv_local(cmd, lv)	\
 	lock_lv_vol(cmd, lv, LCK_LV_DEACTIVATE | LCK_LOCAL)
+#define drop_cached_metadata(vg)	\
+	lock_vol((vg)->cmd, (vg)->name, LCK_VG_DROP_CACHE)
 
 /* Process list of LVs */
 int suspend_lvs(struct cmd_context *cmd, struct list *lvs);
--- LVM2/lib/metadata/metadata.c	2008/04/10 19:59:42	1.170
+++ LVM2/lib/metadata/metadata.c	2008/04/15 14:46:19	1.171
@@ -1333,6 +1333,11 @@
 		return cache_updated;
 	}
 
+	if (!drop_cached_metadata(vg)) {
+		log_error("Unable to drop cached metadata for VG %s.", vg->name);
+		return 0;
+	}
+
 	/* Commit to each copy of the metadata area */
 	list_iterate_items(mda, &vg->fid->metadata_areas) {
 		failed = 0;
@@ -1348,6 +1353,10 @@
 		}
 	}
 
+	if (!drop_cached_metadata(vg))
+		log_error("Attempt to drop cached metadata failed "
+			  "after commit for VG %s.", vg->name);
+
 	/* If at least one mda commit succeeded, it was committed */
 	return cache_updated;
 }


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2008-04-15 11:36 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2008-04-15 11:36 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2008-04-15 11:36:46

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c 
	lib/locking    : cluster_locking.c 

Log message:
	rename P_global to P_#global

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.849&r2=1.850
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27

--- LVM2/WHATS_NEW	2008/04/14 19:49:12	1.849
+++ LVM2/WHATS_NEW	2008/04/15 11:36:46	1.850
@@ -1,5 +1,6 @@
 Version 2.02.35 - 
 =================================
+  Rename P_global to P_#global.
   Don't attempt remote metadata backups of non-clustered VGs. (2.02.29)
   Don't store fid in VG metadata cache to avoid clvmd segfault. (2.02.34)
   Update vgsplit tests to verify loosening of active LV restriction.
--- LVM2/daemons/clvmd/clvmd-command.c	2007/12/04 15:39:26	1.19
+++ LVM2/daemons/clvmd/clvmd-command.c	2008/04/15 11:36:46	1.20
@@ -118,8 +118,8 @@
 		lockname = &args[2];
 		/* Check to see if the VG is in use by LVM1 */
 		status = do_check_lvm1(lockname);
-		/* P_global causes a cache refresh */
-		if (strcmp(lockname, "P_global") == 0)
+		/* P_#global causes a cache refresh */
+		if (strcmp(lockname, "P_#global") == 0)
 		      do_refresh_cache();
 
 		break;
--- LVM2/lib/locking/cluster_locking.c	2008/04/14 19:49:12	1.26
+++ LVM2/lib/locking/cluster_locking.c	2008/04/15 11:36:46	1.27
@@ -390,7 +390,7 @@
 		if (!*resource)	/* FIXME Deprecated */
 			dm_snprintf(lockname, sizeof(lockname), "P_orphans");
 		else if (*resource == '#')
-			dm_snprintf(lockname, sizeof(lockname), "P_%s", resource + 1);
+			dm_snprintf(lockname, sizeof(lockname), "P_%s", resource);
 		else
 			dm_snprintf(lockname, sizeof(lockname), "V_%s",
 				     resource);


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2006-12-11 14:00 pcaulfield
  0 siblings, 0 replies; 23+ messages in thread
From: pcaulfield @ 2006-12-11 14:00 UTC (permalink / raw)
  To: lvm-devel, lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2006-12-11 14:00:27

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c clvmd-gulm.c clvmd-gulm.h 
	lib/locking    : locking.h 

Log message:
	Fix gulm operation of clvmd. including a hang when attempting to
	exclusively lock an LV that is already locked no another node.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.516&r2=1.517
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.28&r2=1.29

--- LVM2/WHATS_NEW	2006/12/11 13:48:41	1.516
+++ LVM2/WHATS_NEW	2006/12/11 14:00:26	1.517
@@ -1,5 +1,6 @@
 Version 2.02.17 -
 ===================================
+  Fix gulm operation of clvmd, including a hang when doing lvchange -aey
   Fix hang in clvmd if a pre-command failed.
 
 Version 2.02.16 - 1st December 2006
--- LVM2/daemons/clvmd/clvmd-command.c	2006/12/01 23:10:25	1.13
+++ LVM2/daemons/clvmd/clvmd-command.c	2006/12/11 14:00:26	1.14
@@ -194,7 +194,7 @@
 	/* Read locks need to be PR; other modes get passed through */
 	if ((lock_cmd & LCK_TYPE_MASK) == LCK_READ) {
 	    lock_cmd &= ~LCK_TYPE_MASK;
-	    lock_cmd |= LKM_PRMODE;
+	    lock_cmd |= LCK_PREAD;
 	}
 	status = sync_lock(lockname, (int)lock_cmd, (lock_flags & LCK_NONBLOCK) ? LKF_NOQUEUE : 0, &lkid);
 	if (status)
--- LVM2/daemons/clvmd/clvmd-gulm.c	2006/10/09 14:11:57	1.19
+++ LVM2/daemons/clvmd/clvmd-gulm.c	2006/12/11 14:00:26	1.20
@@ -730,7 +730,7 @@
     pthread_mutex_lock(&lwait.mutex);
 
     /* This needs to be converted from DLM/LVM2 value for GULM */
-    if (flags == LCK_NONBLOCK) flags = lg_lock_flag_Try;
+    if (flags & LKF_NOQUEUE) flags = lg_lock_flag_Try;
 
     dm_hash_insert(lock_hash, resource, &lwait);
     DEBUGLOG("lock_resource '%s', flags=%d, mode=%d\n", resource, flags, mode);
@@ -828,6 +828,7 @@
         }
 	break;
 
+    case LCK_PREAD:
     case LCK_READ:
 	status = _lock_resource(lock1, lg_lock_state_Shared, flags, lockid);
 	if (status)
@@ -864,6 +865,7 @@
     /* The held lock mode is in the lock id */
     assert(lockid == LCK_EXCL ||
 	   lockid == LCK_READ ||
+	   lockid == LCK_PREAD ||
 	   lockid == LCK_WRITE);
 
     status = _unlock_resource(lock1, lockid);
--- LVM2/daemons/clvmd/clvmd-gulm.h	2005/01/13 13:24:02	1.2
+++ LVM2/daemons/clvmd/clvmd-gulm.h	2006/12/11 14:00:26	1.3
@@ -1,5 +1,6 @@
 
-
+/* DLM constant that clvmd uses as a generic NONBLOCK lock flag */
+#define LKF_NOQUEUE 1
 
 extern int get_next_node_csid(void **context, char *csid);
 extern void add_down_node(char *csid);
--- LVM2/lib/locking/locking.h	2006/05/16 16:48:30	1.28
+++ LVM2/lib/locking/locking.h	2006/12/11 14:00:26	1.29
@@ -50,7 +50,7 @@
 #define LCK_NULL	0x00000000	/* LCK$_NLMODE */
 #define LCK_READ	0x00000001	/* LCK$_CRMODE */
 					/* LCK$_CWMODE */
-					/* LCK$_PRMODE */
+#define LCK_PREAD       0x00000003      /* LCK$_PRMODE */
 #define LCK_WRITE	0x00000004	/* LCK$_PWMODE */
 #define LCK_EXCL	0x00000005	/* LCK$_EXMODE */
 #define LCK_UNLOCK      0x00000006	/* This is ours */


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2006-10-05 13:55 pcaulfield
  0 siblings, 0 replies; 23+ messages in thread
From: pcaulfield @ 2006-10-05 13:55 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2006-10-05 13:55:50

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c clvmd.c lvm-functions.c 
	                 lvm-functions.h 

Log message:
	Vastly improve the errors returned to the user from clvmd.
	It now captures the error messages that are generated and returns them
	in the reply packet rather than just telling the user to check syslog.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.451&r2=1.452
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4

--- LVM2/WHATS_NEW	2006/10/04 16:03:17	1.451
+++ LVM2/WHATS_NEW	2006/10/05 13:55:50	1.452
@@ -1,5 +1,6 @@
 Version 2.02.11 - 
 =====================================
+  Capture error messages in clvmd and pass them back to the user.
   Remove unused #defines from filter-md.c.
   Make clvmd restart init script wait until clvmd has died before starting it.
   Add -R to clvmd which tells running clvmds to reload their device cache.
--- LVM2/daemons/clvmd/clvmd-command.c	2006/10/04 08:22:16	1.9
+++ LVM2/daemons/clvmd/clvmd-command.c	2006/10/05 13:55:50	1.10
@@ -117,7 +117,7 @@
 		if (status == EIO) {
 			*retlen =
 			    1 + snprintf(*buf, buflen,
-					 "Internal lvm error, check syslog");
+					 get_last_lvm_error());
 			return EIO;
 		}
 		break;
--- LVM2/daemons/clvmd/clvmd.c	2006/10/04 08:22:16	1.27
+++ LVM2/daemons/clvmd/clvmd.c	2006/10/05 13:55:50	1.28
@@ -1689,6 +1689,7 @@
 		}
 		pthread_mutex_unlock(&lvm_thread_mutex);
 	}
+	return NULL;
 }
 
 /* Pass down some work to the LVM thread */
--- LVM2/daemons/clvmd/lvm-functions.c	2006/10/04 08:22:16	1.22
+++ LVM2/daemons/clvmd/lvm-functions.c	2006/10/05 13:55:50	1.23
@@ -50,12 +50,18 @@
 static struct cmd_context *cmd = NULL;
 static struct dm_hash_table *lv_hash = NULL;
 static pthread_mutex_t lv_hash_lock;
+static char last_error[1024];
 
 struct lv_info {
 	int lock_id;
 	int lock_mode;
 };
 
+char *get_last_lvm_error()
+{
+	return last_error;
+}
+
 /* Return the mode a lock is currently held at (or -1 if not held) */
 static int get_current_lock(char *resource)
 {
@@ -201,8 +207,17 @@
 	/* Try to get the lock if it's a clustered volume group */
 	if (lock_flags & LCK_CLUSTER_VG) {
 		status = hold_lock(resource, mode, LKF_NOQUEUE);
-		if (status)
+		if (status) {
+			/* Return an LVM-sensible error for this.
+			 * Forcing EIO makes the upper level return this text
+			 * rather than the strerror text for EAGAIN.
+			 */
+			if (errno == EAGAIN) {
+				sprintf(last_error, "Volume is busy on another node");
+				errno = EIO;
+			}
 			return errno;
+		}
 	}
 
 	/* If it's suspended then resume it */
@@ -512,6 +527,19 @@
 	return NULL;
 }
 
+static void lvm2_log_fn(int level, const char *file, int line,
+			const char *message)
+{
+	/*
+	 * Ignore non-error messages, but store the latest one for returning 
+	 * to the user.
+	 */
+	if (level != _LOG_ERR && level != _LOG_FATAL)
+		return;
+
+	strcpy(last_error, message);
+}
+
 /* This checks some basic cluster-LVM configuration stuff */
 static void check_config()
 {
@@ -564,5 +592,8 @@
 
 	get_initial_state();
 
+	/* Trap log messages so we can pass them back to the user */
+	init_log_fn(lvm2_log_fn);
+
 	return 1;
 }
--- LVM2/daemons/clvmd/lvm-functions.h	2006/10/04 08:22:16	1.3
+++ LVM2/daemons/clvmd/lvm-functions.h	2006/10/05 13:55:50	1.4
@@ -32,5 +32,6 @@
 extern int hold_unlock(char *resource);
 extern int hold_lock(char *resource, int mode, int flags);
 extern void unlock_all(void);
+extern char *get_last_lvm_error(void);
 
 #endif


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2006-05-12 19:16 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2006-05-12 19:16 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2006-05-12 19:16:48

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c lvm-functions.c 
	lib/activate   : activate.c activate.h 
	lib/config     : defaults.h 
	lib/locking    : cluster_locking.c locking.h 
	lib/log        : log.c log.h 
	tools          : args.h commands.h lvchange.c vgchange.c 
	                 vgreduce.c 

Log message:
	Add --monitor to vgcreate and lvcreate to control dmeventd registration.
	Propagate --monitor around cluster.
	Filter LCK_NONBLOCK in clvmd lock_vg.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.386&r2=1.387
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.108&r2=1.109
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/config/defaults.h.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.h.diff?cvsroot=lvm2&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/args.h.diff?cvsroot=lvm2&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/commands.h.diff?cvsroot=lvm2&r1=1.83&r2=1.84
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/lvchange.c.diff?cvsroot=lvm2&r1=1.66&r2=1.67
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgchange.c.diff?cvsroot=lvm2&r1=1.52&r2=1.53
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/tools/vgreduce.c.diff?cvsroot=lvm2&r1=1.47&r2=1.48


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2005-10-16 23:04 agk
  0 siblings, 0 replies; 23+ messages in thread
From: agk @ 2005-10-16 23:04 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk@sourceware.org	2005-10-16 23:03:59

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c clvmd-gulm.c lvm-functions.c 
	                 tcp-comms.c 
	include        : .symlinks 
	lib            : Makefile.in 
	lib/activate   : activate.c activate.h dev_manager.c fs.c 
	lib/cache      : lvmcache.c 
	lib/commands   : toolcontext.c toolcontext.h 
	lib/config     : config.c config.h 
	lib/datastruct : btree.c btree.h list.h str_list.c str_list.h 
	lib/device     : dev-cache.c dev-cache.h dev-io.c device.c 
	                 device.h 
	lib/display    : display.c 
	lib/error      : errseg.c 
	lib/filters    : filter-composite.c filter-md.c 
	                 filter-persistent.c filter-regex.c 
	                 filter-sysfs.c filter.c 
	lib/format1    : disk-rep.c disk-rep.h format1.c import-export.c 
	                 import-extents.c layout.c lvm1-label.c 
	                 vg_number.c 
	lib/format_pool: disk_rep.c disk_rep.h format_pool.c 
	                 import_export.c pool_label.c 
	lib/format_text: archive.c archiver.c export.c format-text.c 
	                 format-text.h import-export.h import.c 
	                 import_vsn1.c tags.c text_import.h text_label.c 
	lib/label      : label.c 
	lib/locking    : cluster_locking.c file_locking.c 
	lib/log        : log.c 
	lib/metadata   : lv_alloc.h lv_manip.c metadata.c mirror.c 
	                 pv_alloc.h pv_manip.c pv_map.c pv_map.h 
	                 segtype.h 
	lib/mirror     : mirrored.c 
	lib/misc       : lib.h lvm-file.c lvm-string.c lvm-string.h 
	lib/mm         : memlock.c 
	lib/regex      : matcher.c matcher.h parse_rx.c parse_rx.h 
	                 ttree.c ttree.h 
	lib/report     : report.c 
	lib/snapshot   : snapshot.c 
	lib/striped    : striped.c 
	lib/zero       : zero.c 
	test/config    : config_t.c 
	test/datastruct: hash_t.c 
	test/device    : dev_cache_t.c 
	test/filters   : pfilter_t.c rfilter_t.c 
	test/format1   : get_pvs_t.c get_vgs_t.c read_pv_t.c read_vg_t.c 
	                 write_vg_t.c 
	test/mm        : dbg_malloc_t.c 
	test/regex     : matcher_t.c parse_t.c 
	tools          : lvmcmdline.c lvrename.c polldaemon.c pvmove.c 
	                 reporter.c toollib.c toollib.h tools.h 
	                 vgcfgbackup.c vgextend.c vgmerge.c 
Removed files:
	lib/datastruct : bitset.c bitset.h hash.c hash.h 
	lib/mm         : dbg_malloc.c dbg_malloc.h pool-debug.c 
	                 pool-fast.c pool.c pool.h 

Log message:
	Use hash, bitset, malloc, pool from libdevmapper.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.300&r2=1.301
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-gulm.c.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/tcp-comms.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/include/.symlinks.diff?cvsroot=lvm2&r1=1.38&r2=1.39
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/Makefile.in.diff?cvsroot=lvm2&r1=1.73&r2=1.74
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.42&r2=1.43
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.82&r2=1.83
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/activate/fs.c.diff?cvsroot=lvm2&r1=1.35&r2=1.36
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/cache/lvmcache.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.c.diff?cvsroot=lvm2&r1=1.33&r2=1.34
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/commands/toolcontext.h.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.c.diff?cvsroot=lvm2&r1=1.41&r2=1.42
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/config/config.h.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/btree.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/btree.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/list.h.diff?cvsroot=lvm2&r1=1.21&r2=1.22
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/str_list.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/str_list.h.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/bitset.c.diff?cvsroot=lvm2&r1=1.7&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/bitset.h.diff?cvsroot=lvm2&r1=1.5&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/hash.c.diff?cvsroot=lvm2&r1=1.19&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/datastruct/hash.h.diff?cvsroot=lvm2&r1=1.12&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.c.diff?cvsroot=lvm2&r1=1.42&r2=1.43
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-cache.h.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/dev-io.c.diff?cvsroot=lvm2&r1=1.49&r2=1.50
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/device/device.h.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/display/display.c.diff?cvsroot=lvm2&r1=1.64&r2=1.65
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/error/errseg.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-composite.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-md.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-persistent.c.diff?cvsroot=lvm2&r1=1.25&r2=1.26
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-regex.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter-sysfs.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/filters/filter.c.diff?cvsroot=lvm2&r1=1.31&r2=1.32
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.c.diff?cvsroot=lvm2&r1=1.55&r2=1.56
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/disk-rep.h.diff?cvsroot=lvm2&r1=1.42&r2=1.43
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/format1.c.diff?cvsroot=lvm2&r1=1.92&r2=1.93
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-export.c.diff?cvsroot=lvm2&r1=1.77&r2=1.78
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/import-extents.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/layout.c.diff?cvsroot=lvm2&r1=1.22&r2=1.23
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/lvm1-label.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format1/vg_number.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/disk_rep.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/format_pool.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/import_export.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_pool/pool_label.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archive.c.diff?cvsroot=lvm2&r1=1.18&r2=1.19
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/archiver.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/export.c.diff?cvsroot=lvm2&r1=1.46&r2=1.47
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/format-text.h.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import-export.h.diff?cvsroot=lvm2&r1=1.15&r2=1.16
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import.c.diff?cvsroot=lvm2&r1=1.32&r2=1.33
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/import_vsn1.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/tags.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_import.h.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/format_text/text_label.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/label/label.c.diff?cvsroot=lvm2&r1=1.26&r2=1.27
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/locking/file_locking.c.diff?cvsroot=lvm2&r1=1.20&r2=1.21
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/log/log.c.diff?cvsroot=lvm2&r1=1.29&r2=1.30
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_alloc.h.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=1.81&r2=1.82
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/metadata.c.diff?cvsroot=lvm2&r1=1.81&r2=1.82
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_alloc.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_manip.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.c.diff?cvsroot=lvm2&r1=1.24&r2=1.25
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/pv_map.h.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/segtype.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mirror/mirrored.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lib.h.diff?cvsroot=lvm2&r1=1.7&r2=1.8
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-file.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.c.diff?cvsroot=lvm2&r1=1.6&r2=1.7
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/misc/lvm-string.h.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/memlock.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/dbg_malloc.c.diff?cvsroot=lvm2&r1=1.21&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/dbg_malloc.h.diff?cvsroot=lvm2&r1=1.13&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/pool-debug.c.diff?cvsroot=lvm2&r1=1.18&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/pool-fast.c.diff?cvsroot=lvm2&r1=1.18&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/pool.c.diff?cvsroot=lvm2&r1=1.16&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/mm/pool.h.diff?cvsroot=lvm2&r1=1.17&r2=NONE
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/regex/matcher.c.diff?cvsroot=lvm2&r1=1.12&r2=1.13
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/regex/matcher.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/regex/parse_rx.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/regex/parse_rx.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/regex/ttree.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/regex/ttree.h.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/report/report.c.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/snapshot/snapshot.c.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/striped/striped.c.diff?cvsroot=lvm2&r1=1.8&r2=1.9
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/zero/zero.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/config/config_t.c.diff?cvsroot=lvm2&r1=1.1&r2=1.2
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/datastruct/hash_t.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/device/dev_cache_t.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/filters/pfilter_t.c.diff?cvsroot=lvm2&r1=1.5&r2=1.6
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/filters/rfilter_t.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/format1/get_pvs_t.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/format1/get_vgs_t.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/format1/read_pv_t.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/format1/read_vg_t.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/format1/write_vg_t.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/mm/dbg_malloc_t.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/regex/matcher_t.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/test/regex/parse_t.c.diff?cvsroot=lvm2&r1=1.2&r2=1.3
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvmcmdline.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/lvrename.c.diff?cvsroot=lvm2&r1=1.34&r2=1.35
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/polldaemon.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/pvmove.c.diff?cvsroot=lvm2&r1=1.27&r2=1.28
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/reporter.c.diff?cvsroot=lvm2&r1=1.9&r2=1.10
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.c.diff?cvsroot=lvm2&r1=1.72&r2=1.73
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/toollib.h.diff?cvsroot=lvm2&r1=1.37&r2=1.38
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/tools.h.diff?cvsroot=lvm2&r1=1.47&r2=1.48
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgcfgbackup.c.diff?cvsroot=lvm2&r1=1.19&r2=1.20
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgextend.c.diff?cvsroot=lvm2&r1=1.23&r2=1.24
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/tools/vgmerge.c.diff?cvsroot=lvm2&r1=1.28&r2=1.29


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

* LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
@ 2005-08-16  8:25 pcaulfield
  0 siblings, 0 replies; 23+ messages in thread
From: pcaulfield @ 2005-08-16  8:25 UTC (permalink / raw)
  To: lvm2-cvs

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	pcaulfield@sourceware.org	2005-08-16 08:25:09

Modified files:
	.              : WHATS_NEW 
	daemons/clvmd  : clvmd-command.c lvm-functions.c 
	lib/locking    : cluster_locking.c 

Log message:
	clvmd no longer takes out locks for non-clusteed LVs,
	and non-clustered LVs are only activated on the local node.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.285&r2=1.286
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12
http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/lib/locking/cluster_locking.c.diff?cvsroot=lvm2&r1=1.4&r2=1.5


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

end of thread, other threads:[~2011-09-26  7:51 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 21:16 LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c agk
  -- strict thread matches above, loose matches on Subject: below --
2011-09-26  7:51 zkabelac
2011-04-08 14:40 zkabelac
2011-02-18 16:18 zkabelac
2011-02-04 19:18 zkabelac
2011-01-31 19:52 zkabelac
2011-01-17 23:13 mbroz
2011-01-10 14:02 zkabelac
2010-06-17 12:48 mbroz
2010-06-04 12:59 mbroz
2010-01-05 16:07 mbroz
2010-01-05 16:05 mbroz
2009-12-09 18:42 mbroz
2009-04-22  9:40 mbroz
2008-05-09 18:45 agk
2008-05-09 15:13 agk
2008-04-15 14:46 mbroz
2008-04-15 11:36 agk
2006-12-11 14:00 pcaulfield
2006-10-05 13:55 pcaulfield
2006-05-12 19:16 agk
2005-10-16 23:04 agk
2005-08-16  8:25 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).