public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: David Teigland <teigland@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: cluster: STABLE3 - gfs_controld: fix default plock_ownership in compat mode
Date: Thu, 02 Jul 2009 21:23:00 -0000	[thread overview]
Message-ID: <20090702212326.EC66C1201EF@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=457eaf5565e2804d3c6e367e7256c23752debcef
Commit:        457eaf5565e2804d3c6e367e7256c23752debcef
Parent:        b836d0ea80be55cc9cad84a4f44a725b4a34536f
Author:        David Teigland <teigland@redhat.com>
AuthorDate:    Thu Jul 2 16:13:17 2009 -0500
Committer:     David Teigland <teigland@redhat.com>
CommitterDate: Thu Jul 2 16:16:48 2009 -0500

gfs_controld: fix default plock_ownership in compat mode

The cluster2 default is plock_owernship=0, so if running in compat mode
that should be the default.  All nodes must use the same plock_ownership
value or the protocol doesn't match (regardless of cluster2 vs cluster3)

Signed-off-by: David Teigland <teigland@redhat.com>
---
 group/gfs_controld/config.c     |   10 +++++++++-
 group/gfs_controld/gfs_daemon.h |    1 +
 group/gfs_controld/main.c       |    6 ++++++
 3 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/group/gfs_controld/config.c b/group/gfs_controld/config.c
index 0be26e5..b97e2de 100644
--- a/group/gfs_controld/config.c
+++ b/group/gfs_controld/config.c
@@ -170,6 +170,12 @@ int setup_ccs(void)
 	}
 	ccs_handle = cd;
 
+	/* plock_ownership is a special case */
+	if (optd_plock_ownership)
+		using_default_plock_ownership = 0;
+	else
+		using_default_plock_ownership = 1;
+
 	/* These config values are set from cluster.conf only if they haven't
 	   already been set on the command line. */
 
@@ -182,7 +188,9 @@ int setup_ccs(void)
 	if (!optd_plock_ownership) {
 		rv = read_ccs_int(PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership);
 		if (rv < 0)
-			read_ccs_int(DLM_PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership);
+			rv = read_ccs_int(DLM_PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership);
+		if (!rv)
+			using_default_plock_ownership = 0;
 	}
 
 	/* The following can be changed while running */
diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h
index a76c7f4..11c71c7 100644
--- a/group/gfs_controld/gfs_daemon.h
+++ b/group/gfs_controld/gfs_daemon.h
@@ -86,6 +86,7 @@ extern int group_mode;
 extern uint32_t plock_minor;
 extern uint32_t old_plock_minor;
 extern struct list_head withdrawn_mounts;
+extern int using_default_plock_ownership;
 
 void daemon_dump_save(void);
 
diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c
index 0235b26..ae59d80 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -1200,6 +1200,11 @@ static void loop(void)
 
 	} else if (group_mode == GROUP_LIBGROUP) {
 
+		/* the stable2 default is zero plock_ownership which we need
+		   to match or protocol_active will differ */
+		if (using_default_plock_ownership)
+			cfgd_plock_ownership = 0;
+
 		/*
 		 * The old, bad, way of doing things using libgroup.
 		 * code in: cpg-old.c group.c plock.c
@@ -1576,4 +1581,5 @@ int group_mode;
 uint32_t plock_minor;
 uint32_t old_plock_minor;
 struct list_head withdrawn_mounts;
+int using_default_plock_ownership;
 


                 reply	other threads:[~2009-07-02 21:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090702212326.EC66C1201EF@lists.fedorahosted.org \
    --to=teigland@fedoraproject.org \
    --cc=cluster-cvs-relay@redhat.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).