[Ocfs2-tools-devel] help

Fernando Cunha fcn_08 at hotmail.com
Fri Jan 10 12:29:44 PST 2014



-----Mensagem Original----- 
From: ocfs2-tools-devel-request at oss.oracle.com
Sent: Friday, January 10, 2014 6:09 PM
To: ocfs2-tools-devel at oss.oracle.com
Subject: Ocfs2-tools-devel Digest, Vol 89, Issue 1

Send Ocfs2-tools-devel mailing list submissions to
ocfs2-tools-devel at oss.oracle.com

To subscribe or unsubscribe via the World Wide Web, visit
https://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel
or, via email, send a message with subject or body 'help' to
ocfs2-tools-devel-request at oss.oracle.com

You can reach the person managing the list at
ocfs2-tools-devel-owner at oss.oracle.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Ocfs2-tools-devel digest..."


Today's Topics:

   1. [PATCH 0/5] nocontrold: Eliminating ocfs2_controld
      (Goldwyn Rodrigues)
   2. [PATCH 1/5] Use cmap for getting cluster name (Goldwyn Rodrigues)
   3. [PATCH 2/5] Remove controld dependency in group_join/leave
      (Goldwyn Rodrigues)
   4. [PATCH 3/5] Auto setup cluster_stack based on what is on disk
      (Goldwyn Rodrigues)
   5. [PATCH 4/5] mkfs.ocfs2: Abort if cluster information is not
      detected (Goldwyn Rodrigues)
   6. [PATCH 5/5] mkfs: Setup cluster_stack if not setup based on
      args (Goldwyn Rodrigues)


----------------------------------------------------------------------

Message: 1
Date: Fri, 10 Jan 2014 14:07:56 -0600
From: Goldwyn Rodrigues <rgoldwyn at suse.de>
Subject: [Ocfs2-tools-devel] [PATCH 0/5] nocontrold: Eliminating
ocfs2_controld
To: ocfs2-tools-devel at oss.oracle.com
Message-ID: <20140110200751.GA7317 at shrek.lan>
Content-Type: text/plain; charset=us-ascii

This is an effort of removing ocfs2_controld.pcmk and getting ocfs2 DLM
handling up to the times with respect to DLM (>=4.0.1) and corosync
(2.3.x). AFAIK, cman also is being phased out for a unified corosync
cluster stack.

This is the tools counterpart of the kernel effort which went in the
linux-next tree recently. I have also tried to auto-setup cluster-stack
based on the *first* mount super block. This would reduce our dependency
on scripts and eliminate the requirement for o2cb resource
configuration in cluster management.

[1] https://github.com/goldwynr/ocfs2-tools/tree/nocontrold
[2] https://github.com/goldwynr/linux-stable/tree/nocontrold

-- 
Goldwyn



------------------------------

Message: 2
Date: Fri, 10 Jan 2014 14:08:15 -0600
From: Goldwyn Rodrigues <rgoldwyn at suse.de>
Subject: [Ocfs2-tools-devel] [PATCH 1/5] Use cmap for getting cluster
name
To: ocfs2-tools-devel at oss.oracle.com
Message-ID: <20140110200810.GA7366 at shrek.lan>
Content-Type: text/plain; charset=us-ascii

Use the cmap library to get the running cluster name from corosync.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com>
---
debugfs.ocfs2/Makefile |  2 +-
libo2cb/o2cb_abi.c     | 79 
+++++++++++++++++++++++++++-----------------------
o2cb.pc.in             |  2 +-
o2cb_ctl/Makefile      |  2 +-
4 files changed, 46 insertions(+), 39 deletions(-)

diff --git a/debugfs.ocfs2/Makefile b/debugfs.ocfs2/Makefile
index ca4c9a4..30dfa5f 100644
--- a/debugfs.ocfs2/Makefile
+++ b/debugfs.ocfs2/Makefile
@@ -32,7 +32,7 @@ HFILES = \
OBJS = $(subst .c,.o,$(CFILES))

LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb $(DL_LIBS)

MANS = debugfs.ocfs2.8

diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
index ae03595..40f8176 100644
--- a/libo2cb/o2cb_abi.c
+++ b/libo2cb/o2cb_abi.c
@@ -35,6 +35,8 @@
#include <errno.h>
#include <limits.h>
#include <ctype.h>
+#include <dlfcn.h>
+#include <corosync/cmap.h>

#include <linux/types.h>

