From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24889 invoked by alias); 31 Jul 2008 17:51:30 -0000 Received: (qmail 24883 invoked by alias); 31 Jul 2008 17:51:30 -0000 X-Spam-Status: No, hits=-0.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,J_CHICKENPOX_64,J_CHICKENPOX_84,KAM_MX,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on bastion.fedora.phx.redhat.com X-Spam-Level: Subject: STABLE2 - groupd: ignore nolock gfs To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: 9c002edb83960dcb151117e04ba1eb36c50fa243 X-Git-Newrev: 405dbcb97c1dbd5136664948f96c2bec285ac489 From: David Teigland Message-Id: <20080731175043.8B178A8257@lists.fedorahosted.org> Date: Thu, 31 Jul 2008 18:46:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00189.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=405dbcb97c1dbd5136664948f96c2bec285ac489 Commit: 405dbcb97c1dbd5136664948f96c2bec285ac489 Parent: 9c002edb83960dcb151117e04ba1eb36c50fa243 Author: David Teigland AuthorDate: Wed Jul 9 09:49:58 2008 -0500 Committer: David Teigland 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 --- 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");