From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24514 invoked by alias); 31 Jul 2008 17:49:47 -0000 Received: (qmail 24508 invoked by alias); 31 Jul 2008 17:49:47 -0000 X-Spam-Status: No, hits=-0.3 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: RHEL5 - groupd: ignore nolock gfs To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: bf130aa9983f13ab5b2a40181680fc2c35f1f3e1 X-Git-Newrev: aee3ab578619a22e03cc9c9d024647927df479b0 From: David Teigland Message-Id: <20080731174902.0F195A8257@lists.fedorahosted.org> Date: Thu, 31 Jul 2008 17:51: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/msg00188.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=aee3ab578619a22e03cc9c9d024647927df479b0 Commit: aee3ab578619a22e03cc9c9d024647927df479b0 Parent: bf130aa9983f13ab5b2a40181680fc2c35f1f3e1 Author: David Teigland AuthorDate: Wed Jul 9 09:49:58 2008 -0500 Committer: David Teigland 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 --- 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");