public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* STABLE2 - groupd: ignore nolock gfs
@ 2008-07-31 18:46 David Teigland
  0 siblings, 0 replies; only message in thread
From: David Teigland @ 2008-07-31 18:46 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=405dbcb97c1dbd5136664948f96c2bec285ac489
Commit:        405dbcb97c1dbd5136664948f96c2bec285ac489
Parent:        9c002edb83960dcb151117e04ba1eb36c50fa243
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Wed Jul 9 09:49:58 2008 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Thu Jul 31 12:43:38 2008 -0500

groupd: ignore nolock gfs

bz 315741

When starting up, we look for existing, "uncontrolled" gfs file systems
in the kernel (which would require the node to be rebooted.) This check
needs to ignore nolock fs's.

Signed-off-by: David Teigland <teigland@redhat.com>
---
 group/daemon/main.c |   28 ++++++++++++++++++++++++++--
 1 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/group/daemon/main.c b/group/daemon/main.c
index 2b9acc2..a32b47d 100644
--- a/group/daemon/main.c
+++ b/group/daemon/main.c
@@ -94,6 +94,29 @@ static int do_read(int fd, void *buf, size_t count)
    - we won't be in groupd cpg until after we've verified there's no
      local residual gfs/dlm state */
 
+static int ignore_gfs_nolock(char *sysfs_dir, char *table)
+{
+	char path[PATH_MAX];
+	int rv, fd;
+
+	if (!strstr(sysfs_dir, "gfs"))
+		return 0;
+
+	memset(path, 0, PATH_MAX);
+
+	snprintf(path, PATH_MAX, "%s/%s/lock_module/proto_name",
+		 sysfs_dir, table);
+
+	/* lock_nolock doesn't create the "lock_module" dir at all,
+	   so we'll fail to open this */
+
+	fd = open(path, O_RDONLY);
+	if (fd < 0)
+		return 1;
+
+	return 0;
+}
+
 static int kernel_instance_count(char *sysfs_dir)
 {
 	char path[PATH_MAX];
@@ -112,6 +135,9 @@ static int kernel_instance_count(char *sysfs_dir)
 		if (de->d_name[0] == '.')
 			continue;
 
+		if (ignore_gfs_nolock(sysfs_dir, de->d_name))
+			continue;
+
 		log_print("found uncontrolled kernel object %s in %s",
 			  de->d_name, sysfs_dir);
 		rv++;
@@ -126,8 +152,6 @@ int check_uncontrolled_groups(void)
 	char *argv[4];
 	int status, rv = 0;
 
-	/* FIXME: ignore gfs/gfs2 nolock fs's */
-
 	rv += kernel_instance_count("/sys/kernel/dlm");
 	rv += kernel_instance_count("/sys/fs/gfs");
 	rv += kernel_instance_count("/sys/fs/gfs2");


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-31 17:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-31 18:46 STABLE2 - groupd: ignore nolock gfs David 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 read-only IMAP folder(s) and NNTP newsgroup(s).