@@ -1966,52 +1968,57 @@ static errcode_t classic_list_clusters(char 
***clusters)

static errcode_t user_list_clusters(char ***clusters)
{
- errcode_t err = O2CB_ET_SERVICE_UNAVAILABLE;
- int rc, fd = -1;
- char buf[OCFS2_CONTROLD_MAXLINE];
+ errcode_t ret = O2CB_ET_SERVICE_UNAVAILABLE;
+ void *lib_handle = NULL;
+ char **list;
+ int rv;

- rc = ocfs2_client_connect();
- if (rc < 0) {
- /* fprintf(stderr, "Unable to connect to ocfs2_controld: %s\n",
- strerror(-rc)); */
- switch (rc) {
- case -EACCES:
- case -EPERM:
- err = O2CB_ET_PERMISSION_DENIED;
- break;
+ cmap_handle_t handle;
+ static int (*initialize)(cmap_handle_t *handle);
+ static int (*get_string)(cmap_handle_t handle,
+ const char *string,
+ char **name);
+ static int (*finalize)(cmap_handle_t handle);

- default:
- err = O2CB_ET_SERVICE_UNAVAILABLE;
- break;
- }
+
+ lib_handle = dlopen("libcmap.so", RTLD_NOW | RTLD_LOCAL);
+ if (!lib_handle)
+ return ret;
+
+ initialize = dlsym(lib_handle, "cmap_initialize");
+ if (!initialize)
  goto out;
- }
- fd = rc;

- rc = send_message(fd, CM_LISTCLUSTERS);
- if (rc) {
- /* fprintf(stderr,
- "Unable to send LISTCLUSTERS message: %s\n",
- strerror(-rc)); */
- err = O2CB_ET_IO;
+ get_string = dlsym(lib_handle, "cmap_get_string");
+ if (!get_string)
  goto out;
- }

- rc = receive_list(fd, buf, clusters);
- if (rc) {
- /* fprintf(stderr, "Error reading from daemon: %s\n",
- strerror(-rc)); */
- err = O2CB_ET_IO;
+ finalize = dlsym(lib_handle, "cmap_finalize");
+ if (!finalize)
  goto out;
- }

- err = 0;
+ rv = initialize(&handle);
+ if (rv != CS_OK)
+ goto out;

-out:
- if (fd != -1)
- close(fd);
+ list = (char **)malloc(sizeof(char *) * 2);
+ if (!list)
+ goto out;

- return err;
+ rv = get_string(handle, "totem.cluster_name", &list[0]);
+ if (rv != CS_OK) {
+ free(list);
+ ret = O2CB_ET_INTERNAL_FAILURE;
+ goto out;
+ }
+
+ list[1] = NULL;
+ *clusters = list;
+ finalize(handle);
+ ret = 0;
+out:
+ dlclose(lib_handle);
+ return ret;
}

errcode_t o2cb_list_clusters(char ***clusters)
diff --git a/o2cb.pc.in b/o2cb.pc.in
index be94b8a..f13c560 100644
--- a/o2cb.pc.in
+++ b/o2cb.pc.in
@@ -7,5 +7,5 @@ Name: o2cb
Description: Library for accessing the ocfs2 cluster base (o2cb)
Version: @VERSION@
Requires: com_err
-Libs: -L${libdir} -lo2cb
+Libs: -L${libdir} -lo2cb -ldl
Cflags: -I${includedir}
diff --git a/o2cb_ctl/Makefile b/o2cb_ctl/Makefile
index 5efcab4..8589748 100644
--- a/o2cb_ctl/Makefile
+++ b/o2cb_ctl/Makefile
@@ -13,7 +13,7 @@ LIBTOOLS_INTERNAL_DEPS = 
$(TOPDIR)/libtools-internal/libtools-internal.a
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a

-LIBO2CB_LIBS  = -L$(TOPDIR)/libo2cb -lo2cb
+LIBO2CB_LIBS  = -L$(TOPDIR)/libo2cb -lo2cb $(DL_LIBS)
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a

LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
-- 
1.8.4


-- 
Goldwyn



------------------------------

Message: 3
Date: Fri, 10 Jan 2014 14:08:33 -0600
From: Goldwyn Rodrigues <rgoldwyn at suse.de>
Subject: [Ocfs2-tools-devel] [PATCH 2/5] Remove controld dependency in
group_join/leave
To: ocfs2-tools-devel at oss.oracle.com
Message-ID: <20140110200827.GA7371 at shrek.lan>
Content-Type: text/plain; charset=us-ascii

