cluster: RHEL56 - Fix device name and mount point in utils
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 6f9e71a735281ae034cb9741a499b01127f9712e
Parent: 4c44c6e523a4c8521f55fc7330508c493da379f5
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri May 28 08:28:46 2010 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri May 28 08:28:46 2010 -0500
Fix device name and mount point in utils
This patch fixes a regression introduced by commit 04f7da3 whereby
the gfs2-utils identified whether a gfs2 file system was mounted.
The method works fine when specifying the mount point for tools like
gfs2_grow. However, it doesn't work when the device is specified.
The solution is to copy the discovered device name and mount point
into the proper libgfs2 variables used by the utils.
rhbz#597002
---
gfs2/libgfs2/misc.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index e277e27..81c7e2e 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -121,9 +121,7 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
}
if (stat(sdp->path_name, &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
} else {
file_dev = st_buf.st_dev;
file_ino = st_buf.st_ino;
@@ -139,16 +137,21 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
strcpy(sdp->device_name, mnt->mnt_fsname); /* fix it */
break;
}
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
+ if (stat(mnt->mnt_fsname, &st_buf) != 0)
+ continue;
+
+ if (S_ISBLK(st_buf.st_mode)) {
+ if (file_rdev && (file_rdev == st_buf.st_rdev)) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
+ }
+ } else {
+ if (file_dev && ((file_dev == st_buf.st_dev) &&
+ (file_ino == st_buf.st_ino))) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
}
}
}
13 years, 11 months
cluster: RHEL6 - Fix device name and mount point in utils
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: de94f7c47a2dcea549427bfbfadda5a8bb2e5a10
Parent: f7a3fe0e4375d08f545ef6b3f7617295b56373c6
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri May 28 08:28:46 2010 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri May 28 09:38:50 2010 -0500
Fix device name and mount point in utils
This patch fixes a regression introduced by commit 04f7da3 whereby
the gfs2-utils identified whether a gfs2 file system was mounted.
The method works fine when specifying the mount point for tools like
gfs2_grow. However, it doesn't work when the device is specified.
The solution is to copy the discovered device name and mount point
into the proper libgfs2 variables used by the utils.
rhbz#597002
---
gfs2/libgfs2/misc.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 8981114..31fc665 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -113,9 +113,7 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
}
if (stat(sdp->path_name, &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
} else {
file_dev = st_buf.st_dev;
file_ino = st_buf.st_ino;
@@ -131,16 +129,21 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
strcpy(sdp->device_name, mnt->mnt_fsname); /* fix it */
break;
}
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
+ if (stat(mnt->mnt_fsname, &st_buf) != 0)
+ continue;
+
+ if (S_ISBLK(st_buf.st_mode)) {
+ if (file_rdev && (file_rdev == st_buf.st_rdev)) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
+ }
+ } else {
+ if (file_dev && ((file_dev == st_buf.st_dev) &&
+ (file_ino == st_buf.st_ino))) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
}
}
}
13 years, 11 months
cluster: STABLE3 - Fix device name and mount point in utils
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e724bb5fe6abc7395c525b2bf483810577b92c33
Parent: cc64807655a955c7eaa460d6e3707c051a773305
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri May 28 08:28:46 2010 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri May 28 08:39:01 2010 -0500
Fix device name and mount point in utils
This patch fixes a regression introduced by commit 04f7da3 whereby
the gfs2-utils identified whether a gfs2 file system was mounted.
The method works fine when specifying the mount point for tools like
gfs2_grow. However, it doesn't work when the device is specified.
The solution is to copy the discovered device name and mount point
into the proper libgfs2 variables used by the utils.
rhbz#597002
---
gfs2/libgfs2/misc.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 8981114..31fc665 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -113,9 +113,7 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
}
if (stat(sdp->path_name, &st_buf) == 0) {
if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__ /* The GNU hurd is broken with respect to stat devices */
file_rdev = st_buf.st_rdev;
-#endif /* __GNU__ */
} else {
file_dev = st_buf.st_dev;
file_ino = st_buf.st_ino;
@@ -131,16 +129,21 @@ int is_pathname_mounted(struct gfs2_sbd *sdp, int *ro_mount)
strcpy(sdp->device_name, mnt->mnt_fsname); /* fix it */
break;
}
- if (stat(mnt->mnt_fsname, &st_buf) == 0) {
- if (S_ISBLK(st_buf.st_mode)) {
-#ifndef __GNU__
- if (file_rdev && (file_rdev == st_buf.st_rdev))
- break;
-#endif /* __GNU__ */
- } else {
- if (file_dev && ((file_dev == st_buf.st_dev) &&
- (file_ino == st_buf.st_ino)))
- break;
+ if (stat(mnt->mnt_fsname, &st_buf) != 0)
+ continue;
+
+ if (S_ISBLK(st_buf.st_mode)) {
+ if (file_rdev && (file_rdev == st_buf.st_rdev)) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
+ }
+ } else {
+ if (file_dev && ((file_dev == st_buf.st_dev) &&
+ (file_ino == st_buf.st_ino))) {
+ strcpy(sdp->device_name, mnt->mnt_fsname);
+ strcpy(sdp->path_name, mnt->mnt_dir);
+ break;
}
}
}
13 years, 11 months
dlm: master - dlm_controld: wrong fencing time comparison (2)
by David Teigland
Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=10e53d7f...
Commit: 10e53d7fae4cd576518864fb4309e88402cecc56
Parent: 1ff741d523bda31af31971ba8a898aa391c004ef
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 27 10:29:19 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 27 10:33:02 2010 -0500
dlm_controld: wrong fencing time comparison (2)
Slight change to commit 4039bf4817a96b6aab20de948389f43b89ce4a8e
to account for the fact that sometimes fenced time can be within
a second of fail time.
bz 594511
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 94a9b68..93cf108 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -542,7 +542,11 @@ static int check_fencing_done(struct lockspace *ls)
if (rv < 0)
log_error("fenced_node_info error %d", rv);
- if (last_fenced_time > node->fail_time) {
+ /* need >= not just > because in at least one case
+ we've seen fenced_time within the same second as
+ fail_time: with external fencing, e.g. fence_node */
+
+ if (last_fenced_time >= node->fail_time) {
log_group(ls, "check_fencing %d done "
"add %llu fail %llu last %llu",
node->nodeid,
13 years, 11 months
cluster: STABLE3 - dlm_controld: wrong fencing time comparison (2)
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: cc64807655a955c7eaa460d6e3707c051a773305
Parent: cd5b1d943b588f8bd36dae78e87db29e9c9feb7b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 27 10:29:19 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 27 10:32:23 2010 -0500
dlm_controld: wrong fencing time comparison (2)
Slight change to commit 4039bf4817a96b6aab20de948389f43b89ce4a8e
to account for the fact that sometimes fenced time can be within
a second of fail time.
bz 594511
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 94a9b68..93cf108 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -542,7 +542,11 @@ static int check_fencing_done(struct lockspace *ls)
if (rv < 0)
log_error("fenced_node_info error %d", rv);
- if (last_fenced_time > node->fail_time) {
+ /* need >= not just > because in at least one case
+ we've seen fenced_time within the same second as
+ fail_time: with external fencing, e.g. fence_node */
+
+ if (last_fenced_time >= node->fail_time) {
log_group(ls, "check_fencing %d done "
"add %llu fail %llu last %llu",
node->nodeid,
13 years, 11 months
cluster: RHEL6 - dlm_controld: wrong fencing time comparison (2)
by David Teigland
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: f7a3fe0e4375d08f545ef6b3f7617295b56373c6
Parent: bafd8b8cc294c2c1dae9d375f40ec64217fca81d
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu May 27 10:29:19 2010 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu May 27 10:29:19 2010 -0500
dlm_controld: wrong fencing time comparison (2)
Slight change to commit 4039bf4817a96b6aab20de948389f43b89ce4a8e
to account for the fact that sometimes fenced time can be within
a second of fail time.
bz 594511
Signed-off-by: David Teigland <teigland(a)redhat.com>
---
group/dlm_controld/cpg.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 94a9b68..93cf108 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -542,7 +542,11 @@ static int check_fencing_done(struct lockspace *ls)
if (rv < 0)
log_error("fenced_node_info error %d", rv);
- if (last_fenced_time > node->fail_time) {
+ /* need >= not just > because in at least one case
+ we've seen fenced_time within the same second as
+ fail_time: with external fencing, e.g. fence_node */
+
+ if (last_fenced_time >= node->fail_time) {
log_group(ls, "check_fencing %d done "
"add %llu fail %llu last %llu",
node->nodeid,
13 years, 11 months
cluster: RHEL6 - add missing man pages
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: bafd8b8cc294c2c1dae9d375f40ec64217fca81d
Parent: f288015025489cb35230c61f82d02c3d70e4a40e
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu May 27 08:32:18 2010 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu May 27 08:40:09 2010 +0200
add missing man pages
rpmdiff automatic check tool found 3 missing man pages.
Resolves: rhbz#594111
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/man/Makefile | 3 ++-
cman/man/cman_notify.8 | 17 +++++++++++++++++
group/man/Makefile | 2 ++
group/man/dlm_controld.pcmk.8 | 1 +
group/man/gfs_controld.pcmk.8 | 1 +
5 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/cman/man/Makefile b/cman/man/Makefile
index 9ed16e9..df20abb 100644
--- a/cman/man/Makefile
+++ b/cman/man/Makefile
@@ -4,7 +4,8 @@ MANTARGET= \
cman_tool.8 \
qdiskd.8 \
mkqdisk.8 \
- cmannotifyd.8
+ cmannotifyd.8 \
+ cman_notify.8
include ../../make/defines.mk
include $(OBJDIR)/make/install.mk
diff --git a/cman/man/cman_notify.8 b/cman/man/cman_notify.8
new file mode 100644
index 0000000..446bf12
--- /dev/null
+++ b/cman/man/cman_notify.8
@@ -0,0 +1,17 @@
+.TH "cman_notify" "8" "November 2008" "" "CMAN Notification Daemon"
+.SH "NAME"
+cman_notify \- CMAN Notification Daemon run-part alike script
+.SH "SYNOPSIS"
+\fBcman_notify
+.SH "DESCRIPTION"
+.PP
+The \fBcmannotifyd\fP daemon talks to CMAN and provides a mechanism to notify
+external entities about cluster changes.
+\fBcman_notify\fP script is in charge to execute all notification scripts
+in a run-part alike way.
+.SH "NOTES"
+\fBcman_notify\fP should never be called standalone except for debugging
+purposes.
+
+.SH "SEE ALSO"
+cmannotifyd(8)
diff --git a/group/man/Makefile b/group/man/Makefile
index 70387c3..7fab518 100644
--- a/group/man/Makefile
+++ b/group/man/Makefile
@@ -1,6 +1,8 @@
MANTARGET= \
dlm_controld.8 \
+ dlm_controld.pcmk.8 \
gfs_controld.8 \
+ gfs_controld.pcmk.8 \
gfs_control.8 \
group_tool.8 \
groupd.8
diff --git a/group/man/dlm_controld.pcmk.8 b/group/man/dlm_controld.pcmk.8
new file mode 100644
index 0000000..d69f41b
--- /dev/null
+++ b/group/man/dlm_controld.pcmk.8
@@ -0,0 +1 @@
+.so man8/dlm_controld.8
diff --git a/group/man/gfs_controld.pcmk.8 b/group/man/gfs_controld.pcmk.8
new file mode 100644
index 0000000..f305866
--- /dev/null
+++ b/group/man/gfs_controld.pcmk.8
@@ -0,0 +1 @@
+.so man8/gfs_controld.8
13 years, 11 months
cluster: STABLE3 - add missing man pages
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: cd5b1d943b588f8bd36dae78e87db29e9c9feb7b
Parent: 28ab9a75f70b4d5bd5126d546a3a5a68f1f6bde2
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Thu May 27 08:32:18 2010 +0200
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Thu May 27 08:32:18 2010 +0200
add missing man pages
rpmdiff automatic check tool found 3 missing man pages.
Resolves: rhbz#594111
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/man/Makefile | 3 ++-
cman/man/cman_notify.8 | 17 +++++++++++++++++
group/man/Makefile | 2 ++
group/man/dlm_controld.pcmk.8 | 1 +
group/man/gfs_controld.pcmk.8 | 1 +
5 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/cman/man/Makefile b/cman/man/Makefile
index 9ed16e9..df20abb 100644
--- a/cman/man/Makefile
+++ b/cman/man/Makefile
@@ -4,7 +4,8 @@ MANTARGET= \
cman_tool.8 \
qdiskd.8 \
mkqdisk.8 \
- cmannotifyd.8
+ cmannotifyd.8 \
+ cman_notify.8
include ../../make/defines.mk
include $(OBJDIR)/make/install.mk
diff --git a/cman/man/cman_notify.8 b/cman/man/cman_notify.8
new file mode 100644
index 0000000..446bf12
--- /dev/null
+++ b/cman/man/cman_notify.8
@@ -0,0 +1,17 @@
+.TH "cman_notify" "8" "November 2008" "" "CMAN Notification Daemon"
+.SH "NAME"
+cman_notify \- CMAN Notification Daemon run-part alike script
+.SH "SYNOPSIS"
+\fBcman_notify
+.SH "DESCRIPTION"
+.PP
+The \fBcmannotifyd\fP daemon talks to CMAN and provides a mechanism to notify
+external entities about cluster changes.
+\fBcman_notify\fP script is in charge to execute all notification scripts
+in a run-part alike way.
+.SH "NOTES"
+\fBcman_notify\fP should never be called standalone except for debugging
+purposes.
+
+.SH "SEE ALSO"
+cmannotifyd(8)
diff --git a/group/man/Makefile b/group/man/Makefile
index 70387c3..7fab518 100644
--- a/group/man/Makefile
+++ b/group/man/Makefile
@@ -1,6 +1,8 @@
MANTARGET= \
dlm_controld.8 \
+ dlm_controld.pcmk.8 \
gfs_controld.8 \
+ gfs_controld.pcmk.8 \
gfs_control.8 \
group_tool.8 \
groupd.8
diff --git a/group/man/dlm_controld.pcmk.8 b/group/man/dlm_controld.pcmk.8
new file mode 100644
index 0000000..d69f41b
--- /dev/null
+++ b/group/man/dlm_controld.pcmk.8
@@ -0,0 +1 @@
+.so man8/dlm_controld.8
diff --git a/group/man/gfs_controld.pcmk.8 b/group/man/gfs_controld.pcmk.8
new file mode 100644
index 0000000..f305866
--- /dev/null
+++ b/group/man/gfs_controld.pcmk.8
@@ -0,0 +1 @@
+.so man8/gfs_controld.8
13 years, 11 months
cluster: RHEL6 - cman: fix quorum recalculation when a node is externally killed
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: f288015025489cb35230c61f82d02c3d70e4a40e
Parent: b4317363d5db48458a015ac4d4de63a5048a9509
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Wed May 26 09:51:34 2010 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Wed May 26 15:34:45 2010 +0100
cman: fix quorum recalculation when a node is externally killed
This patch fixes a condition where quorum would be incorrectly recalculated
if a node was removed from the cluster using the cman_kill_node call.
This call is used by qdisk and can cause a cluster to continue operating
when too few nodes are left in the cluster for a legitimate quorum.
rhbz#596046
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/commands.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index d50a6e0..2fe4ec9 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -971,7 +971,7 @@ static int do_cmd_leave_cluster(char *cmdbuf, int *retlen)
memcpy(&leave_flags, cmdbuf, sizeof(int));
/* Ignore the use count if FORCE is set */
- if (!(leave_flags & CLUSTER_LEAVEFLAG_FORCE)) {
+ if (!(leave_flags == CLUSTER_LEAVEFLAG_FORCE)) {
if (use_count)
return -ENOTCONN;
}
@@ -1007,7 +1007,7 @@ static void check_shutdown_status(void)
shutdown_flags & SHUTDOWN_ANYWAY) {
quit_threads = 1;
if (shutdown_flags & SHUTDOWN_REMOVE)
- leaveflags |= CLUSTER_LEAVEFLAG_REMOVED;
+ leaveflags = CLUSTER_LEAVEFLAG_REMOVED;
send_leave(leaveflags);
reply = 0;
}
@@ -2266,7 +2266,7 @@ void del_ais_node(int nodeid)
cluster_members--;
log_printf(LOGSYS_LEVEL_DEBUG, "memb: del_ais_node %s, leave_reason=%x\n", node->name, node->leave_reason);
- if ((node->leave_reason & 0xF) == CLUSTER_LEAVEFLAG_REMOVED)
+ if (node->leave_reason == CLUSTER_LEAVEFLAG_REMOVED)
recalculate_quorum(1, 1);
else
recalculate_quorum(0, 0);
13 years, 11 months
cluster: STABLE3 - cman: fix quorum recalculation when a node is externally killed
by Christine Caulfield
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 28ab9a75f70b4d5bd5126d546a3a5a68f1f6bde2
Parent: b165ce47df6f03c340abf4baa48b74368d12bf54
Author: Christine Caulfield <ccaulfie(a)redhat.com>
AuthorDate: Wed May 26 09:51:34 2010 +0100
Committer: Christine Caulfield <ccaulfie(a)redhat.com>
CommitterDate: Wed May 26 09:51:34 2010 +0100
cman: fix quorum recalculation when a node is externally killed
This patch fixes a condition where quorum would be incorrectly recalculated
if a node was removed from the cluster using the cman_kill_node call.
This call is used by qdisk and can cause a cluster to continue operating
when too few nodes are left in the cluster for a legitimate quorum.
Signed-off-by: Christine Caulfield <ccaulfie(a)redhat.com>
---
cman/daemon/commands.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index d50a6e0..2fe4ec9 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -971,7 +971,7 @@ static int do_cmd_leave_cluster(char *cmdbuf, int *retlen)
memcpy(&leave_flags, cmdbuf, sizeof(int));
/* Ignore the use count if FORCE is set */
- if (!(leave_flags & CLUSTER_LEAVEFLAG_FORCE)) {
+ if (!(leave_flags == CLUSTER_LEAVEFLAG_FORCE)) {
if (use_count)
return -ENOTCONN;
}
@@ -1007,7 +1007,7 @@ static void check_shutdown_status(void)
shutdown_flags & SHUTDOWN_ANYWAY) {
quit_threads = 1;
if (shutdown_flags & SHUTDOWN_REMOVE)
- leaveflags |= CLUSTER_LEAVEFLAG_REMOVED;
+ leaveflags = CLUSTER_LEAVEFLAG_REMOVED;
send_leave(leaveflags);
reply = 0;
}
@@ -2266,7 +2266,7 @@ void del_ais_node(int nodeid)
cluster_members--;
log_printf(LOGSYS_LEVEL_DEBUG, "memb: del_ais_node %s, leave_reason=%x\n", node->name, node->leave_reason);
- if ((node->leave_reason & 0xF) == CLUSTER_LEAVEFLAG_REMOVED)
+ if (node->leave_reason == CLUSTER_LEAVEFLAG_REMOVED)
recalculate_quorum(1, 1);
else
recalculate_quorum(0, 0);
13 years, 11 months