All of lore.kernel.org
 help / color / mirror / Atom feed
From: mornfall@sourceware.org <mornfall@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/daemons/clvmd clvmd-singlenode.c
Date: 7 Nov 2011 17:11:24 -0000	[thread overview]
Message-ID: <20111107171124.22494.qmail@sourceware.org> (raw)

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

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

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

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

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



             reply	other threads:[~2011-11-07 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-07 17:11 mornfall [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-09-29  8:57 LVM2/daemons/clvmd clvmd-singlenode.c zkabelac
2011-03-24 10:45 zkabelac

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=20111107171124.22494.qmail@sourceware.org \
    --to=mornfall@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.