From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/group/dlm_controld member_cman.c
Date: 14 Dec 2006 19:56:51 -0000 [thread overview]
Message-ID: <20061214195651.22951.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-12-14 19:56:50
Modified files:
group/dlm_controld: member_cman.c
Log message:
Switch from CMAN_DISPATCH_ONE loop to CMAN_DISPATCH_ALL to resolve
delayed cman shutdown callbacks.
bz 219385
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/dlm_controld/member_cman.c.diff?cvsroot=cluster&r1=1.4&r2=1.5
--- cluster/group/dlm_controld/member_cman.c 2006/10/24 16:16:31 1.4
+++ cluster/group/dlm_controld/member_cman.c 2006/12/14 19:56:50 1.5
@@ -18,8 +18,6 @@
static int old_node_count;
static cman_node_t cman_nodes[MAX_NODES];
static int cman_node_count;
-static int cman_cb;
-static int cman_reason;
static int local_nodeid;
extern struct list_head lockspaces;
@@ -66,7 +64,6 @@
return cn->cn_name;
}
-
/* add a configfs dir for cluster members that don't have one,
del the configfs dir for cluster members that are now gone */
@@ -112,36 +109,20 @@
}
}
-static void process_cman_callback(void)
-{
- switch (cman_reason) {
- case CMAN_REASON_STATECHANGE:
- statechange();
- break;
- default:
- break;
- }
-}
-
static void member_callback(cman_handle_t h, void *private, int reason, int arg)
{
- struct lockspace *ls;
-
- cman_cb = 1;
- cman_reason = reason;
-
- if (reason == CMAN_REASON_TRY_SHUTDOWN) {
- /* special case: we don't block cluster shutdown
- for the gfs_controld lockspace */
-
- list_for_each_entry(ls, &lockspaces, list) {
- if (!strncmp(ls->name, "gfs_controld", 12))
- continue;
+ switch (reason) {
+ case CMAN_REASON_TRY_SHUTDOWN:
+ if (list_empty(&lockspaces))
+ cman_replyto_shutdown(ch, 1);
+ else {
log_debug("no to cman shutdown");
cman_replyto_shutdown(ch, 0);
- return;
}
- cman_replyto_shutdown(ch, 1);
+ break;
+ case CMAN_REASON_STATECHANGE:
+ statechange();
+ break;
}
}
@@ -149,18 +130,7 @@
{
int rv;
- while (1) {
- rv = cman_dispatch(ch, CMAN_DISPATCH_ONE);
- if (rv < 0)
- break;
-
- if (cman_cb) {
- cman_cb = 0;
- process_cman_callback();
- } else
- break;
- }
-
+ rv = cman_dispatch(ch, CMAN_DISPATCH_ALL);
if (rv == -1 && errno == EHOSTDOWN) {
/* do we want to try to forcibly clean some stuff up
in the kernel here? */
@@ -215,8 +185,7 @@
memset(&cman_nodes, 0, sizeof(cman_nodes));
/* add configfs entries for existing nodes */
- cman_reason = CMAN_REASON_STATECHANGE;
- process_cman_callback();
+ statechange();
out:
return fd;
}
next reply other threads:[~2006-12-14 19:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-14 19:56 teigland [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-12-14 19:57 [Cluster-devel] cluster/group/dlm_controld member_cman.c teigland
2006-12-14 19:57 teigland
2007-10-05 14:20 lhh
2007-10-05 14:20 lhh
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=20061214195651.22951.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.