Well, this is pretty much empty because we don't have to do any
initializations as such. Should we perform any checks here?

Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com>
---
libo2cb/o2cb_abi.c | 156 
+++--------------------------------------------------
1 file changed, 7 insertions(+), 149 deletions(-)

diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
index 40f8176..5eca49d 100644
--- a/libo2cb/o2cb_abi.c
+++ b/libo2cb/o2cb_abi.c
@@ -1373,164 +1373,22 @@ static errcode_t user_parse_status(char **args, int 
*error, char **error_msg)
}

static errcode_t user_begin_group_join(struct o2cb_cluster_desc *cluster,
-        struct o2cb_region_desc *region)
+ struct o2cb_region_desc *region)
{
- errcode_t err;
- int rc;
- int error;
- char *error_msg;
- client_message message;
- char *argv[OCFS2_CONTROLD_MAXARGS + 1];
- char buf[OCFS2_CONTROLD_MAXLINE];
-
- if (control_daemon_fd != -1) {
- /* fprintf(stderr, "Join already in progress!\n"); */
- err = O2CB_ET_INTERNAL_FAILURE;
- goto out;
- }
-
- rc = ocfs2_client_connect();
- if (rc < 0) {
- /* fprintf(stderr, "Unable to connect to ocfs2_controld: %s\n",
- strerror(-rc)); */
- switch (rc) {
- case -EACCES:
- case -EPERM:
- err = O2CB_ET_PERMISSION_DENIED;
- break;
-
- default:
- err = O2CB_ET_SERVICE_UNAVAILABLE;
- break;
- }
- goto out;
- }
- control_daemon_fd = rc;
-
- rc = send_message(control_daemon_fd, CM_MOUNT, OCFS2_FS_NAME,
-   region->r_name, cluster->c_cluster,
-   region->r_device_name, region->r_service);
- if (rc) {
- /* fprintf(stderr, "Unable to send MOUNT message: %s\n",
- strerror(-rc)); */
- err = O2CB_ET_IO;
- goto out;
- }
-
- rc = receive_message(control_daemon_fd, buf, &message, argv);
- if (rc < 0) {
- /* fprintf(stderr, "Error reading from daemon: %s\n",
- strerror(-rc)); */
- err = O2CB_ET_IO;
- goto out;
- }
-
- switch (message) {
- case CM_STATUS:
- err = user_parse_status(argv, &error, &error_msg);
- if (err) {
- /* fprintf(stderr, "Bad status message: %s\n",
- strerror(-rc)); */
- goto out;
- }
- if (error && (error != EALREADY)) {
- /* fprintf(stderr,
- "Error %d from daemon: %s\n",
- error, error_msg); */
- err = O2CB_ET_CONFIGURATION_ERROR;
- goto out;
- }
- break;
-
- default:
- /* fprintf(stderr,
- "Unexpected message %s from daemon\n",
- message_to_string(message)); */
- err = O2CB_ET_INTERNAL_FAILURE;
- goto out;
- break;
- }
-
- err = 0;
+ errcode_t ret = 0;

-out:
- if (err && (control_daemon_fd != -1)) {
- close(control_daemon_fd);
- control_daemon_fd = -1;
- }
+ ret = o2cb_validate_cluster_name(cluster);
+ if (ret)
+ return ret;

- return err;
+ return ret;
}

