All of lore.kernel.org
 help / color / mirror / Atom feed
From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/dlm-kernel/src dlm_internal.h lockspac ...
Date: 14 Sep 2006 21:43:31 -0000	[thread overview]
Message-ID: <20060914214331.8644.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	teigland at sourceware.org	2006-09-14 21:43:28

Modified files:
	dlm-kernel/src : dlm_internal.h lockspace.c nodes.c recoverd.c 

Log message:
	Add a spinlock around the ls_nodes_gone list.  The list is modified
	during mounting/unmounting and traversed by dlm_recvd when a request
	is received.  This should fix bz 206463.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/dlm_internal.h.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.36.2.5&r2=1.36.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/lockspace.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.19.2.9&r2=1.19.2.10
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/nodes.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.10.2.2&r2=1.10.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm-kernel/src/recoverd.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.19.2.4&r2=1.19.2.5

--- cluster/dlm-kernel/src/Attic/dlm_internal.h	2005/03/29 08:01:59	1.36.2.5
+++ cluster/dlm-kernel/src/Attic/dlm_internal.h	2006/09/14 21:43:28	1.36.2.6
@@ -259,6 +259,7 @@
 
 	struct list_head	ls_nodes;	/* current nodes in ls */
 	struct list_head	ls_nodes_gone;	/* dead node list, recovery */
+	spinlock_t		ls_nodes_gone_spin;
 	uint32_t		ls_num_nodes;	/* number of nodes in ls */
 	uint32_t		ls_low_nodeid;
 	uint32_t *		ls_node_array;
--- cluster/dlm-kernel/src/Attic/lockspace.c	2006/04/18 14:54:41	1.19.2.9
+++ cluster/dlm-kernel/src/Attic/lockspace.c	2006/09/14 21:43:28	1.19.2.10
@@ -322,6 +322,7 @@
 
 	INIT_LIST_HEAD(&ls->ls_nodes);
 	INIT_LIST_HEAD(&ls->ls_nodes_gone);
+	spin_lock_init(&ls->ls_nodes_gone_spin);
 	ls->ls_num_nodes = 0;
 	ls->ls_node_array = NULL;
 	ls->ls_recoverd_task = NULL;
--- cluster/dlm-kernel/src/Attic/nodes.c	2005/01/27 09:25:41	1.10.2.2
+++ cluster/dlm-kernel/src/Attic/nodes.c	2006/09/14 21:43:28	1.10.2.3
@@ -228,8 +228,10 @@
 		if (!found) {
 			neg++;
 			csb->gone_event = rv->event_id;
+			spin_lock(&ls->ls_nodes_gone_spin);
 			list_del(&csb->list);
 			list_add_tail(&csb->list, &ls->ls_nodes_gone);
+			spin_unlock(&ls->ls_nodes_gone_spin);
 			ls->ls_num_nodes--;
 			log_debug(ls, "remove node %u", csb->node->nodeid);
 		}
@@ -296,7 +298,19 @@
 
 void ls_nodes_gone_clear(struct dlm_ls *ls)
 {
-	nodes_clear(&ls->ls_nodes_gone);
+	struct dlm_csb *csb;
+
+ retry:
+	spin_lock(&ls->ls_nodes_gone_spin);
+	if (list_empty(&ls->ls_nodes_gone))
+		goto out;
+	csb = list_entry(ls->ls_nodes_gone.next, struct dlm_csb, list);
+	list_del(&csb->list);
+	spin_unlock(&ls->ls_nodes_gone_spin);
+	release_csb(csb);
+	goto retry;
+ out:
+	spin_unlock(&ls->ls_nodes_gone_spin);
 }
 
 int ls_nodes_init(struct dlm_ls *ls, struct dlm_recover *rv)
@@ -339,9 +353,14 @@
 {
 	struct dlm_csb *csb;
 
+	spin_lock(&ls->ls_nodes_gone_spin);
 	list_for_each_entry(csb, &ls->ls_nodes_gone, list) {
-		if (csb->node->nodeid == nodeid)
+		if (csb->node->nodeid == nodeid) {
+			spin_unlock(&ls->ls_nodes_gone_spin);
 			return TRUE;
+		}
 	}
+	spin_unlock(&ls->ls_nodes_gone_spin);
 	return FALSE;
 }
+
--- cluster/dlm-kernel/src/Attic/recoverd.c	2005/01/27 09:25:41	1.19.2.4
+++ cluster/dlm-kernel/src/Attic/recoverd.c	2006/09/14 21:43:28	1.19.2.5
@@ -226,12 +226,17 @@
 {
 	struct dlm_csb *csb, *safe;
 
+ restart:
+	spin_lock(&ls->ls_nodes_gone_spin);
 	list_for_each_entry_safe(csb, safe, &ls->ls_nodes_gone, list) {
 		if (csb->gone_event <= finish_event) {
 			list_del(&csb->list);
+			spin_unlock(&ls->ls_nodes_gone_spin);
 			release_csb(csb);
+			goto restart;
 		}
 	}
+	spin_unlock(&ls->ls_nodes_gone_spin);
 }
 
 /*



             reply	other threads:[~2006-09-14 21:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-14 21:43 teigland [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-09-14 21:50 [Cluster-devel] cluster/dlm-kernel/src dlm_internal.h lockspac teigland
2006-09-19 16:39 teigland
2006-09-26 16:33 teigland

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=20060914214331.8644.qmail@sourceware.org \
    --to=teigland@sourceware.org \
    /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.