[Ocfs2-tools-devel] [PATCH 27/32] tools: Detect differing cluster name and heartbeat modes

Sunil Mushran sunil.mushran at oracle.com
Tue Sep 14 15:54:57 PDT 2010


When tunefs and fsck detect differences between ondisk and active cluster
stack, they ask the user whether to change the ondisk configuration.

This patch asks the user the same question when the cluster name and
o2cb heartbeat modes are different.

Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 fsck.ocfs2/fsck.c         |    4 +++-
 tunefs.ocfs2/libocfs2ne.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/fsck.ocfs2/fsck.c b/fsck.ocfs2/fsck.c
index a3c14b5..e032dfd 100644
--- a/fsck.ocfs2/fsck.c
+++ b/fsck.ocfs2/fsck.c
@@ -845,7 +845,9 @@ int main(int argc, char **argv)
 
 		block_signals(SIG_BLOCK);
 		ret = ocfs2_initialize_dlm(ost->ost_fs, whoami);
-		if (ret == O2CB_ET_INVALID_STACK_NAME) {
+		if (ret == O2CB_ET_INVALID_STACK_NAME ||
+		    ret == O2CB_ET_INVALID_CLUSTER_NAME ||
+		    ret == O2CB_ET_INVALID_HEARTBEAT_MODE) {
 			block_signals(SIG_UNBLOCK);
 			ret = recover_cluster_info(ost);
 			if (ret) {
diff --git a/tunefs.ocfs2/libocfs2ne.c b/tunefs.ocfs2/libocfs2ne.c
index 26e368c..a519866 100644
--- a/tunefs.ocfs2/libocfs2ne.c
+++ b/tunefs.ocfs2/libocfs2ne.c
@@ -1357,7 +1357,9 @@ static errcode_t tunefs_lock_cluster(ocfs2_filesys *fs, int flags)
 
 		err = ocfs2_initialize_dlm(master_fs, WHOAMI);
 		if (flags & TUNEFS_FLAG_NOCLUSTER) {
-			if (err == O2CB_ET_INVALID_STACK_NAME) {
+			if (err == O2CB_ET_INVALID_STACK_NAME ||
+			    err == O2CB_ET_INVALID_CLUSTER_NAME ||
+			    err == O2CB_ET_INVALID_HEARTBEAT_MODE) {
 				/*
 				 * We expected this - why else ask for
 				 * TUNEFS_FLAG_NOCLUSTER?
-- 
1.7.0.4




More information about the Ocfs2-tools-devel mailing list