static errcode_t user_complete_group_join(struct o2cb_cluster_desc *cluster,
    struct o2cb_region_desc *region,
    int result)
{
- errcode_t err = O2CB_ET_SERVICE_UNAVAILABLE;
- int rc;
- int error;
- char *error_msg;
- client_message message;
- char *argv[OCFS2_CONTROLD_MAXARGS + 1];
- char buf[OCFS2_CONTROLD_MAXLINE];
-
- if (control_daemon_fd == -1) {
- /* fprintf(stderr, "Join not started!\n"); */
- err = O2CB_ET_SERVICE_UNAVAILABLE;
- goto out;
- }
-
- rc = send_message(control_daemon_fd, CM_MRESULT, OCFS2_FS_NAME,
-   region->r_name, result, region->r_service);
- if (rc) {
- /* fprintf(stderr, "Unable to send MRESULT message: %s\n",
- strerror(-rc)); */
- err = O2CB_ET_IO;
- goto out;
- }
-
- rc = receive_message(control_daemon_fd, buf, &message, argv);
- if (rc < 0) {
- /* fprintf(stderr, "Error reading from daemon: %s\n",
- strerror(-rc)); */
- err = O2CB_ET_IO;
- goto out;
- }
-
- switch (message) {
- case CM_STATUS:
- err = user_parse_status(argv, &error, &error_msg);
- if (err) {
- /* fprintf(stderr, "Bad status message: %s\n",
- strerror(-rc)); */
- goto out;
- }
- if (error) {
- /* fprintf(stderr,
- "Error %d from daemon: %s\n",
- error, error_msg); */
- err = O2CB_ET_CONFIGURATION_ERROR;
- }
- break;
-
- default:
- /* fprintf(stderr,
- "Unexpected message %s from daemon\n",
- message_to_string(message)); */
- err = O2CB_ET_INTERNAL_FAILURE;
- goto out;
- break;
- }
-
- err = 0;
-
-out:
- if (control_daemon_fd != -1) {
- close(control_daemon_fd);
- control_daemon_fd = -1;
- }
-
- return err;
+ return 0;
}

