forked from pool/ocfs2-tools
ab40e465fc
- Make mount.ocfs2 load modules and write cluster_stack: + 0007-mount.ocfs2-performs-module-loading-cluster_stack-se.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/196156 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=64
182 lines
4.2 KiB
Diff
182 lines
4.2 KiB
Diff
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
|
|
|