This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RHEL5 - groupd: ignore nolock gfs


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=aee3ab578619a22e03cc9c9d024647927df479b0
Commit:        aee3ab578619a22e03cc9c9d024647927df479b0
Parent:        bf130aa9983f13ab5b2a40181680fc2c35f1f3e1
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:40:30 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 19fbf48..c80a024 100644
--- a/group/daemon/main.c
+++ b/group/daemon/main.c
@@ -106,6 +106,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];
@@ -124,6 +147,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++;
@@ -138,8 +164,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");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]