[Ocfs2-tools-devel] global heartbeat tools patch-set

Sunil Mushran sunil.mushran at oracle.com
Tue Oct 26 12:48:54 PDT 2010


http://oss.oracle.com/git/?p=ocfs2-tools.git;a=shortlog;h=newo2cb-2

So I am not emailing the entire patchset as it is mostly the same
as before. Instead I have created a new branch (newo2cb-2) that has
the current set.

Two changes since the last submission:

1. new o2cb.8 manpage

2. Following change in libocfs2/dlm.c allows it to enable global
heartbeat on existing ocfs2 volumes (minus clusterinfo feature)
using --update-cluster-stack.

--- libocfs2/dlm.c    2010-10-26 11:46:25.000000000 -0700
+++ /build/smushran/git/ocfs2-tools/libocfs2/dlm.c    2010-10-26 12:01:49.928974000 -0700
@@ -141,15 +141,31 @@ errcode_t ocfs2_set_cluster_flags(ocfs2_
      int globalhb;

      sb->s_cluster_info.ci_stackflags = 0;
-    if (ocfs2_o2cb_stack(sb)) {
-        ret = o2cb_global_heartbeat_mode(desc->c_cluster, &globalhb);
-        if (ret)
-            goto out;
-        if (globalhb)
-            sb->s_cluster_info.ci_stackflags |=
-                OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT;
+
+    /* exit if userspace as it does not have any stack flags currently */
+    if (ocfs2_userspace_stack(sb))
+        goto out;
+
+    /* the stack has to be o2cb... if not it is a BUG */
+    if (strcmp(desc->c_stack, OCFS2_CLASSIC_CLUSTER_STACK)) {
+        ret = OCFS2_ET_INVALID_ARGUMENT;
+        goto out;
      }

+    /* exit if not o2cb global hb is not active */
+    ret = o2cb_global_heartbeat_mode(desc->c_cluster, &globalhb);
+    if (ret || !globalhb)
+        goto out;
+
+    /* enable clusterinfo if not yet enabled */
+    if (!ocfs2_clusterinfo_valid(sb))
+        sb->s_feature_incompat |=
+            OCFS2_FEATURE_INCOMPAT_CLUSTERINFO;
+
+    /* set the o2cb cluster flag */
+    sb->s_cluster_info.ci_stackflags |=
+        OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT;
+
  out:
      return ret;
  }



More information about the Ocfs2-tools-devel mailing list