static errcode_t user_group_leave(struct o2cb_cluster_desc *cluster,
-- 
1.8.4


-- 
Goldwyn



------------------------------

Message: 4
Date: Fri, 10 Jan 2014 14:08:50 -0600
From: Goldwyn Rodrigues <rgoldwyn at suse.de>
Subject: [Ocfs2-tools-devel] [PATCH 3/5] Auto setup cluster_stack
based on what is on disk
To: ocfs2-tools-devel at oss.oracle.com
Message-ID: <20140110200846.GA7375 at shrek.lan>
Content-Type: text/plain; charset=us-ascii

This happens only the first time.
mount.ocfs2 reads the stack from the filesystems superblock. If the
stack is not setup, it will modprobe the modules and write the
appropriate stack name to cluster_stack file.
If it is already present, it tries to edit/re-write it, if different.
If it fails, the mount fails.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com>
---
include/o2cb/o2cb.h       |   1 +
libo2cb/o2cb_abi.c        | 104 
++++++++++++++++++++++++++++++++++++++++++++++
mount.ocfs2/mount.ocfs2.c |   6 +++
3 files changed, 111 insertions(+)

diff --git a/include/o2cb/o2cb.h b/include/o2cb/o2cb.h
index d512cf9..5ef9754 100644
--- a/include/o2cb/o2cb.h
+++ b/include/o2cb/o2cb.h
@@ -208,5 +208,6 @@ void o2cb_control_close(void);
errcode_t o2cb_control_node_down(const char *uuid, unsigned int nodeid);

errcode_t o2cb_get_hb_ctl_path(char *buf, int count);
+errcode_t o2cb_setup_stack(char *stack_name);

#endif  /* _O2CB_H */
diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
index 5eca49d..c751abf 100644
--- a/libo2cb/o2cb_abi.c
+++ b/libo2cb/o2cb_abi.c
@@ -29,6 +29,7 @@
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/sem.h>
+#include <sys/wait.h>
#include <dirent.h>
#include <fcntl.h>
#include <unistd.h>
@@ -145,6 +146,22 @@ static ssize_t read_single_line_file(const char *file, 
char *line,
  return ret;
}

+static int write_single_line_file(char *filename, char *line, size_t count)
+{
+ ssize_t ret = 0;
+ FILE *f;
+
+ f = fopen(filename, "w");
+ if (f) {
+ if (fputs(line, f))
+ ret = strlen(line);
+ fclose(f);
+ } else
+ ret = -errno;
+
+ return ret;
+}
+
static ssize_t read_stack_file(char *line, size_t count)
{
  return read_single_line_file(CLUSTER_STACK_FILE, line, count);
@@ -2383,3 +2400,90 @@ errcode_t o2cb_get_hb_ctl_path(char *buf, int count)

  return 0;
}
+
+#define MODPROBE_COMMAND "/sbin/modprobe"
+#define USER_KERNEL_MODULE "ocfs2_stack_user"
+#define O2CB_KERNEL_MODULE "ocfs2_stack_o2cb"
+
+static int perform_modprobe(char *module_name)
+{
+ pid_t child;
+ int child_status;
+
+ char *argv[3];
+
+ argv[0] = MODPROBE_COMMAND;
+ argv[1] = module_name;
+ argv[2] = NULL;
+
+ child = fork();
+ if (child == 0) {
+ execv(MODPROBE_COMMAND, argv);
+ /* If execv fails, we have a problem */
+ return -EINVAL;
+ } else
+ wait(&child_status);
+
+ return child_status;
+}
+
+errcode_t o2cb_setup_stack(char *stack_name)
+{
+ char line[64];
+ int modprobe_performed = 0, write_performed = 0;
+ errcode_t err = O2CB_ET_SERVICE_UNAVAILABLE;
+ int len;
+
+redo:
+ len = read_single_line_file(CLUSTER_STACK_FILE, line, sizeof(line));
+
+ if (len > 0) {
+ if (line[len - 1] == '\n') {
+ line[len - 1] = '\0';
+ len--;
+ }
+
+ if (len != OCFS2_STACK_LABEL_LEN) {
+ err = O2CB_ET_INTERNAL_FAILURE;
+ goto out;
+ }
+
+ if (!strncmp(line, stack_name, OCFS2_STACK_LABEL_LEN)) {
+ err = 0;
+ goto out;
+ }
+
+ if (!write_performed) {
+ write_single_line_file(CLUSTER_STACK_FILE, stack_name,
+ strlen(stack_name));
+ write_performed = 1;
+ goto redo;
+ }
+
+ } else if (len == -ENOENT) {
+ if (!modprobe_performed) {
+ perform_modprobe("ocfs2");
+ if ((!strncmp(stack_name, OCFS2_PCMK_CLUSTER_STACK,
+ OCFS2_STACK_LABEL_LEN)) ||
+ (!strncmp(stack_name, OCFS2_CMAN_CLUSTER_STACK,
+ OCFS2_STACK_LABEL_LEN)))
+ perform_modprobe(USER_KERNEL_MODULE);
+ else if (!strncmp(stack_name, classic_stack.s_name,
+ OCFS2_STACK_LABEL_LEN))
+ perform_modprobe(O2CB_KERNEL_MODULE);
+
+ write_single_line_file(CLUSTER_STACK_FILE, stack_name,
+ OCFS2_STACK_LABEL_LEN);
+ write_performed = 1;
+ goto redo;
+ } else
+ err = O2CB_ET_INTERNAL_FAILURE;
+ } else {
+ err = O2CB_ET_INTERNAL_FAILURE;
+ goto out;
+ }
+
+ err = 0;
+out:
+ return err;
+}
diff --git a/mount.ocfs2/mount.ocfs2.c b/mount.ocfs2/mount.ocfs2.c
index f2ca5cb..c009d82 100644
--- a/mount.ocfs2/mount.ocfs2.c
+++ b/mount.ocfs2/mount.ocfs2.c
@@ -357,6 +357,12 @@ int main(int argc, char **argv)
  if (verbose)
  printf("device=%s\n", mo.dev);

+ ret = o2cb_setup_stack((char 
*)OCFS2_RAW_SB(fs->fs_super)->s_cluster_info.ci_stack);
+ if (ret) {
+ com_err(progname, ret, "while setting up stack\n");
+ goto bail;
+ }
+
  if (clustered) {
  ret = o2cb_init();
  if (ret) {
-- 
1.8.4


-- 
Goldwyn



------------------------------

Message: 5
Date: Fri, 10 Jan 2014 14:09:09 -0600
From: Goldwyn Rodrigues <rgoldwyn at suse.de>
Subject: [Ocfs2-tools-devel] [PATCH 4/5] mkfs.ocfs2: Abort if cluster
information is not detected
To: ocfs2-tools-devel at oss.oracle.com
Message-ID: <20140110200858.GA7380 at shrek.lan>
Content-Type: text/plain; charset=us-ascii

If there is no cluster_stack file, mkfs.ocfs2 aborts.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com>
---
mkfs.ocfs2/check.c | 19 +++++++++++++++----
mkfs.ocfs2/mkfs.h  |  2 +-
2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/mkfs.ocfs2/check.c b/mkfs.ocfs2/check.c
index f05dc72..75f0e7b 100644
--- a/mkfs.ocfs2/check.c
+++ b/mkfs.ocfs2/check.c
@@ -33,7 +33,7 @@ int is_classic_stack(char *stack_name)
}

/* For ocfs2_fill_cluster_information().  Errors are to be ignored */
-void cluster_fill(char **stack_name, char **cluster_name, uint8_t 
*stack_flags)
+errcode_t cluster_fill(char **stack_name, char **cluster_name, uint8_t 
*stack_flags)
{
  errcode_t err;
  struct o2cb_cluster_desc cluster;
@@ -44,11 +44,11 @@ void cluster_fill(char **stack_name, char 
**cluster_name, uint8_t *stack_flags)

  err = o2cb_init();
  if (err)
- return;
+ goto out;

  err = o2cb_running_cluster_desc(&cluster);
  if (err)
- return;
+ goto out;

  if (cluster.c_stack) {
  /*
@@ -59,6 +59,8 @@ void cluster_fill(char **stack_name, char **cluster_name, 
uint8_t *stack_flags)
  *cluster_name = cluster.c_cluster;
  *stack_flags = cluster.c_flags;
  }
+out:
+ return err;
}

/* For ocfs2_fill_cluster_information().  Errors are to be ignored */
@@ -132,6 +134,7 @@ int ocfs2_fill_cluster_information(State *s)
  uint8_t user_stack_flags, o2cb_stack_flags, disk_stack_flags;
  int clusterinfo = 0, userspace = 0;
  int ret = -1;
+ errcode_t err;

  if (s->mount == MOUNT_LOCAL)
  return 0;
@@ -139,7 +142,15 @@ int ocfs2_fill_cluster_information(State *s)
  *user_value = *o2cb_value = *disk_value = '\0';

  /* get currently active cluster stack */
- cluster_fill(&o2cb_stack_name, &o2cb_cluster_name, &o2cb_stack_flags);
+ err = cluster_fill(&o2cb_stack_name, &o2cb_cluster_name, 
&o2cb_stack_flags);
+ if (err && !s->cluster_stack) {
+ com_err(s->progname, 0, "Could not determine cluster "
+ "information.\nEither load the correct kernel module"
+ ", set the cluster_stack and start cluster "
+ "services, or provide --cluster-stack and "
+ "--cluster-name command line arguments.\n");
+ return -1;
+ }

  /* get cluster stack configured on disk */
  disk_fill(s->device_name, &disk_stack_name, &disk_cluster_name,
diff --git a/mkfs.ocfs2/mkfs.h b/mkfs.ocfs2/mkfs.h
index 13b4fb5..ca2004c 100644
--- a/mkfs.ocfs2/mkfs.h
+++ b/mkfs.ocfs2/mkfs.h
@@ -243,6 +243,6 @@ struct _State {
};

int is_classic_stack(char *stack_name);
-void cluster_fill(char **stack_name, char **cluster_name, uint8_t 
*stack_flags);
+errcode_t cluster_fill(char **stack_name, char **cluster_name, uint8_t 
*stack_flags);
int ocfs2_fill_cluster_information(State *s);
int ocfs2_check_volume(State *s);
-- 
1.8.4


-- 
Goldwyn



------------------------------

Message: 6
Date: Fri, 10 Jan 2014 14:09:30 -0600
From: Goldwyn Rodrigues <rgoldwyn at suse.de>
Subject: [Ocfs2-tools-devel] [PATCH 5/5] mkfs: Setup cluster_stack if
not setup based on args
To: ocfs2-tools-devel at oss.oracle.com
Message-ID: <20140110200924.GA7385 at shrek.lan>
Content-Type: text/plain; charset=us-ascii

Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.com>
---
mkfs.ocfs2/check.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/mkfs.ocfs2/check.c b/mkfs.ocfs2/check.c
index 75f0e7b..865dcc3 100644
--- a/mkfs.ocfs2/check.c
+++ b/mkfs.ocfs2/check.c
@@ -350,6 +350,15 @@ int ocfs2_check_volume(State *s)
  goto nolock;

  if (!s->force) {
+ if (s->cluster_stack) {
+ ret = o2cb_setup_stack(s->cluster_stack);
+ if (ret) {
+ com_err(s->progname, ret,
+ "while setting up stack\n");
+ return -1;
+ }
+ }
+
  ret = o2cb_init();
  if (ret) {
  com_err(s->progname, ret,
-- 
1.8.4


-- 
Goldwyn



------------------------------

_______________________________________________
Ocfs2-tools-devel mailing list
Ocfs2-tools-devel at oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel

End of Ocfs2-tools-devel Digest, Vol 89, Issue 1
************************************************ 




More information about the Ocfs2-tools-devel mailing list