gfs2-utils: master - gfs_controld: Fix if-statement in shutdown_callback

Andrew Price andyp at fedoraproject.org
Fri Sep 16 14:47:41 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=44fce5b34d7fad6e3a580fd8c917ce5a1d055c5f
Commit:        44fce5b34d7fad6e3a580fd8c917ce5a1d055c5f
Parent:        2e210657077be76fca37f377ef671842d4ebccaa
Author:        Andrew Price <anprice at redhat.com>
AuthorDate:    Thu Sep 15 15:51:47 2011 +0100
Committer:     Andrew Price <anprice at redhat.com>
CommitterDate: Thu Sep 15 15:57:55 2011 +0100

gfs_controld: Fix if-statement in shutdown_callback

Coverity picked up on an issue in shutdown_callback() where if (flags &
COROSYNC_CFG_SHUTDOWN_FLAG_REQUEST) is always false, so the true-block
is never entered. Since the flags aren't really flags we can fix this by
changing the & to ==

Signed-off-by: Andrew Price <anprice at redhat.com>
---
 group/gfs_controld/member_cman.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/group/gfs_controld/member_cman.c b/group/gfs_controld/member_cman.c
index 4e482b7..6d0e743 100644
--- a/group/gfs_controld/member_cman.c
+++ b/group/gfs_controld/member_cman.c
@@ -142,7 +142,7 @@ void kick_node_from_cluster(int nodeid)
 static void shutdown_callback(corosync_cfg_handle_t h,
 			      corosync_cfg_shutdown_flags_t flags)
 {
-	if (flags & COROSYNC_CFG_SHUTDOWN_FLAG_REQUEST) {
+	if (flags == COROSYNC_CFG_SHUTDOWN_FLAG_REQUEST) {
 		if (list_empty(&mountgroups))
 			corosync_cfg_replyto_shutdown(ch,
 					COROSYNC_CFG_SHUTDOWN_FLAG_YES);


More information about the cluster-commits mailing list