All of lore.kernel.org
 help / color / mirror / Atom feed
From: agk@sourceware.org <agk@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c ...
Date: 9 May 2008 18:45:16 -0000	[thread overview]
Message-ID: <20080509184516.25532.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk at 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)) {



             reply	other threads:[~2008-05-09 18:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09 18:45 agk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-09-26  7:51 LVM2 ./WHATS_NEW daemons/clvmd/clvmd-command.c zkabelac
2011-06-01 21:16 agk
2011-04-08 14:40 zkabelac
2011-02-18 16:17 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:39 mbroz
2008-05-09 15:13 agk
2008-04-15 14:46 mbroz
2008-04-15 11:36 agk
2006-12-11 14:00 pcaulfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080509184516.25532.qmail@sourceware.org \
    --to=agk@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.