cluster: RHEL510 - fenced: additional fixes for /dev/zero bug

Christine Caulfield chrissie at fedoraproject.org
Fri Apr 19 07:52:14 UTC 2013


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=d45ceaa6e243733f801ce6aa8519d741a1801e34
Commit:        d45ceaa6e243733f801ce6aa8519d741a1801e34
Parent:        334a6b9cb3cda250444c8d3192d3ab33e70ad923
Author:        Christine Caulfield <ccaulfie at redhat.com>
AuthorDate:    Fri Apr 19 08:47:29 2013 +0100
Committer:     Christine Caulfield <ccaulfie at redhat.com>
CommitterDate: Fri Apr 19 08:47:29 2013 +0100

fenced: additional fixes for /dev/zero bug

Patch 60dd70f06444939ea14bb6a40cfb61ab1eea9616 was not the full
fix for that bug. This patch fixes one place where the correct
fd was not updated and also corrects the shutdown code so
that it's not dependant on which fd (zero or cman) is active.

Resolves rhbz#951049

Signed-off-by: Christine Caulfield <ccaulfie at redhat.com>
---
 fence/fenced/main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fence/fenced/main.c b/fence/fenced/main.c
index 72961f5..3163905 100644
--- a/fence/fenced/main.c
+++ b/fence/fenced/main.c
@@ -549,11 +549,11 @@ static int loop(void)
 	client_add(groupd_fd, &maxi);
 
 	log_debug("listen %d member %d groupd %d",
-		  listen_fd, member_fd, groupd_fd);
+		  listen_fd, client[cluster_fd_pos].fd, groupd_fd);
 
 	for (;;) {
                 /* We need to re-get the cluster FD eac time */
-		pollfd[cluster_fd_pos].fd = get_member_fd();
+		pollfd[cluster_fd_pos].fd = client[cluster_fd_pos].fd = get_member_fd();
 		rv = poll(pollfd, maxi + 1, -1);
 		if (rv < 0) {
 			if (errno == EINTR)
@@ -575,7 +575,7 @@ static int loop(void)
 			if (client[i].fd < 0)
 				continue;
 			if (pollfd[i].revents & (POLLERR | POLLHUP | POLLNVAL)) {
-				if (pollfd[i].fd == member_fd) {
+				if (i == cluster_fd_pos) {
 					log_error("cluster is down, exiting");
 					exit(1);
 				}
@@ -587,7 +587,7 @@ static int loop(void)
 			} else if (pollfd[i].revents & POLLIN) {
 				if (pollfd[i].fd == groupd_fd)
 					process_groupd();
-				else if (pollfd[i].fd == member_fd)
+				else if (i == cluster_fd_pos)
 					process_member();
 				else
 					client_process(i);


More information about the cluster-commits mailing list