cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/magma-plugins/sm sm.c
Date: 7 Sep 2006 18:41:24 -0000	[thread overview]
Message-ID: <20060907184124.29237.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	lhh at sourceware.org	2006-09-07 18:41:24

Modified files:
	magma-plugins/sm: sm.c 

Log message:
	Fix 146924 - segfault if cman does not give out a membership list.
	NOTE: Only for RHEL4 branch; depends on udev.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/magma-plugins/sm/sm.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.9.2.9&r2=1.9.2.10

--- cluster/magma-plugins/sm/Attic/sm.c	2006/06/16 19:54:57	1.9.2.9
+++ cluster/magma-plugins/sm/Attic/sm.c	2006/09/07 18:41:23	1.9.2.10
@@ -34,8 +34,9 @@
 #include <signal.h>
 #include <sys/types.h>
 #include <sys/select.h>
+#include <sys/stat.h>
 
-#define MODULE_DESCRIPTION "CMAN/SM Plugin v1.1.7.1"
+#define MODULE_DESCRIPTION "CMAN/SM Plugin v1.1.7.2"
 #define MODULE_AUTHOR      "Lon Hohberger"
 
 #define DLM_LS_NAME	   "Magma"
@@ -368,17 +369,23 @@
 sm_open(cluster_plugin_t *self)
 {
 	sm_priv_t *p;
+	struct stat st;
 
 	assert(self);
 	p = (sm_priv_t *)self->cp_private.p_data;
 	assert(p);
 
+	/* Check for existince of dlm control file so we don't
+	   hang in dlm_acquire_lockspace */
+	if (stat("/dev/dlm-control", &st) < 0)
+		return -1;
+
 	if (p->sockfd >= 0)
 		close(p->sockfd);
 
 	p->sockfd = socket(AF_CLUSTER, SOCK_DGRAM, CLPROTO_CLIENT);
 	if (p->sockfd < 0)
-		return -errno;
+		return -1;
 
 	return p->sockfd;
 }
@@ -601,7 +608,7 @@
                 /* Work around race: Someone was closing lockspace as
                    we were trying to open it.  Retry. */
                 if (errno == ENOENT)
-                        continue;
+			continue;
 
                 fprintf(stderr, "failed acquiring lockspace: %s\n",
                         strerror(errno));



             reply	other threads:[~2006-09-07 18:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-07 18:41 lhh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-04-23 18:24 [Cluster-devel] cluster/magma-plugins/sm sm.c lhh
2007-04-23 18:25 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=20060907184124.29237.qmail@sourceware.org \
    --to=lhh@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 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).