Accepting request 198841 from network:ha-clustering:Factory
Update for 13.1 - Move static libraries to devel-static subpackage. - mkfs.ocfs2/tunefs.ocfs2 may hang there because of dlm_unlock +bug-838705-change_dlm_lib.patch - mkfs.ocfs2 aborts if cluster information is not found/supplied + 0009-mkfs.ocfs2-Abort-if-cluster-information-is-not-detec.patch - Make mount.ocfs2 load ocfs2 kmp and setup cluster_stack if not found + 0008-mount.ocfs2-Read-stack-from-device-and-setup-stack-i.patch - Mark o2cb.ocf as obsolete. Anyone using o2cb.ocf will get an info message stating so. - The nocontrold effort (added nocontrold patches and disabled corosync-2.3 controld compatibility patches): + 0001-libo2cb-Remove-controld-actions-from-group-join-leav.patch + 0002-libo2cb-Remove-rest-of-controld-functions.patch + 0003-Get-cluster-name-from-corosync-cmap.patch + 0004-Remove-controld-structures-from-debugfs.ocfs2.patch + 0005-Check-for-DLM-kernel-version-in-user_begin_group_joi.patch + 0006-Add-cmap-and-dlm-libraries-in-the-tools.patch - 0001-Remove-pacemaker-ais-stuff.patch - 0002-Add-corosync-cfg-to-get-configuration-information.patch - 0003-Remove-daemon-protocol-versions-and-consolidate-fs-v.patch - 0005-Add-cluster_name-and-stack-name.patch - libocfs2-Change-asserts-to-error.patch: Return control to fsck.ocfs2 instead of erring OBS-URL: https://build.opensuse.org/request/show/198841 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ocfs2-tools?expand=0&rev=52
This commit is contained in:
commit
75ab3380d3
181
0001-libo2cb-Remove-controld-actions-from-group-join-leav.patch
Normal file
181
0001-libo2cb-Remove-controld-actions-from-group-join-leav.patch
Normal file
@ -0,0 +1,181 @@
|
||||
From 2d1b78517ff14633f4b1cf4adddf6308721f9722 Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Mon, 19 Aug 2013 08:20:32 -0500
|
||||
Subject: [PATCH 1/7] libo2cb: Remove controld actions from group join/leave
|
||||
|
||||
---
|
||||
libo2cb/o2cb_abi.c | 152 +----------------------------------------------------
|
||||
1 file changed, 2 insertions(+), 150 deletions(-)
|
||||
|
||||
diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
|
||||
index ae03595..4e689cd 100644
|
||||
--- a/libo2cb/o2cb_abi.c
|
||||
+++ b/libo2cb/o2cb_abi.c
|
||||
@@ -1373,162 +1373,14 @@ 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)
|
||||
{
|
||||
- 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;
|
||||
-
|
||||
-out:
|
||||
- if (err && (control_daemon_fd != -1)) {
|
||||
- close(control_daemon_fd);
|
||||
- control_daemon_fd = -1;
|
||||
- }
|
||||
-
|
||||
- return err;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
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.1.4
|
||||
|
450
0002-libo2cb-Remove-rest-of-controld-functions.patch
Normal file
450
0002-libo2cb-Remove-rest-of-controld-functions.patch
Normal file
@ -0,0 +1,450 @@
|
||||
From 40b1211091b62a4884d1625fc04d476a07489ca3 Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Mon, 19 Aug 2013 08:38:59 -0500
|
||||
Subject: [PATCH 2/7] libo2cb: Remove rest of controld functions
|
||||
|
||||
---
|
||||
libo2cb/o2cb_abi.c | 388 +----------------------------------------------------
|
||||
1 file changed, 2 insertions(+), 386 deletions(-)
|
||||
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libo2cb/o2cb_abi.c
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/libo2cb/o2cb_abi.c 2013-08-23 22:50:22.129878132 -0500
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libo2cb/o2cb_abi.c 2013-08-23 22:52:20.143277130 -0500
|
||||
@@ -46,7 +46,6 @@
|
||||
#define CLUSTER_STACK_FILE "/sys/fs/ocfs2/cluster_stack"
|
||||
#define LOCKING_PROTOCOL_FILE "/sys/fs/ocfs2/max_locking_protocol"
|
||||
#define OCFS2_STACK_LABEL_LEN 4
|
||||
-#define CONTROL_DEVICE "/dev/misc/ocfs2_control"
|
||||
|
||||
static errcode_t o2cb_validate_cluster_name(struct o2cb_cluster_desc *desc);
|
||||
static errcode_t o2cb_validate_cluster_flags(struct o2cb_cluster_desc *desc,
|
||||
@@ -106,8 +105,6 @@ static struct o2cb_stack user_stack = {
|
||||
};
|
||||
|
||||
static struct o2cb_stack *current_stack;
|
||||
-static int control_daemon_fd = -1;
|
||||
-static int control_device_fd = -1;
|
||||
|
||||
static char *configfs_path;
|
||||
|
||||
@@ -1349,27 +1346,6 @@ static errcode_t classic_complete_group_
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static errcode_t user_parse_status(char **args, int *error, char **error_msg)
|
||||
-{
|
||||
- errcode_t err = O2CB_ET_IO;
|
||||
- long result;
|
||||
- char *ptr = NULL;
|
||||
-
|
||||
- result = strtol(args[0], &ptr, 10);
|
||||
- if (ptr && *ptr != '\0') {
|
||||
- /* fprintf(stderr, "Invalid error code string: %s", args[0]); */
|
||||
- } else if ((result == LONG_MIN) || (result == LONG_MAX) ||
|
||||
- (result < INT_MIN) || (result > INT_MAX)) {
|
||||
- /* fprintf(stderr, "Error code %ld out of range", err); */
|
||||
- } else {
|
||||
- *error_msg = args[1];
|
||||
- *error = result;
|
||||
- err = 0;
|
||||
- }
|
||||
-
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
static errcode_t user_begin_group_join(struct o2cb_cluster_desc *cluster,
|
||||
struct o2cb_region_desc *region)
|
||||
{
|
||||
@@ -1386,90 +1362,7 @@ static errcode_t user_complete_group_joi
|
||||
static errcode_t user_group_leave(struct o2cb_cluster_desc *cluster,
|
||||
struct o2cb_region_desc *region)
|
||||
{
|
||||
- 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 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_UNMOUNT, OCFS2_FS_NAME,
|
||||
- region->r_name, region->r_service);
|
||||
- if (rc) {
|
||||
- /* fprintf(stderr, "Unable to send UNMOUNT 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;
|
||||
- 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;
|
||||
-
|
||||
-out:
|
||||
- if (control_daemon_fd != -1) {
|
||||
- close(control_daemon_fd);
|
||||
- control_daemon_fd = -1;
|
||||
- }
|
||||
-
|
||||
- return err;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
static errcode_t o2cb_validate_cluster_flags(struct o2cb_cluster_desc *desc,
|
||||
@@ -1818,52 +1711,7 @@ static errcode_t classic_list_clusters(c
|
||||
|
||||
static errcode_t user_list_clusters(char ***clusters)
|
||||
{
|
||||
- errcode_t err = O2CB_ET_SERVICE_UNAVAILABLE;
|
||||
- int rc, fd = -1;
|
||||
- char buf[OCFS2_CONTROLD_MAXLINE];
|
||||
-
|
||||
- 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;
|
||||
- }
|
||||
- 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;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- rc = receive_list(fd, buf, clusters);
|
||||
- if (rc) {
|
||||
- /* fprintf(stderr, "Error reading from daemon: %s\n",
|
||||
- strerror(-rc)); */
|
||||
- err = O2CB_ET_IO;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- err = 0;
|
||||
-
|
||||
-out:
|
||||
- if (fd != -1)
|
||||
- close(fd);
|
||||
-
|
||||
- return err;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
errcode_t o2cb_list_clusters(char ***clusters)
|
||||
@@ -1991,83 +1839,6 @@ errcode_t o2cb_set_heartbeat_mode(char *
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static errcode_t dump_list_to_string(char **dump_list, char **debug)
|
||||
-{
|
||||
- int i;
|
||||
- size_t len, count = 0;
|
||||
- char *ptr;
|
||||
-
|
||||
- for (i = 0; dump_list[i]; i++)
|
||||
- count += strlen(dump_list[i]);
|
||||
-
|
||||
- *debug = malloc(sizeof(char) * (count + 1));
|
||||
- if (!*debug)
|
||||
- return O2CB_ET_NO_MEMORY;
|
||||
-
|
||||
- ptr = *debug;
|
||||
- ptr[count] = '\0';
|
||||
- for (i = 0; dump_list[i]; i++) {
|
||||
- len = strlen(dump_list[i]);
|
||||
- memcpy(ptr, dump_list[i], len);
|
||||
- ptr += len;
|
||||
- }
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-errcode_t o2cb_control_daemon_debug(char **debug)
|
||||
-{
|
||||
- errcode_t err = O2CB_ET_SERVICE_UNAVAILABLE;
|
||||
- int rc, fd = -1;
|
||||
- char buf[OCFS2_CONTROLD_MAXLINE];
|
||||
- char **dump_list = NULL;
|
||||
-
|
||||
- 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;
|
||||
- }
|
||||
- fd = rc;
|
||||
-
|
||||
- rc = send_message(fd, CM_DUMP);
|
||||
- if (rc) {
|
||||
- /* fprintf(stderr,
|
||||
- "Unable to send DUMP message: %s\n",
|
||||
- strerror(-rc)); */
|
||||
- err = O2CB_ET_IO;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- rc = receive_list(fd, buf, &dump_list);
|
||||
- if (rc) {
|
||||
- /* fprintf(stderr, "Error reading from daemon: %s\n",
|
||||
- strerror(-rc)); */
|
||||
- err = O2CB_ET_IO;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- err = dump_list_to_string(dump_list, debug);
|
||||
- o2cb_free_dir_list(dump_list);
|
||||
-
|
||||
-out:
|
||||
- if (fd != -1)
|
||||
- close(fd);
|
||||
-
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
-
|
||||
errcode_t o2cb_get_hb_thread_pid (const char *cluster_name, const char *region_name,
|
||||
pid_t *pid)
|
||||
{
|
||||
@@ -2171,161 +1942,6 @@ errcode_t o2cb_get_node_local(const char
|
||||
|
||||
return 0;
|
||||
}
|
||||
-/*
|
||||
- * The handshake is pretty simple. We need to read all supported control
|
||||
- * device protocols from the kernel. Once we've read them, we can write
|
||||
- * the protocol we want to use. After that, we're good to go.
|
||||
- *
|
||||
- * Right now, we will just allow the T01 protocol and not write any
|
||||
- * code to handle multiples. We'll add that later if and when it is
|
||||
- * necessary.
|
||||
- *
|
||||
- * The versions read from the kernel are all 4 characers including the
|
||||
- * newline.
|
||||
- */
|
||||
-#define OCFS2_CONTROL_PROTO "T01\n"
|
||||
-#define OCFS2_CONTROL_PROTO_LEN 4
|
||||
-#define OCFS2_CONTROL_MESSAGE_SETNODE_OP "SETN"
|
||||
-#define OCFS2_CONTROL_MESSAGE_SETNODE_TOTAL_LEN 14
|
||||
-#define OCFS2_CONTROL_MESSAGE_SETVERSION_OP "SETV"
|
||||
-#define OCFS2_CONTROL_MESSAGE_SETVERSION_TOTAL_LEN 11
|
||||
-#define OCFS2_CONTROL_MESSAGE_DOWN_OP "DOWN"
|
||||
-#define OCFS2_CONTROL_MESSAGE_DOWN_TOTAL_LEN 47
|
||||
-#define OCFS2_CONTROL_MESSAGE_NODENUM_LEN 8
|
||||
-static errcode_t o2cb_control_handshake(unsigned int this_node,
|
||||
- struct ocfs2_protocol_version *proto)
|
||||
-{
|
||||
- errcode_t err = 0;
|
||||
- int found = 0;
|
||||
- size_t ret;
|
||||
- char buf[OCFS2_CONTROL_MESSAGE_SETNODE_TOTAL_LEN + 1];
|
||||
-
|
||||
- if (control_device_fd == -1) {
|
||||
- err = O2CB_ET_INTERNAL_FAILURE;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- buf[OCFS2_CONTROL_PROTO_LEN] = '\0';
|
||||
- while (1)
|
||||
- {
|
||||
- ret = read(control_device_fd, buf, OCFS2_CONTROL_PROTO_LEN);
|
||||
- if (ret == OCFS2_CONTROL_PROTO_LEN) {
|
||||
- if (!found && !strcmp(buf,
|
||||
- OCFS2_CONTROL_PROTO))
|
||||
- found = 1;
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- if (ret != 0)
|
||||
- err = O2CB_ET_IO;
|
||||
- else if (!found)
|
||||
- err = O2CB_ET_SERVICE_HANDSHAKE_UNAVAILABLE; /* no match */
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (err)
|
||||
- goto out;
|
||||
-
|
||||
- ret = write(control_device_fd, OCFS2_CONTROL_PROTO,
|
||||
- OCFS2_CONTROL_PROTO_LEN);
|
||||
- if (ret != OCFS2_CONTROL_PROTO_LEN) {
|
||||
- err = O2CB_ET_IO;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- snprintf(buf, OCFS2_CONTROL_MESSAGE_SETNODE_TOTAL_LEN + 1,
|
||||
- OCFS2_CONTROL_MESSAGE_SETNODE_OP " %08X\n", this_node);
|
||||
- ret = write(control_device_fd, buf,
|
||||
- OCFS2_CONTROL_MESSAGE_SETNODE_TOTAL_LEN);
|
||||
- if (ret != OCFS2_CONTROL_MESSAGE_SETNODE_TOTAL_LEN)
|
||||
- err = O2CB_ET_IO;
|
||||
-
|
||||
- snprintf(buf, OCFS2_CONTROL_MESSAGE_SETVERSION_TOTAL_LEN + 1,
|
||||
- OCFS2_CONTROL_MESSAGE_SETVERSION_OP " %02X %02X\n",
|
||||
- proto->pv_major, proto->pv_minor);
|
||||
- ret = write(control_device_fd, buf,
|
||||
- OCFS2_CONTROL_MESSAGE_SETVERSION_TOTAL_LEN);
|
||||
- if (ret != OCFS2_CONTROL_MESSAGE_SETVERSION_TOTAL_LEN)
|
||||
- err = O2CB_ET_IO;
|
||||
-
|
||||
-out:
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
-errcode_t o2cb_control_open(unsigned int this_node,
|
||||
- struct ocfs2_protocol_version *proto)
|
||||
-{
|
||||
- errcode_t err = 0;
|
||||
- int rc;
|
||||
-
|
||||
- if (!current_stack) {
|
||||
- err = O2CB_ET_SERVICE_UNAVAILABLE;
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- if (control_device_fd != -1)
|
||||
- goto out;
|
||||
-
|
||||
- rc = open(CONTROL_DEVICE, O_RDWR);
|
||||
- if (rc < 0) {
|
||||
- switch (errno) {
|
||||
- default:
|
||||
- err = O2CB_ET_INTERNAL_FAILURE;
|
||||
- break;
|
||||
-
|
||||
- case ENOTDIR:
|
||||
- case ENOENT:
|
||||
- case EISDIR:
|
||||
- err = O2CB_ET_SERVICE_DEV_UNAVAILABLE;
|
||||
- break;
|
||||
-
|
||||
- case EACCES:
|
||||
- case EPERM:
|
||||
- case EROFS:
|
||||
- err = O2CB_ET_PERMISSION_DENIED;
|
||||
- break;
|
||||
- }
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
- control_device_fd = rc;
|
||||
-
|
||||
- err = o2cb_control_handshake(this_node, proto);
|
||||
- if (err) {
|
||||
- close(control_device_fd);
|
||||
- control_device_fd = -1;
|
||||
- }
|
||||
-
|
||||
-out:
|
||||
- return err;
|
||||
-}
|
||||
-
|
||||
-void o2cb_control_close(void)
|
||||
-{
|
||||
- if (control_device_fd != -1) {
|
||||
- close(control_device_fd);
|
||||
- control_device_fd = -1;
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-errcode_t o2cb_control_node_down(const char *uuid, unsigned int nodeid)
|
||||
-{
|
||||
- errcode_t err = 0;
|
||||
- size_t ret;
|
||||
- char buf[OCFS2_CONTROL_MESSAGE_DOWN_TOTAL_LEN + 1];
|
||||
-
|
||||
- if (control_device_fd == -1)
|
||||
- return O2CB_ET_INTERNAL_FAILURE;
|
||||
-
|
||||
- snprintf(buf, OCFS2_CONTROL_MESSAGE_DOWN_TOTAL_LEN + 1,
|
||||
- "DOWN %.32s %08X\n", uuid, nodeid);
|
||||
- ret = write(control_device_fd, buf,
|
||||
- OCFS2_CONTROL_MESSAGE_DOWN_TOTAL_LEN);
|
||||
- if (ret != OCFS2_CONTROL_MESSAGE_DOWN_TOTAL_LEN)
|
||||
- err = O2CB_ET_IO;
|
||||
-
|
||||
- return err;
|
||||
-}
|
||||
|
||||
errcode_t o2cb_get_hb_ctl_path(char *buf, int count)
|
||||
{
|
62
0003-Get-cluster-name-from-corosync-cmap.patch
Normal file
62
0003-Get-cluster-name-from-corosync-cmap.patch
Normal file
@ -0,0 +1,62 @@
|
||||
From 3f2b73105c5e09e17744ec249eed93c60124bd2d Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Mon, 19 Aug 2013 18:05:04 -0500
|
||||
Subject: [PATCH 3/7] Get cluster name from corosync cmap
|
||||
|
||||
---
|
||||
libo2cb/o2cb_abi.c | 20 ++++++++++++++++++++
|
||||
o2cb.pc.in | 2 +-
|
||||
2 files changed, 21 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
|
||||
index 8e5d6ce..d00dd46 100644
|
||||
--- a/libo2cb/o2cb_abi.c
|
||||
+++ b/libo2cb/o2cb_abi.c
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <ctype.h>
|
||||
|
||||
#include <linux/types.h>
|
||||
+#include <corosync/cmap.h>
|
||||
|
||||
#include "o2cb/o2cb.h"
|
||||
#include "o2cb/o2cb_client_proto.h"
|
||||
@@ -1711,6 +1712,25 @@ static errcode_t classic_list_clusters(char ***clusters)
|
||||
|
||||
static errcode_t user_list_clusters(char ***clusters)
|
||||
{
|
||||
+ cmap_handle_t handle;
|
||||
+ char **list;
|
||||
+ int rv;
|
||||
+
|
||||
+ rv = cmap_initialize(&handle);
|
||||
+ if (rv != CS_OK)
|
||||
+ return O2CB_ET_SERVICE_UNAVAILABLE;
|
||||
+
|
||||
+ /* We supply only one cluster_name */
|
||||
+ list = (char **)malloc(sizeof(char *) * 2);
|
||||
+ rv = cmap_get_string(handle, "totem.cluster_name", &list[0]);
|
||||
+ if (rv != CS_OK) {
|
||||
+ free(list);
|
||||
+ return O2CB_ET_INTERNAL_FAILURE;
|
||||
+ }
|
||||
+
|
||||
+ list[1] = NULL;
|
||||
+ *clusters = list;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
diff --git a/o2cb.pc.in b/o2cb.pc.in
|
||||
index be94b8a..3a47c36 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 -lcmap
|
||||
Cflags: -I${includedir}
|
||||
--
|
||||
1.8.1.4
|
||||
|
64
0004-Remove-controld-structures-from-debugfs.ocfs2.patch
Normal file
64
0004-Remove-controld-structures-from-debugfs.ocfs2.patch
Normal file
@ -0,0 +1,64 @@
|
||||
From 394a3e7d2758331ba8aa6fc38957611d2447a73d Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Mon, 19 Aug 2013 19:15:53 -0500
|
||||
Subject: [PATCH 4/7] Remove controld structures from debugfs.ocfs2
|
||||
|
||||
---
|
||||
debugfs.ocfs2/commands.c | 34 ----------------------------------
|
||||
1 file changed, 34 deletions(-)
|
||||
|
||||
diff --git a/debugfs.ocfs2/commands.c b/debugfs.ocfs2/commands.c
|
||||
index e0b228a..c1c7589 100644
|
||||
--- a/debugfs.ocfs2/commands.c
|
||||
+++ b/debugfs.ocfs2/commands.c
|
||||
@@ -108,11 +108,6 @@ static struct command commands[] = {
|
||||
"close",
|
||||
"Close a device",
|
||||
},
|
||||
- { "controld",
|
||||
- do_controld,
|
||||
- "controld dump",
|
||||
- "Obtain information from ocfs2_controld",
|
||||
- },
|
||||
{ "curdev",
|
||||
do_curdev,
|
||||
"curdev",
|
||||
@@ -894,35 +889,6 @@ static void do_lcd(char **args)
|
||||
return ;
|
||||
}
|
||||
|
||||
-static void do_controld_dump(char **args)
|
||||
-{
|
||||
- FILE *out;
|
||||
- errcode_t ret;
|
||||
- char *debug_buffer;
|
||||
-
|
||||
- ret = o2cb_control_daemon_debug(&debug_buffer);
|
||||
- if (ret) {
|
||||
- com_err(args[0], ret, "while obtaining the debug buffer");
|
||||
- return;
|
||||
- }
|
||||
-
|
||||
- out = open_pager(gbls.interactive);
|
||||
- fprintf(out, "%s", debug_buffer);
|
||||
- close_pager(out);
|
||||
- free(debug_buffer);
|
||||
-}
|
||||
-
|
||||
-static void do_controld(char **args)
|
||||
-{
|
||||
- if (!args[1])
|
||||
- fprintf(stderr, "%s: Operation required\n", args[0]);
|
||||
- else if (!strcmp(args[1], "dump"))
|
||||
- do_controld_dump(args);
|
||||
- else
|
||||
- fprintf(stderr, "%s: Invalid operation: \"%s\"\n",
|
||||
- args[0], args[1]);
|
||||
-}
|
||||
-
|
||||
static void do_curdev(char **args)
|
||||
{
|
||||
printf("%s\n", gbls.device ? gbls.device : "No device");
|
||||
--
|
||||
1.8.1.4
|
||||
|
@ -0,0 +1,44 @@
|
||||
From 8563d603b7af2a32ef1e19337eaeb9d7cace730c Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Mon, 19 Aug 2013 19:18:40 -0500
|
||||
Subject: [PATCH 5/7] Check for DLM kernel version in user_begin_group_join
|
||||
|
||||
Since we just have to check if the DLM daemon is running, we
|
||||
just check the kernel version running. Checking the kernel version
|
||||
ensures that the dlm daemon is running.
|
||||
---
|
||||
libo2cb/o2cb_abi.c | 11 +++++++++++
|
||||
1 file changed, 11 insertions(+)
|
||||
|
||||
diff --git a/libo2cb/o2cb_abi.c b/libo2cb/o2cb_abi.c
|
||||
index d00dd46..26ed848 100644
|
||||
--- a/libo2cb/o2cb_abi.c
|
||||
+++ b/libo2cb/o2cb_abi.c
|
||||
@@ -38,6 +38,7 @@
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <corosync/cmap.h>
|
||||
+#include <libdlm.h>
|
||||
|
||||
#include "o2cb/o2cb.h"
|
||||
#include "o2cb/o2cb_client_proto.h"
|
||||
@@ -1350,6 +1351,16 @@ static errcode_t classic_complete_group_join(struct o2cb_cluster_desc *cluster,
|
||||
static errcode_t user_begin_group_join(struct o2cb_cluster_desc *cluster,
|
||||
struct o2cb_region_desc *region)
|
||||
{
|
||||
+ uint32_t maj, min, pat;
|
||||
+ int rv;
|
||||
+
|
||||
+ rv = dlm_kernel_version(&maj, &min, &pat);
|
||||
+
|
||||
+ if (rv < 0)
|
||||
+ return O2CB_ET_SERVICE_UNAVAILABLE;
|
||||
+
|
||||
+ if (maj < 6)
|
||||
+ return O2CB_ET_INTERNAL_FAILURE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.1.4
|
||||
|
121
0006-Add-cmap-and-dlm-libraries-in-the-tools.patch
Normal file
121
0006-Add-cmap-and-dlm-libraries-in-the-tools.patch
Normal file
@ -0,0 +1,121 @@
|
||||
From 4adc4d242f3f69808e7e2bed71337ff7e7966846 Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Mon, 19 Aug 2013 19:20:19 -0500
|
||||
Subject: [PATCH 6/7] Add cmap and dlm libraries in the tools
|
||||
|
||||
---
|
||||
fsck.ocfs2/Makefile | 2 +-
|
||||
mkfs.ocfs2/Makefile | 2 +-
|
||||
mount.ocfs2/Makefile | 2 +-
|
||||
mounted.ocfs2/Makefile | 2 +-
|
||||
o2cb.pc.in | 2 +-
|
||||
o2cb_ctl/Makefile | 2 +-
|
||||
ocfs2_hb_ctl/Makefile | 2 +-
|
||||
tunefs.ocfs2/Makefile | 2 +-
|
||||
8 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/fsck.ocfs2/Makefile b/fsck.ocfs2/Makefile
|
||||
index edc8dc5..d1c71f8 100644
|
||||
--- a/fsck.ocfs2/Makefile
|
||||
+++ b/fsck.ocfs2/Makefile
|
||||
@@ -12,7 +12,7 @@ LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -lcmap -ldlm
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal
|
||||
LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a
|
||||
diff --git a/mkfs.ocfs2/Makefile b/mkfs.ocfs2/Makefile
|
||||
index 5631e01..1fed073 100644
|
||||
--- a/mkfs.ocfs2/Makefile
|
||||
+++ b/mkfs.ocfs2/Makefile
|
||||
@@ -8,7 +8,7 @@ SBIN_PROGRAMS = mkfs.ocfs2
|
||||
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -lcmap -ldlm
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
diff --git a/mount.ocfs2/Makefile b/mount.ocfs2/Makefile
|
||||
index cf316bf..2736f5f 100644
|
||||
--- a/mount.ocfs2/Makefile
|
||||
+++ b/mount.ocfs2/Makefile
|
||||
@@ -10,7 +10,7 @@ LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
DEFINES = -DVERSION=\"$(VERSION)\"
|
||||
diff --git a/mounted.ocfs2/Makefile b/mounted.ocfs2/Makefile
|
||||
index 8a574fb..3e18895 100644
|
||||
--- a/mounted.ocfs2/Makefile
|
||||
+++ b/mounted.ocfs2/Makefile
|
||||
@@ -8,7 +8,7 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal
|
||||
diff --git a/o2cb.pc.in b/o2cb.pc.in
|
||||
index 3a47c36..3dd1f4e 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 -lcmap
|
||||
+Libs: -L${libdir} -lo2cb -lcmap -ldlm
|
||||
Cflags: -I${includedir}
|
||||
diff --git a/o2cb_ctl/Makefile b/o2cb_ctl/Makefile
|
||||
index 5efcab4..0da22dc 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 -ldlm -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
diff --git a/ocfs2_hb_ctl/Makefile b/ocfs2_hb_ctl/Makefile
|
||||
index 10fd8b1..d04e74e 100644
|
||||
--- a/ocfs2_hb_ctl/Makefile
|
||||
+++ b/ocfs2_hb_ctl/Makefile
|
||||
@@ -10,7 +10,7 @@ LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
ifndef OCFS2_DYNAMIC_CTL
|
||||
diff --git a/tunefs.ocfs2/Makefile b/tunefs.ocfs2/Makefile
|
||||
index 585a68c..4e40d7d 100644
|
||||
--- a/tunefs.ocfs2/Makefile
|
||||
+++ b/tunefs.ocfs2/Makefile
|
||||
@@ -11,7 +11,7 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
UNINST_LIBRARIES = libocfs2ne.a
|
||||
--
|
||||
1.8.1.4
|
||||
|
176
0008-mount.ocfs2-Read-stack-from-device-and-setup-stack-i.patch
Normal file
176
0008-mount.ocfs2-Read-stack-from-device-and-setup-stack-i.patch
Normal file
@ -0,0 +1,176 @@
|
||||
From 5d0bffdbbadd38173a9bfbf4ffb8d455b5f0b990 Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Tue, 3 Sep 2013 07:40:39 -0500
|
||||
Subject: [PATCH 8/8] mount.ocfs2: Read stack from device and setup stack if
|
||||
not present
|
||||
|
||||
Note, this removes cman as the possible user stack.
|
||||
---
|
||||
include/o2cb/o2cb.h | 1 +
|
||||
libo2cb/o2cb_abi.c | 103 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
mount.ocfs2/mount.ocfs2.c | 6 +++
|
||||
3 files changed, 110 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 26ed848..6d1e41a 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>
|
||||
@@ -103,6 +104,7 @@ static struct o2cb_stack_ops user_ops = {
|
||||
.group_leave = user_group_leave,
|
||||
};
|
||||
static struct o2cb_stack user_stack = {
|
||||
+ .s_name = "pcmk",
|
||||
.s_ops = &user_ops,
|
||||
};
|
||||
|
||||
@@ -142,6 +144,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);
|
||||
@@ -2017,3 +2035,88 @@ 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, user_stack.s_name,
|
||||
+ 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,
|
||||
+ strlen(stack_name));
|
||||
+ 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.1.4
|
||||
|
@ -0,0 +1,86 @@
|
||||
From 14c5f3788b047024390c1a1ae40a0585417ed0d9 Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
|
||||
Date: Wed, 4 Sep 2013 23:56:39 -0500
|
||||
Subject: [PATCH 9/9] mkfs.ocfs2: Abort if cluster information is not detected
|
||||
|
||||
---
|
||||
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.1.4
|
||||
|
78
bug-838705-change_dlm_lib.patch
Normal file
78
bug-838705-change_dlm_lib.patch
Normal file
@ -0,0 +1,78 @@
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/fsck.ocfs2/Makefile
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/fsck.ocfs2/Makefile
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/fsck.ocfs2/Makefile
|
||||
@@ -12,7 +12,7 @@ LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -lo
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -lcmap -ldlm
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -lcmap -ldlm_lt
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal
|
||||
LIBTOOLS_INTERNAL_DEPS = $(TOPDIR)/libtools-internal/libtools-internal.a
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/mkfs.ocfs2/Makefile
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/mkfs.ocfs2/Makefile
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/mkfs.ocfs2/Makefile
|
||||
@@ -8,7 +8,7 @@ SBIN_PROGRAMS = mkfs.ocfs2
|
||||
LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -lcmap -ldlm
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -lcmap -ldlm_lt
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/mount.ocfs2/Makefile
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/mount.ocfs2/Makefile
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/mount.ocfs2/Makefile
|
||||
@@ -10,7 +10,7 @@ LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -lo
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
DEFINES = -DVERSION=\"$(VERSION)\"
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/mounted.ocfs2/Makefile
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/mounted.ocfs2/Makefile
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/mounted.ocfs2/Makefile
|
||||
@@ -8,7 +8,7 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/liboc
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
LIBTOOLS_INTERNAL_LIBS = -L$(TOPDIR)/libtools-internal -ltools-internal
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/ocfs2_hb_ctl/Makefile
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/ocfs2_hb_ctl/Makefile
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/ocfs2_hb_ctl/Makefile
|
||||
@@ -10,7 +10,7 @@ LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -lo
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
ifndef OCFS2_DYNAMIC_CTL
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/tunefs.ocfs2/Makefile
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/tunefs.ocfs2/Makefile
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/tunefs.ocfs2/Makefile
|
||||
@@ -11,7 +11,7 @@ LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/liboc
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
||||
LIBO2DLM_DEPS = $(TOPDIR)/libo2dlm/libo2dlm.a
|
||||
|
||||
-LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm -lcmap
|
||||
+LIBO2CB_LIBS = -L$(TOPDIR)/libo2cb -lo2cb -ldlm_lt -lcmap
|
||||
LIBO2CB_DEPS = $(TOPDIR)/libo2cb/libo2cb.a
|
||||
|
||||
UNINST_LIBRARIES = libocfs2ne.a
|
23
libocfs2-Change-asserts-to-error.patch
Normal file
23
libocfs2-Change-asserts-to-error.patch
Normal file
@ -0,0 +1,23 @@
|
||||
While running fsck.ocfs2, if an assert is met, fsck.ocfs2 terminates.
|
||||
This error is still recoverable, because the index of the directory
|
||||
can be rebuilt. Converting the asserts to an error would return
|
||||
control to fsck.
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libocfs2/dir_indexed.c
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/libocfs2/dir_indexed.c 2013-04-02 04:38:06.444732480 -0500
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libocfs2/dir_indexed.c 2013-08-13 09:37:35.120453200 -0500
|
||||
@@ -1436,9 +1436,11 @@ errcode_t ocfs2_dx_dir_search(ocfs2_file
|
||||
entry_list = &dx_leaf->dl_list;
|
||||
}
|
||||
|
||||
- assert(entry_list->de_count > 0);
|
||||
- assert(entry_list->de_num_used > 0);
|
||||
- assert(dx_root->dr_num_entries > 0);
|
||||
+ if ((entry_list->de_count == 0) || (entry_list->de_num_used == 0) ||
|
||||
+ (dx_root->dr_num_entries == 0)) {
|
||||
+ ret = OCFS2_ET_DIR_CORRUPTED;
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
ret = ocfs2_malloc_block(fs->fs_io, &dir_buf);
|
||||
if (ret)
|
11
libocfs2-needs-libaio.patch
Normal file
11
libocfs2-needs-libaio.patch
Normal file
@ -0,0 +1,11 @@
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/ocfs2.pc.in
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/ocfs2.pc.in 2013-04-02 04:38:06.452732480 -0500
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/ocfs2.pc.in 2013-08-09 16:51:54.933245397 -0500
|
||||
@@ -7,5 +7,5 @@ Name: ocfs2
|
||||
Description: Userspace ocfs2 library
|
||||
Version: @VERSION@
|
||||
Requires: o2dlm o2cb com_err
|
||||
-Libs: -L${libdir} -locfs2
|
||||
+Libs: -L${libdir} -locfs2 -laio
|
||||
Cflags: -I${includedir}
|
386
o2cb.ocf
386
o2cb.ocf
@ -1,5 +1,6 @@
|
||||
#!/bin/bash
|
||||
# Copyright (c) 2008 Andrew Beekhof
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -33,347 +34,23 @@
|
||||
: ${OCF_RESKEY_configfs:="/sys/kernel/config"}
|
||||
: ${OCF_RESKEY_CRM_meta_gloablly_unique:="false"}
|
||||
|
||||
# Common variables
|
||||
DAEMON="/usr/sbin/ocfs2_controld.${OCF_RESKEY_stack}"
|
||||
CLUSTER_STACK_FILE="${OCF_RESKEY_sysfs}/ocfs2/cluster_stack"
|
||||
LOADED_PLUGINS_FILE="${OCF_RESKEY_sysfs}/ocfs2/loaded_cluster_plugins"
|
||||
|
||||
#
|
||||
# Check to see if a filesystem driver is loaded.
|
||||
# 0 is loaded, 1 is not.
|
||||
#
|
||||
driver_filesystem() {
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
ocf_log err "driver_filesystem(): Missing an argument"
|
||||
exit 1
|
||||
fi
|
||||
FSNAME="$1"
|
||||
|
||||
FSOUT="$(awk '(NF == 1 && $1 ~ /^'$FSNAME'$/) || $2 ~ /^'$FSNAME'$/{
|
||||
print $1;exit
|
||||
}' /proc/filesystems 2>/dev/null)"
|
||||
|
||||
test -n "$FSOUT"
|
||||
return $?
|
||||
}
|
||||
|
||||
#
|
||||
# Check to see if a filesystem of type $1 is mounted at $2.
|
||||
#
|
||||
# 0 is mounted, 1 is not.
|
||||
#
|
||||
check_filesystem()
|
||||
{
|
||||
if [ "$#" != "2" -o -z "$1" -o -z "$2" ]
|
||||
then
|
||||
ocf_log err "check_filesystem(): Missing arguments"
|
||||
exit 4
|
||||
fi
|
||||
FSNAME="$1"
|
||||
MOUNTPOINT="$2"
|
||||
|
||||
FULL_MOUNTSEARCH="`echo "$MOUNTPOINT" | sed -e 's/\//\\\\\//g'`"
|
||||
MOUNTOUT="`awk '$2 ~ /^'$FULL_MOUNTSEARCH'$/ && $3 ~ /^'$FSNAME'$/{print $2; exit}' < /proc/mounts 2>/dev/null`"
|
||||
test -n "$MOUNTOUT"
|
||||
return $?
|
||||
}
|
||||
|
||||
#
|
||||
# Unload a filesystem driver.
|
||||
# Be careful to notice if the driver is built-in and do nothing.
|
||||
#
|
||||
# 0 is success, 1 is error, 2 is already unloaded.
|
||||
#
|
||||
unload_filesystem()
|
||||
{
|
||||
if [ "$#" != "1" -o -z "$1" ]
|
||||
then
|
||||
ocf_log err "unload_filesystem(): Missing an argument"
|
||||
return 1
|
||||
fi
|
||||
FSNAME="$1"
|
||||
|
||||
driver_filesystem "$FSNAME" || return 2
|
||||
|
||||
MODOUT="`awk '$1 ~ /^'$FSNAME'$/{print $1,$3;exit}' < /proc/modules 2>/dev/null`"
|
||||
if [ -z "$MODOUT" ]; then
|
||||
# The driver is built in, we can't unload it.
|
||||
return 0
|
||||
fi
|
||||
|
||||
case "$MODOUT" in
|
||||
$FSNAME\ 0)
|
||||
;;
|
||||
$FSNAME\ *)
|
||||
# The driver is busy, leave it alone
|
||||
ocf_log err "Module $FSNAME is still in use"
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
ocf_log err "Invalid module parsing! "
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
modprobe -rs "$FSNAME"
|
||||
if [ "$?" != 0 ]; then
|
||||
ocf_log err "Unable to unload module: $FSNAME"
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
status_daemon()
|
||||
{
|
||||
PID=`pidofproc "$DAEMON"`
|
||||
if [ -n "$PID" ]; then
|
||||
return $OCF_SUCCESS
|
||||
fi
|
||||
return $OCF_NOT_RUNNING
|
||||
}
|
||||
|
||||
bringup_daemon()
|
||||
{
|
||||
if [ ! -e "$DAEMON" ]; then
|
||||
ocf_log err "Required binary not found: $DAEMON"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
|
||||
start_daemon "$DAEMON"; rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
ocf_log err "Could not start $DAEMON"
|
||||
return $OCF_ERR_GENERIC
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
COUNT=0
|
||||
rc=$OCF_NOT_RUNNING
|
||||
|
||||
while [ $rc = $OCF_NOT_RUNNING ]; do
|
||||
COUNT=`expr $COUNT + 1`
|
||||
if [ $COUNT -gt $OCF_RESKEY_daemon_timeout ]; then
|
||||
ocf_log err "`basename $DAEMON` did not come up"
|
||||
ps axf | grep -C 3 $$
|
||||
return $OCF_ERR_GENERIC
|
||||
fi
|
||||
status_daemon; rc=$?
|
||||
sleep 1
|
||||
done
|
||||
|
||||
return $rc
|
||||
}
|
||||
|
||||
kill_daemon()
|
||||
{
|
||||
status_daemon; rc=$?
|
||||
if [ $rc == $OCF_NOT_RUNNING ]; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
ocf_log info "Stopping `basename "$DAEMON"`"
|
||||
killproc "$DAEMON"
|
||||
|
||||
while [ $rc != $OCF_NOT_RUNNING ]; do
|
||||
sleep 1
|
||||
status_daemon; rc=$?
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
#
|
||||
# Unload a module
|
||||
# 0 is success, 1 is error, 2 is not loaded
|
||||
#
|
||||
unload_module()
|
||||
{
|
||||
if [ "$#" -lt "1" -o -z "$1" ]
|
||||
then
|
||||
ocf_log err "unload_module(): Requires an argument"
|
||||
return 1
|
||||
fi
|
||||
MODNAME="$1"
|
||||
|
||||
MODOUT="`awk '$1 ~ /^'$MODNAME'$/{print $1,$3;exit}' < /proc/modules 2>/dev/null`"
|
||||
if [ -z "$MODOUT" ]
|
||||
then
|
||||
return 2
|
||||
fi
|
||||
|
||||
case "$MODOUT" in
|
||||
$MODNAME\ 0)
|
||||
;;
|
||||
$MODNAME\ *)
|
||||
return 2
|
||||
;;
|
||||
*)
|
||||
ocf_log err "Invalid module parsing!"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
modprobe -rs "$MODNAME"
|
||||
if [ "$?" != 0 ]; then
|
||||
ocf_log err "Unable to unload module \"$MODNAME\""
|
||||
return 1
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
o2cb_start() {
|
||||
|
||||
o2cb_monitor; rc=$?
|
||||
if [ $rc != $OCF_NOT_RUNNING ]; then
|
||||
return $rc
|
||||
fi
|
||||
|
||||
ocf_log info "Starting $OCF_RESOURCE_INSTANCE"
|
||||
|
||||
if [ ! -e "$CLUSTER_STACK_FILE" ]; then
|
||||
modprobe -s ocfs2_stackglue
|
||||
if [ $? != 0 ]; then
|
||||
ocf_log err "Could not load ocfs2_stackglue"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
fi
|
||||
|
||||
SP_OUT="$(awk '/^'user'$/{print; exit}' "$LOADED_PLUGINS_FILE" 2>/dev/null)"
|
||||
if [ -z "$SP_OUT" ]
|
||||
then
|
||||
modprobe -s ocfs2_stack_user
|
||||
if [ $? != 0 ]; then
|
||||
ocf_log err "Could not load ocfs2_stack_user"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
fi
|
||||
|
||||
SP_OUT="$(awk '/^'user'$/{print; exit}' "$LOADED_PLUGINS_FILE" 2>/dev/null)"
|
||||
if [ -z "$SP_OUT" ]; then
|
||||
ocf_log err "Switch to userspace stack unsuccessful"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
|
||||
if [ -f "$CLUSTER_STACK_FILE" ]; then
|
||||
echo "$OCF_RESKEY_stack" >"$CLUSTER_STACK_FILE"
|
||||
if [ $? != 0 ]; then
|
||||
ocf_log err "Userspace stack '$OCF_RESKEY_stack' not supported"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
else
|
||||
ocf_log err "Switch to userspace stack not supported"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
|
||||
driver_filesystem ocfs2; rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
modprobe -s ocfs2
|
||||
if [ "$?" != 0 ]; then
|
||||
ocf_log err "Unable to load ocfs2 module"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
fi
|
||||
|
||||
bringup_daemon
|
||||
return $?
|
||||
ocf_log info "o2cb is now obsolete. Please remove the o2cb resource agent in your next maintenance window!"
|
||||
return $OCF_SUCCESS
|
||||
}
|
||||
|
||||
o2cb_stop() {
|
||||
o2cb_monitor; rc=$?
|
||||
case $rc in
|
||||
$OCF_NOT_RUNNING) return $OCF_SUCCESS;;
|
||||
esac
|
||||
|
||||
ocf_log info "Stopping $OCF_RESOURCE_INSTANCE"
|
||||
|
||||
kill_daemon
|
||||
if [ $? != 0 ]; then
|
||||
ocf_log err "Unable to unload modules: the cluster is still online"
|
||||
return $OCF_ERR_GENERIC
|
||||
fi
|
||||
|
||||
unload_filesystem ocfs2
|
||||
if [ $? = 1 ]; then
|
||||
ocf_log err "Unable to unload ocfs2 module"
|
||||
return $OCF_ERR_GENERIC
|
||||
fi
|
||||
|
||||
# If we can't find the stack glue, we have nothing to do.
|
||||
[ ! -e "$LOADED_PLUGINS_FILE" ] && return $OCF_SUCCESS
|
||||
|
||||
while read plugin
|
||||
do
|
||||
unload_module "ocfs2_stack_${plugin}"
|
||||
if [ $? = 1 ]; then
|
||||
ocf_log err "Unable to unload ocfs2_stack_${plugin}"
|
||||
return $OCF_ERR_GENERIC
|
||||
fi
|
||||
done <"$LOADED_PLUGINS_FILE"
|
||||
|
||||
unload_module "ocfs2_stackglue"
|
||||
if [ $? = 1 ]; then
|
||||
ocf_log err "Unable to unload ocfs2_stackglue"
|
||||
return $OCF_ERR_GENERIC
|
||||
fi
|
||||
|
||||
# Dont unmount configfs - its always in use by libdlm
|
||||
}
|
||||
|
||||
o2cb_monitor() {
|
||||
o2cb_validate
|
||||
|
||||
# Assume that ocfs2_controld will terminate if any of the conditions below are met
|
||||
|
||||
driver_filesystem configfs; rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
ocf_log info "configfs not laoded"
|
||||
return $OCF_NOT_RUNNING
|
||||
fi
|
||||
|
||||
check_filesystem configfs "${OCF_RESKEY_configfs}"; rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
ocf_log info "configfs not mounted"
|
||||
return $OCF_NOT_RUNNING
|
||||
fi
|
||||
|
||||
if [ ! -e "$LOADED_PLUGINS_FILE" ]; then
|
||||
ocf_log info "Stack glue driver not loaded"
|
||||
return $OCF_NOT_RUNNING
|
||||
fi
|
||||
|
||||
grep user "$LOADED_PLUGINS_FILE" >/dev/null 2>&1; rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
ocf_log err "Wrong stack `cat $LOADED_PLUGINS_FILE`"
|
||||
return $OCF_ERR_INSTALLED
|
||||
fi
|
||||
|
||||
driver_filesystem ocfs2; rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
ocf_log info "ocfs2 not loaded"
|
||||
return $OCF_NOT_RUNNING
|
||||
fi
|
||||
|
||||
status_daemon
|
||||
return $?
|
||||
ocf_log info "o2cb is now obsolete. Please remove the o2cb resource agent in your next maintenance window!"
|
||||
return $OCF_SUCCESS
|
||||
}
|
||||
|
||||
o2cb_usage() {
|
||||
echo "usage: $0 {start|stop|monitor|validate-all|meta-data}"
|
||||
echo " Expects to have a fully populated OCF RA-compliant environment set."
|
||||
echo " In particualr, a value for OCF_ROOT"
|
||||
echo "usage: $0 {start|stop|meta-data}"
|
||||
return $OCF_SUCCESS
|
||||
}
|
||||
|
||||
o2cb_validate() {
|
||||
: TODO: check for gloablly_unique=true and return OCF_ERR_CONFIGURED
|
||||
case ${OCF_RESKEY_CRM_meta_gloablly_unique} in
|
||||
yes|Yes|true|True|1)
|
||||
ocf_log err "$OCF_RESOURCE_INSTANCE must be configured with the gloablly_unique=false meta attribute"
|
||||
exit $OCF_ERR_CONFIGURED
|
||||
;;
|
||||
esac
|
||||
|
||||
return $OCF_SUCCESS
|
||||
o2cb_monitor() {
|
||||
return $OCF_SUCCESS
|
||||
}
|
||||
|
||||
meta_data() {
|
||||
@ -382,51 +59,16 @@ meta_data() {
|
||||
<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
|
||||
<resource-agent name="o2cb">
|
||||
<version>1.0</version>
|
||||
<shortdesc lang="en">o2cb resource agent</shortdesc>
|
||||
<shortdesc lang="en">OBSOLETE o2cb resource agent OBSOLETE</shortdesc>
|
||||
<longdesc lang="en">
|
||||
This is a o2cb Resource Agent. It runs o2cb daemon as a instance of anonymous clone.
|
||||
This is a o2cb Resource Agent. This is now obsolete!
|
||||
</longdesc>
|
||||
<parameters>
|
||||
|
||||
<parameter name="sysfs" unique="0">
|
||||
<longdesc lang="en">
|
||||
Location where sysfs is mounted
|
||||
</longdesc>
|
||||
<shortdesc lang="en">Sysfs location</shortdesc>
|
||||
<content type="string" default="/sys/fs"/>
|
||||
</parameter>
|
||||
|
||||
<parameter name="configfs" unique="0">
|
||||
<longdesc lang="en">
|
||||
Location where configfs is mounted
|
||||
</longdesc>
|
||||
<shortdesc lang="en">Configfs location</shortdesc>
|
||||
<content type="string" default="/sys/kernel/config"/>
|
||||
</parameter>
|
||||
|
||||
<parameter name="stack" unique="0">
|
||||
<longdesc lang="en">
|
||||
Which userspace stack to use. Known values: pcmk, cman
|
||||
</longdesc>
|
||||
<shortdesc lang="en">Userspace stack</shortdesc>
|
||||
<content type="string" default="pcmk"/>
|
||||
</parameter>
|
||||
|
||||
<parameter name="daemon_timeout" unique="0">
|
||||
<longdesc lang="en">
|
||||
Number of seconds to allow the control daemon to come up
|
||||
</longdesc>
|
||||
<shortdesc lang="en">Daemon Timeout</shortdesc>
|
||||
<content type="string" default="10"/>
|
||||
</parameter>
|
||||
|
||||
</parameters>
|
||||
<actions>
|
||||
<action name="start" timeout="90" />
|
||||
<action name="stop" timeout="100" />
|
||||
<action name="monitor" timeout="20" depth="0"/>
|
||||
<action name="meta-data" timeout="5" />
|
||||
<action name="validate-all" timeout="30" />
|
||||
</actions>
|
||||
</resource-agent>
|
||||
END
|
||||
@ -440,10 +82,8 @@ start) o2cb_start
|
||||
;;
|
||||
stop) o2cb_stop
|
||||
;;
|
||||
monitor) o2cb_monitor
|
||||
;;
|
||||
validate-all) o2cb_validate
|
||||
;;
|
||||
monitor) o2cb_monitor
|
||||
;;
|
||||
usage|help) o2cb_usage
|
||||
exit $OCF_SUCCESS
|
||||
;;
|
||||
|
@ -1,3 +1,86 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 13 08:34:08 UTC 2013 - lmb@suse.com
|
||||
|
||||
- Move static libraries to devel-static subpackage.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 12 09:30:27 UTC 2013 - lzhong@suse.com
|
||||
|
||||
- mkfs.ocfs2/tunefs.ocfs2 may hang there because of dlm_unlock
|
||||
+bug-838705-change_dlm_lib.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 5 07:24:42 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- mkfs.ocfs2 aborts if cluster information is not found/supplied
|
||||
+ 0009-mkfs.ocfs2-Abort-if-cluster-information-is-not-detec.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Sep 3 09:14:16 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- Make mount.ocfs2 load ocfs2 kmp and setup cluster_stack if
|
||||
not found
|
||||
+ 0008-mount.ocfs2-Read-stack-from-device-and-setup-stack-i.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 22 13:18:01 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- Mark o2cb.ocf as obsolete. Anyone using o2cb.ocf will get an
|
||||
info message stating so.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 20 08:02:13 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- The nocontrold effort (added nocontrold patches and disabled
|
||||
corosync-2.3 controld compatibility patches):
|
||||
+ 0001-libo2cb-Remove-controld-actions-from-group-join-leav.patch
|
||||
+ 0002-libo2cb-Remove-rest-of-controld-functions.patch
|
||||
+ 0003-Get-cluster-name-from-corosync-cmap.patch
|
||||
+ 0004-Remove-controld-structures-from-debugfs.ocfs2.patch
|
||||
+ 0005-Check-for-DLM-kernel-version-in-user_begin_group_joi.patch
|
||||
+ 0006-Add-cmap-and-dlm-libraries-in-the-tools.patch
|
||||
- 0001-Remove-pacemaker-ais-stuff.patch
|
||||
- 0002-Add-corosync-cfg-to-get-configuration-information.patch
|
||||
- 0003-Remove-daemon-protocol-versions-and-consolidate-fs-v.patch
|
||||
- 0005-Add-cluster_name-and-stack-name.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Aug 17 09:26:19 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- libocfs2-Change-asserts-to-error.patch: Return control to
|
||||
fsck.ocfs2 instead of erring
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 9 13:55:01 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- Add libraries back in devel package. This is required for
|
||||
ocfs2-test
|
||||
- libocfs2-needs-libaio.patch: Add -laio to ocfs2.pc
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 6 09:21:41 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- Fix FS protocol versions:
|
||||
+ 0003-Remove-daemon-protocol-versions-and-consolidate-fs-v.patch
|
||||
- 0003-Hard-code-protocol-versions.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 31 08:01:02 CDT 2013 - rgoldwyn@suse.com
|
||||
|
||||
- Get ocfs2_controld up to speed with corosync 2.3.x
|
||||
+ 0001-Remove-pacemaker-ais-stuff.patch
|
||||
+ 0002-Add-corosync-cfg-to-get-configuration-information.patch
|
||||
+ 0003-Hard-code-protocol-versions.patch
|
||||
+ 0005-Add-cluster_name-and-stack-name.patch
|
||||
- ocfs2_controld-pacemaker.diff
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 22 10:57:44 UTC 2013 - ygao@suse.com
|
||||
|
||||
- ocfs2_controld: ocfs2_controld-pacemaker.diff
|
||||
* Replace use of send_ais_text() with send_cluster_text()
|
||||
* Replace use of ais_dispatch() with plugin_dispatch()
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jul 3 07:40:31 CDT 2013 - rgoldwyn@suse.com
|
||||
- ocfs2console-libraries-include-aio.patch: Include aio
|
||||
|
@ -29,7 +29,6 @@ Source2: reflink.tar.bz2
|
||||
Patch101: force-debug.patch
|
||||
Patch102: extra-debug.patch
|
||||
Patch103: debug-ocfs2_hb_ctl.patch
|
||||
Patch104: ocfs2_controld-pacemaker.diff
|
||||
Patch105: bug-470741-debug_start_failures.patch
|
||||
Patch106: ocfs2-devel.diff
|
||||
Patch107: reflink-no-syscall.patch
|
||||
@ -46,14 +45,24 @@ Patch212: bug-805764-ocfs2-controld.patch
|
||||
Patch213: bnc804707-reduce-RR-priority.patch
|
||||
Patch214: use-symlink-in-udev-rules.patch
|
||||
Patch215: ocfs2console-libraries-include-aio.patch
|
||||
Patch220: libocfs2-needs-libaio.patch
|
||||
Patch221: libocfs2-Change-asserts-to-error.patch
|
||||
Patch222: 0001-libo2cb-Remove-controld-actions-from-group-join-leav.patch
|
||||
Patch223: 0002-libo2cb-Remove-rest-of-controld-functions.patch
|
||||
Patch224: 0003-Get-cluster-name-from-corosync-cmap.patch
|
||||
Patch225: 0004-Remove-controld-structures-from-debugfs.ocfs2.patch
|
||||
Patch226: 0005-Check-for-DLM-kernel-version-in-user_begin_group_joi.patch
|
||||
Patch227: 0006-Add-cmap-and-dlm-libraries-in-the-tools.patch
|
||||
Patch228: 0008-mount.ocfs2-Read-stack-from-device-and-setup-stack-i.patch
|
||||
Patch229: 0009-mkfs.ocfs2-Abort-if-cluster-information-is-not-detec.patch
|
||||
Patch230: bug-838705-change_dlm_lib.patch
|
||||
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: e2fsprogs-devel
|
||||
BuildRequires: libaio-devel
|
||||
BuildRequires: libbz2-devel
|
||||
BuildRequires: libcorosync-devel
|
||||
BuildRequires: libdlm-devel
|
||||
BuildRequires: libopenais-devel
|
||||
BuildRequires: libpacemaker-devel
|
||||
BuildRequires: libxslt-devel
|
||||
BuildRequires: libz1
|
||||
BuildRequires: python-devel
|
||||
@ -69,7 +78,6 @@ Requires: e2fsprogs
|
||||
Requires: glib2 >= 2.2.3
|
||||
Requires: modutils
|
||||
Requires: net-tools
|
||||
Requires: openais
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%if 0%{?suse_version} < 1120
|
||||
# There's no separate kmp for openSUSE 11.2
|
||||
@ -77,7 +85,7 @@ Recommends: ocfs2-kmp
|
||||
%endif
|
||||
|
||||
%description
|
||||
OCFS is the Oracle Cluster File System.
|
||||
OCFS2 is the Oracle Cluster File System.
|
||||
|
||||
This package contains the core user-space tools needed for creating and
|
||||
managing the file system.
|
||||
@ -95,7 +103,7 @@ Provides: ocfs2-support = %{version}
|
||||
Obsoletes: ocfs2-support < %{version}
|
||||
|
||||
%description -n ocfs2console
|
||||
OCFS is the Oracle Cluster Filesystem.
|
||||
OCFS2 is the Oracle Cluster Filesystem.
|
||||
|
||||
This package contains additional tools and a GUI (python-gtk).
|
||||
|
||||
@ -107,10 +115,23 @@ Requires: libcom_err-devel
|
||||
Requires: ocfs2-tools = %{version}
|
||||
|
||||
%description devel
|
||||
OCFS is the Oracle Cluster File System.
|
||||
OCFS2 is the Oracle Cluster File System.
|
||||
|
||||
This package contains the header files and static libraries for
|
||||
developing low-level OCFS2-aware applications.
|
||||
This package contains the header files for developing low-level
|
||||
OCFS2-aware applications.
|
||||
|
||||
%package devel-static
|
||||
Summary: Oracle Cluster File System 2 static libraries
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libcom_err
|
||||
Requires: libcom_err-devel
|
||||
Requires: ocfs2-tools = %{version}
|
||||
|
||||
%description devel-static
|
||||
OCFS2 is the Oracle Cluster File System.
|
||||
|
||||
This package contains the static libraries for developing low-level
|
||||
OCFS2-aware applications.
|
||||
|
||||
%package o2cb
|
||||
Summary: Oracle Cluster File System 2 Core Tools
|
||||
@ -128,7 +149,6 @@ managing the file system.
|
||||
%patch101 -p1
|
||||
%patch102 -p1
|
||||
%patch103 -p1
|
||||
%patch104 -p1
|
||||
%patch105 -p1
|
||||
%patch106 -p1
|
||||
%patch107 -p0
|
||||
@ -145,6 +165,17 @@ managing the file system.
|
||||
%patch213 -p1
|
||||
%patch214 -p1
|
||||
%patch215 -p1
|
||||
%patch220 -p1
|
||||
%patch221 -p1
|
||||
%patch222 -p1
|
||||
%patch223 -p1
|
||||
%patch224 -p1
|
||||
%patch225 -p1
|
||||
%patch226 -p1
|
||||
%patch227 -p1
|
||||
%patch228 -p1
|
||||
%patch229 -p1
|
||||
%patch230 -p1
|
||||
|
||||
%build
|
||||
export PROJECT="ocfs2-tools"
|
||||
@ -181,9 +212,10 @@ cd ..
|
||||
|
||||
mv %{buildroot}/{,/usr}/sbin/o2image
|
||||
mv %{buildroot}/{,/usr}/sbin/debugfs.ocfs2
|
||||
mv %{buildroot}/{,/usr}/sbin/ocfs2_controld.pcmk
|
||||
find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
|
||||
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
|
||||
#mv %{buildroot}/{,/usr}/sbin/ocfs2_controld.pcmk
|
||||
chmod a-x %{buildroot}/%{_libdir}/libo2cb.a
|
||||
chmod a-x %{buildroot}/%{_libdir}/libo2dlm.a
|
||||
chmod a-x %{buildroot}/%{_libdir}/libocfs2.a
|
||||
python -c "import compileall; compileall.compile_dir('%{buildroot}/%{py_sitedir}/ocfs2interface', ddir='%{py_sitedir}/ocfs2interface')"
|
||||
|
||||
%preun o2cb
|
||||
@ -210,7 +242,6 @@ python -c "import compileall; compileall.compile_dir('%{buildroot}/%{py_sitedir}
|
||||
/sbin/o2cluster
|
||||
%{_sbindir}/o2image
|
||||
%{_sbindir}/debugfs.ocfs2
|
||||
%{_sbindir}/ocfs2_controld.pcmk
|
||||
%{_sbindir}/o2hbmonitor
|
||||
%{_bindir}/reflink
|
||||
%{_bindir}/o2info
|
||||
@ -265,4 +296,10 @@ python -c "import compileall; compileall.compile_dir('%{buildroot}/%{py_sitedir}
|
||||
%{_libdir}/pkgconfig/o2dlm.pc
|
||||
%{_libdir}/pkgconfig/ocfs2.pc
|
||||
|
||||
%files devel-static
|
||||
%defattr(-,root,root)
|
||||
%{_libdir}/libo2cb.a
|
||||
%{_libdir}/libo2dlm.a
|
||||
%{_libdir}/libocfs2.a
|
||||
|
||||
%changelog
|
||||
|
@ -1,60 +0,0 @@
|
||||
Index: ocfs2-tools/ocfs2_controld/pacemaker.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2_controld/pacemaker.c 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/ocfs2_controld/pacemaker.c 2012-11-26 16:16:38.000000000 -0600
|
||||
@@ -28,9 +28,8 @@
|
||||
#define SUPPORT_HEARTBEAT 0
|
||||
|
||||
#include <pacemaker/crm/crm.h>
|
||||
-#include <pacemaker/crm/ais.h>
|
||||
-#include <pacemaker/crm/common/cluster.h>
|
||||
-#include <pacemaker/crm/common/stack.h>
|
||||
+#include <pacemaker/crm/cluster.h>
|
||||
+#include <pacemaker/crm/cluster/plugin.h>
|
||||
#include <pacemaker/crm/common/ipc.h>
|
||||
#include <pacemaker/crm/msg_xml.h>
|
||||
|
||||
@@ -47,6 +46,7 @@ static char * clustername = "pacemaker"
|
||||
extern struct list_head mounts;
|
||||
const char *stackname = "pcmk";
|
||||
|
||||
+static crm_cluster_t crm_cluster;
|
||||
extern int ais_fd_async;
|
||||
char *local_node_uname = NULL;
|
||||
|
||||
@@ -138,28 +138,29 @@ static void dead_pcmk(int ci)
|
||||
connection_dead(ci);
|
||||
}
|
||||
|
||||
-extern void terminate_ais_connection(void);
|
||||
-
|
||||
void exit_stack(void)
|
||||
{
|
||||
log_debug("closing pacemaker connection");
|
||||
- terminate_ais_connection();
|
||||
+ crm_cluster_disconnect(&crm_cluster);
|
||||
}
|
||||
|
||||
static void process_pcmk(int ci)
|
||||
{
|
||||
- ais_dispatch(ais_fd_async, NULL);
|
||||
+ ais_dispatch(NULL);
|
||||
}
|
||||
|
||||
int setup_stack(void)
|
||||
{
|
||||
- crm_log_init("ocfs2_controld", LOG_INFO, FALSE, TRUE, 0, NULL);
|
||||
+ crm_log_init("ocfs2_controld", LOG_INFO, FALSE, TRUE, 0, NULL, FALSE);
|
||||
|
||||
- if(init_ais_connection(NULL, NULL, NULL, &local_node_uname, &our_nodeid) == FALSE) {
|
||||
+ if(crm_cluster_connect(&crm_cluster) == FALSE) {
|
||||
log_error("Connection to our AIS plugin (CRM) failed");
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ local_node_uname = crm_cluster.uname;
|
||||
+ our_nodeid = crm_cluster.nodeid;
|
||||
+
|
||||
/* Sign up for membership updates */
|
||||
send_ais_text(crm_class_notify, "true", TRUE, NULL, crm_msg_ais);
|
||||
|
Loading…
Reference in New Issue
Block a user