* [Cluster-devel] cluster/group/dlm_controld member_cman.c
@ 2006-12-14 19:57 teigland
0 siblings, 0 replies; 5+ messages in thread
From: teigland @ 2006-12-14 19:57 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL50
Changes by: teigland at sourceware.org 2006-12-14 19:57:46
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&only_with_tag=RHEL50&r1=1.4&r2=1.4.4.1
--- 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:57:46 1.4.4.1
@@ -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;
}
^ permalink raw reply [flat|nested] 5+ messages in thread* [Cluster-devel] cluster/group/dlm_controld member_cman.c
@ 2007-10-05 14:20 lhh
0 siblings, 0 replies; 5+ messages in thread
From: lhh @ 2007-10-05 14:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL51
Changes by: lhh at sourceware.org 2007-10-05 14:20:53
Modified files:
group/dlm_controld: member_cman.c
Log message:
Fix #315711 - dlm_controld needs to ignore node ID 0 to make qdisk work
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/dlm_controld/member_cman.c.diff?cvsroot=cluster&only_with_tag=RHEL51&r1=1.4.2.3&r2=1.4.2.3.2.1
--- cluster/group/dlm_controld/member_cman.c 2007/05/04 21:14:32 1.4.2.3
+++ cluster/group/dlm_controld/member_cman.c 2007/10/05 14:20:53 1.4.2.3.2.1
@@ -82,6 +82,14 @@
return;
}
+ /* Never allow node ID 0 to be considered a member #315711 */
+ for (i = 0; i < cman_node_count; i++) {
+ if (cman_nodes[i].cn_nodeid == 0) {
+ cman_nodes[i].cn_member = 0;
+ break;
+ }
+ }
+
for (i = 0; i < old_node_count; i++) {
if (old_nodes[i].cn_member &&
!is_cman_member(old_nodes[i].cn_nodeid)) {
^ permalink raw reply [flat|nested] 5+ messages in thread* [Cluster-devel] cluster/group/dlm_controld member_cman.c
@ 2007-10-05 14:20 lhh
0 siblings, 0 replies; 5+ messages in thread
From: lhh @ 2007-10-05 14:20 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: lhh at sourceware.org 2007-10-05 14:20:33
Modified files:
group/dlm_controld: member_cman.c
Log message:
Fix #315711 - dlm_controld needs to ignore node ID 0 to make qdisk work
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/dlm_controld/member_cman.c.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.4.2.3&r2=1.4.2.4
--- cluster/group/dlm_controld/member_cman.c 2007/05/04 21:14:32 1.4.2.3
+++ cluster/group/dlm_controld/member_cman.c 2007/10/05 14:20:33 1.4.2.4
@@ -82,6 +82,14 @@
return;
}
+ /* Never allow node ID 0 to be considered a member #315711 */
+ for (i = 0; i < cman_node_count; i++) {
+ if (cman_nodes[i].cn_nodeid == 0) {
+ cman_nodes[i].cn_member = 0;
+ break;
+ }
+ }
+
for (i = 0; i < old_node_count; i++) {
if (old_nodes[i].cn_member &&
!is_cman_member(old_nodes[i].cn_nodeid)) {
^ permalink raw reply [flat|nested] 5+ messages in thread* [Cluster-devel] cluster/group/dlm_controld member_cman.c
@ 2006-12-14 19:57 teigland
0 siblings, 0 replies; 5+ messages in thread
From: teigland @ 2006-12-14 19:57 UTC (permalink / raw)
To: cluster-devel.redhat.com
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL5
Changes by: teigland at sourceware.org 2006-12-14 19:57:35
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&only_with_tag=RHEL5&r1=1.4&r2=1.4.2.1
--- 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:57:35 1.4.2.1
@@ -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;
}
^ permalink raw reply [flat|nested] 5+ messages in thread* [Cluster-devel] cluster/group/dlm_controld member_cman.c
@ 2006-12-14 19:56 teigland
0 siblings, 0 replies; 5+ messages in thread
From: teigland @ 2006-12-14 19:56 UTC (permalink / raw)
To: cluster-devel.redhat.com
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;
}
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-10-05 14:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-14 19:57 [Cluster-devel] cluster/group/dlm_controld member_cman.c teigland
-- strict thread matches above, loose matches on Subject: below --
2007-10-05 14:20 lhh
2007-10-05 14:20 lhh
2006-12-14 19:57 teigland
2006-12-14 19:56 teigland
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 NNTP newsgroup(s).