ocfs2-tools: update to v1.8.8

Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
This commit is contained in:
Anthony Iliopoulos 2023-12-06 16:44:32 +01:00
parent bbc8b8d099
commit ad4dae7248
23 changed files with 11 additions and 1074 deletions

View File

@ -1,86 +0,0 @@
From f7ea242d2bf76c71cfe7fd9555d44c2486610486 Mon Sep 17 00:00:00 2001
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
Date: Fri, 27 Dec 2013 10:01:33 -0600
Subject: [PATCH] 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.4

View File

@ -1,28 +0,0 @@
From 15891da74943b0f878b486741ff67507b9bd6177 Mon Sep 17 00:00:00 2001
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
Date: Fri, 23 May 2014 11:41:24 -0500
Subject: [PATCH 7/7] Improve error message if DLM service is unavailable
o2dlm_initialize_fsdlm to return O2DLM_ET_SERVICE_UNAVAILABLE if
DLM service is not running (ENOTCONN).
---
libo2dlm/o2dlm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libo2dlm/o2dlm.c b/libo2dlm/o2dlm.c
index dbc642b..c0fbb21 100644
--- a/libo2dlm/o2dlm.c
+++ b/libo2dlm/o2dlm.c
@@ -1035,6 +1035,9 @@ static errcode_t o2dlm_initialize_fsdlm(const char *domain_name,
case EPERM:
ret = O2DLM_ET_BAD_DOMAIN_DIR;
break;
+ case ENOTCONN:
+ ret = O2DLM_ET_SERVICE_UNAVAILABLE;
+ break;
default:
ret = O2DLM_ET_INTERNAL_FAILURE;
break;
--
1.8.4.5

View File

@ -1,165 +0,0 @@
From c89760fc41f466a7a2be99ed2f648875c2d64e7a Mon Sep 17 00:00:00 2001
From: Eric Ren <zren@suse.com>
Date: Thu, 23 Jul 2015 17:13:39 +0800
Subject: [PATCH 2/3] vendor: Add vendor files for sles12
Add vendor files for sles12, and enable systemd support for o2cb
based on the patch named "add systemd support" from "Junxiao Bi"
<junxiao.bi@oracle.com>.
Signed-off-by: Eric Ren <zren@suse.com>
---
vendor/Makefile | 2 +-
vendor/sles12/Makefile | 10 +++++++
vendor/sles12/Vendor.make | 11 +++++++
vendor/sles12/rpmarch.guess | 70 +++++++++++++++++++++++++++++++++++++++++++++
vendor/sles12/vendor.guess | 13 +++++++++
5 files changed, 105 insertions(+), 1 deletion(-)
create mode 100644 vendor/sles12/Makefile
create mode 100644 vendor/sles12/Vendor.make
create mode 100755 vendor/sles12/rpmarch.guess
create mode 100755 vendor/sles12/vendor.guess
diff --git a/vendor/Makefile b/vendor/Makefile
index 58ac84d..022d030 100644
--- a/vendor/Makefile
+++ b/vendor/Makefile
@@ -2,6 +2,6 @@ TOPDIR = ..
include $(TOPDIR)/Preamble.make
-SUBDIRS = common rhel7 rhel6 rhel5 sles10 rhel4 sles9 fc7 fc8 fc9
+SUBDIRS = common sles12 rhel7 rhel6 rhel5 sles10 rhel4 sles9 fc7 fc8 fc9
include $(TOPDIR)/Postamble.make
diff --git a/vendor/sles12/Makefile b/vendor/sles12/Makefile
new file mode 100644
index 0000000..89c16a7
--- /dev/null
+++ b/vendor/sles12/Makefile
@@ -0,0 +1,10 @@
+TOPDIR = ../..
+
+include $(TOPDIR)/Preamble.make
+
+DIST_FILES = \
+ rpmarch.guess \
+ Vendor.make \
+ vendor.guess
+
+include $(TOPDIR)/Postamble.make
diff --git a/vendor/sles12/Vendor.make b/vendor/sles12/Vendor.make
new file mode 100644
index 0000000..b186054
--- /dev/null
+++ b/vendor/sles12/Vendor.make
@@ -0,0 +1,11 @@
+#
+# SLES 12
+#
+
+TOOLSARCH = $(shell $(TOPDIR)/vendor/sles12/rpmarch.guess tools $(TOPDIR))
+VENDOR_EXTENSION = SLE12
+SYSTEMD_ENABLED = 1
+
+include $(TOPDIR)/vendor/common/Vendor.make
+
+packages: rpm
diff --git a/vendor/sles12/rpmarch.guess b/vendor/sles12/rpmarch.guess
new file mode 100755
index 0000000..3514627
--- /dev/null
+++ b/vendor/sles12/rpmarch.guess
@@ -0,0 +1,70 @@
+#! /bin/sh
+
+mode="$1"
+srcdir="$2"
+
+host_cpu=
+
+QUERYFILE=/etc/SuSE-release
+
+if test -n "$QUERYFILE"; then
+ host_cpu="`rpm -qf $QUERYFILE --queryformat \"%{ARCH}\"`"
+fi
+
+if test -z "$host_cpu" -o "$host_cpu" = "noarch" ; then
+ host_alias=`$srcdir/config.guess`
+ host=`$srcdir/config.sub $host_alias`
+ host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+fi
+
+case "$host_cpu" in
+ x86_64|ia64|s390x)
+ TOOLSARCH="$host_cpu"
+ ;;
+ i386|i486|i586|i686|i786|k6|k7)
+ TOOLSARCH="i386"
+ ;;
+ ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+ TOOLSARCH="ppc"
+ ;;
+ *)
+ echo "rpmarch.guess: Warning: unknown RPM CPU architecture: $host_cpu" >&2
+ TOOLSARCH=""
+ ;;
+esac
+
+# Only a few of these need to be overwritten from RPM's default
+case "$host_cpu" in
+ i586)
+ MODULEARCH="$host_cpu"
+ ;;
+ i386|i686)
+ MODULEARCH="i586"
+ ;;
+ ppc|ppc64|ppciseries|ppcpseries|ppc64iseries|ppc64pseries|powerpc|powerpc64)
+ MODULEARCH="ppc64"
+ ;;
+ *)
+ MODULEARCH=""
+ ;;
+esac
+
+case "$mode" in
+ module)
+ if [ -n "$MODULEARCH" ] ; then
+ echo "--target $MODULEARCH"
+ fi
+ ;;
+ tools)
+ if [ -n "$TOOLSARCH" ] ; then
+ echo "--target $TOOLSARCH"
+ fi
+ ;;
+ *)
+ echo "rpmarch.guess: Invalid mode: $mode" >&2
+ echo "error"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/vendor/sles12/vendor.guess b/vendor/sles12/vendor.guess
new file mode 100755
index 0000000..83ce085
--- /dev/null
+++ b/vendor/sles12/vendor.guess
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ ! -f /etc/SuSE-release ]
+then
+ exit 1
+fi
+
+if [ "`rpm -qf /etc/SuSE-release --qf '%{VERSION}' 2>/dev/null`" != "12" ]
+then
+ exit 1
+fi
+
+exit 0
--
2.1.4

View File

@ -1,30 +0,0 @@
From dc357b652edb7e8e2970fd6f4549c433710093b8 Mon Sep 17 00:00:00 2001
From: Eric Ren <zren@suse.com>
Date: Tue, 8 Sep 2015 10:27:51 +0800
Subject: [PATCH 3/3] ocfs2-tools: add systemd support fix
The ocfs2.service should be after remote-fs.target so that iscsi
volume would be available at first.
Signed-off-by: Eric Ren <zren at suse.com>
Reviewed-by: Junxiao Bi <junxiao.bi at oracle.com>
---
vendor/common/ocfs2.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/vendor/common/ocfs2.service b/vendor/common/ocfs2.service
index 768f806..c7ecbea 100644
--- a/vendor/common/ocfs2.service
+++ b/vendor/common/ocfs2.service
@@ -2,7 +2,7 @@
Description=Mount ocfs2 Filesystems
Documentation=man:ocfs2(7) man:mount.ocfs2(8)
Requires=o2cb.service
-After=o2cb.service
+After=o2cb.service remote-fs.target
[Service]
Type=oneshot
--
2.1.4

View File

@ -1,13 +0,0 @@
Index: ocfs2-tools-1.8.5/libo2cb/o2cb_abi.c
===================================================================
--- a/libo2cb/o2cb_abi.c
+++ b/libo2cb/o2cb_abi.c
@@ -201,7 +201,7 @@ redo:
}
} else if (len == -ENOENT) {
if (!setup_performed) {
- o2cb_setup_stack(OCFS2_CLASSIC_CLUSTER_STACK);
+ o2cb_setup_stack(OCFS2_PCMK_CLUSTER_STACK);
setup_performed = 1;
goto redo;
} else {

View File

@ -1,120 +0,0 @@
From ec2ee1c946ceefacb9f0df5d942d0a1dac40af9a Mon Sep 17 00:00:00 2001
From: Steffen Butzer <steffen.butzer@outlook.com>
Date: Sat, 16 Jul 2022 18:36:44 +0200
Subject: [PATCH] dump_fs_locks: support v4
---
debugfs.ocfs2/dump_fs_locks.c | 42 +++++++++++++++++++++++++----------
1 file changed, 30 insertions(+), 12 deletions(-)
diff --git a/debugfs.ocfs2/dump_fs_locks.c b/debugfs.ocfs2/dump_fs_locks.c
index 05f5227470b0..546213cdc210 100644
--- a/debugfs.ocfs2/dump_fs_locks.c
+++ b/debugfs.ocfs2/dump_fs_locks.c
@@ -225,13 +225,14 @@ static void dump_meta_lvb(const char *raw_lvb, FILE *out)
}
/* 0 = eof, > 0 = success, < 0 = error */
-static int dump_version_two_and_three(FILE *file, FILE *out, int v3)
+static int dump_version_two_or_more(FILE *file, FILE *out, int version)
{
unsigned long long num_prmode, num_exmode;
unsigned int num_prmode_failed, num_exmode_failed;
unsigned long long total_prmode, total_exmode;
unsigned long long avg_prmode = 0, avg_exmode = 0;
unsigned int max_prmode, max_exmode, num_refresh;
+ unsigned long long last_prmode, last_exmode, wait;
int ret;
#define NSEC_PER_USEC 1000
@@ -244,7 +245,10 @@ static int dump_version_two_and_three(FILE *file, FILE *out, int v3)
"%llu\t"
"%u\t"
"%u\t"
- "%u",
+ "%u\t"
+ "%llu\t"
+ "%llu\t"
+ "%llu",
&num_prmode,
&num_exmode,
&num_prmode_failed,
@@ -253,13 +257,16 @@ static int dump_version_two_and_three(FILE *file, FILE *out, int v3)
&total_exmode,
&max_prmode,
&max_exmode,
- &num_refresh);
- if (ret != 9) {
+ &num_refresh,
+ &last_prmode,
+ &last_exmode,
+ &wait);
+ if (ret != 12) {
ret = -EINVAL;
goto out;
}
- if (!v3) {
+ if (version < 3) {
max_prmode /= NSEC_PER_USEC;
max_exmode /= NSEC_PER_USEC;
}
@@ -271,14 +278,26 @@ static int dump_version_two_and_three(FILE *file, FILE *out, int v3)
avg_exmode = total_exmode/num_exmode;
fprintf(out, "PR > Gets: %llu Fails: %u Waits Total: %lluus "
- "Max: %uus Avg: %lluns\n",
+ "Max: %uus Avg: %lluns",
num_prmode, num_prmode_failed, total_prmode/NSEC_PER_USEC,
max_prmode, avg_prmode);
+ if (version > 3) {
+ fprintf(out, " Last: %lluus", last_prmode);
+ }
+ fprintf(out, "\n");
fprintf(out, "EX > Gets: %llu Fails: %u Waits Total: %lluus "
- "Max: %uus Avg: %lluns\n",
+ "Max: %uus Avg: %lluns",
num_exmode, num_exmode_failed, total_exmode/NSEC_PER_USEC,
max_exmode, avg_exmode);
- fprintf(out, "Disk Refreshes: %u\n", num_refresh);
+ if (version > 3) {
+ fprintf(out, " Last: %lluus", last_exmode);
+ }
+ fprintf(out, "\n");
+ fprintf(out, "Disk Refreshes: %u", num_refresh);
+ if (version > 3) {
+ fprintf(out, " First Wait: %lluus", wait);
+ }
+ fprintf(out, "\n");
ret = 1;
out:
@@ -388,13 +407,13 @@ static int end_line(FILE *f)
return 0;
}
-#define CURRENT_PROTO 3
+#define CURRENT_PROTO 4
/* returns 0 on error or end of file */
static int dump_one_lockres(FILE *file, FILE *out, int lvbs, int only_busy,
struct list_head *locklist)
{
unsigned int version;
- int ret, v3;
+ int ret;
int skipped = 0;
ret = fscanf(file, "%x\t", &version);
@@ -413,8 +432,7 @@ static int dump_one_lockres(FILE *file, FILE *out, int lvbs, int only_busy,
if (!skipped) {
if (version > 1) {
- v3 = !!(version == 3);
- ret = dump_version_two_and_three(file, out, v3);
+ ret = dump_version_two_or_more(file, out, version);
if (ret <= 0)
return 0;
}
--
2.26.2

View File

@ -1,39 +0,0 @@
Index: ocfs2-tools/libo2cb/o2cb_err.et
===================================================================
--- ocfs2-tools.orig/libo2cb/o2cb_err.et 2012-08-24 10:22:54.000000000 -0500
+++ ocfs2-tools/libo2cb/o2cb_err.et 2012-08-24 10:23:03.000000000 -0500
@@ -33,6 +33,12 @@ ec O2CB_ET_IO,
ec O2CB_ET_SERVICE_UNAVAILABLE,
"Unable to access cluster service"
+ec O2CB_ET_SERVICE_HANDSHAKE_UNAVAILABLE,
+ "Unable to access cluster serivce due to bad handshake"
+
+ec O2CB_ET_SERVICE_DEV_UNAVAILABLE,
+ "Unable to access cluster service device"
+
ec O2CB_ET_INTERNAL_FAILURE,
"Internal logic failure"
Index: ocfs2-tools/libo2cb/o2cb_abi.c
===================================================================
--- ocfs2-tools.orig/libo2cb/o2cb_abi.c 2012-08-24 10:22:54.000000000 -0500
+++ ocfs2-tools/libo2cb/o2cb_abi.c 2012-08-24 10:23:03.000000000 -0500
@@ -2367,7 +2367,7 @@ static errcode_t o2cb_control_handshake(
if (ret != 0)
err = O2CB_ET_IO;
else if (!found)
- err = O2CB_ET_SERVICE_UNAVAILABLE; /* no match */
+ err = O2CB_ET_SERVICE_HANDSHAKE_UNAVAILABLE; /* no match */
break;
}
@@ -2424,7 +2424,7 @@ errcode_t o2cb_control_open(unsigned int
case ENOTDIR:
case ENOENT:
case EISDIR:
- err = O2CB_ET_SERVICE_UNAVAILABLE;
+ err = O2CB_ET_SERVICE_DEV_UNAVAILABLE;
break;
case EACCES:

View File

@ -1,104 +0,0 @@
Index: ocfs2-tools/ocfs2_hb_ctl/ocfs2_hb_ctl.c
===================================================================
--- ocfs2-tools.orig/ocfs2_hb_ctl/ocfs2_hb_ctl.c
+++ ocfs2-tools/ocfs2_hb_ctl/ocfs2_hb_ctl.c
@@ -39,6 +39,7 @@
#include <string.h>
#include <sys/stat.h>
#include <signal.h>
+#include <syslog.h>
#include "ocfs2/ocfs2.h"
@@ -137,6 +138,7 @@ static errcode_t get_desc(const char *de
if (!region_desc->r_name || !region_desc->r_device_name)
err = OCFS2_ET_NO_MEMORY;
} else {
+ syslog(LOG_INFO, "filled heartbeat desc, err: %d\n", (int)err);
region_desc->r_name = NULL;
region_desc->r_device_name = NULL;
goto out_close;
@@ -157,6 +159,7 @@ static errcode_t get_desc(const char *de
err = OCFS2_ET_NO_MEMORY;
}
} else {
+ syslog(LOG_INFO, "filled cluster desc, err: %d\n", (int)err);
cluster_desc->c_stack = NULL;
cluster_desc->c_cluster = NULL;
}
@@ -202,9 +205,9 @@ static errcode_t compare_dev(const char
/* Any problem with getting the descriptor is NOT FOUND */
err = OCFS2_ET_FILE_NOT_FOUND;
- if (get_desc(device))
+ if (get_desc(device)) {
goto out;
-
+ }
if (!strcmp(region_desc->r_name, hbo->uuid_str)) {
hbo->dev_str = device;
err = 0;
@@ -381,12 +384,19 @@ static errcode_t stop_heartbeat(struct h
{
errcode_t err = 0;
- if (!hbo->dev_str)
+ if (!hbo->dev_str) {
err = lookup_dev(hbo);
+ if (err)
+ syslog(LOG_INFO, "looked up device, ret: %d\n",
+ (int)err);
+ }
if (!err) {
region_desc->r_persist = 1; /* hb_ctl is for reals */
region_desc->r_service = hbo->service;
err = o2cb_group_leave(cluster_desc, region_desc);
+ if (err)
+ syslog(LOG_INFO, "left group - err: %d\n",
+ (int)err);
}
return err;
@@ -536,14 +546,42 @@ static void print_usage(int err)
fprintf(output, " %s -h\n", progname);
}
+static int
+hack_enable_coredumps(void)
+{
+ struct rlimit rlim;
+
+ if (getrlimit(RLIMIT_CORE, &rlim) < 0) {
+ return -1;
+ }
+
+ rlim.rlim_max = RLIM_INFINITY;
+ setrlimit(RLIMIT_CORE, &rlim);
+ (void)chdir("/var/lib/openais");
+ return 0;
+}
+
+
int main(int argc, char **argv)
{
errcode_t err = 0;
int ret = 0;
+ int i;
struct hb_ctl_options hbo = {
.action = HB_ACTION_UNKNOWN,
};
char *hbuuid = NULL;
+ char tmp[1024];
+
+ openlog("ocfs2_hb_ctl", LOG_CONS|LOG_NDELAY|LOG_PID, LOG_KERN);
+ sprintf(tmp, "ocfs2_hb_ctl");
+ for (i = 0; i < argc; i++) {
+ strncat(tmp, " ", sizeof(tmp)-1);
+ strncat(tmp, argv[i], sizeof(tmp)-1);
+ }
+ syslog(LOG_INFO, "%s\n", tmp);
+
+ hack_enable_coredumps();
setbuf(stdout, NULL);
setbuf(stderr, NULL);

View File

@ -1,24 +0,0 @@
Index: ocfs2-tools/vendor/common/ocfs2.init
===================================================================
--- ocfs2-tools.orig/vendor/common/ocfs2.init
+++ ocfs2-tools/vendor/common/ocfs2.init
@@ -107,9 +107,6 @@ FUSER=`which fuser`
case "$1" in
start|reload)
- if [ -d /var/lock/subsys ] ; then
- touch /var/lock/subsys/ocfs2
- fi
if [ -n "`ocfs2fstab`" ] ; then
echo -n "Starting Oracle Cluster File System (OCFS2) "
mount -at ocfs2
@@ -143,9 +140,6 @@ case "$1" in
retry=$(($retry - 1))
sig=-9
done
- if [ -z "$remaining" ] && [ -e /var/lock/subsys/ocfs2 ] ; then
- rm /var/lock/subsys/ocfs2
- fi
[ -z "$remaining" ] && success_status
;;
restart|force-reload)

View File

@ -1,32 +0,0 @@
Index: ocfs2-tools/configure.in
===================================================================
--- ocfs2-tools.orig/configure.in 2012-08-24 10:22:47.000000000 -0500
+++ ocfs2-tools/configure.in 2012-08-24 10:23:24.000000000 -0500
@@ -276,9 +276,12 @@ if test "x$cpg_found" = "xyes"; then
# TRY="$TRY"
saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $TRY -lcpg"
+ saved_LIBS="$LIBS"
+ LDFLAGS="$LDFLAGS $TRY"
+ LIBS="-lcpg"
AC_LINK_IFELSE([AC_LANG_CALL([], [cpg_initialize])],
cpg_found=yes)
+ LIBS="$saved_LIBS"
LDFLAGS="$saved_LDFLAGS"
if test "x$cpg_found" = "xyes"; then
@@ -320,9 +323,12 @@ if test "x$ckpt_found" = "xyes"; then
# TRY="$TRY"
saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $TRY -lSaCkpt"
+ saved_LIBS="$LIBS"
+ LDFLAGS="$LDFLAGS $TRY"
+ LIBS="-lSaCkpt"
AC_LINK_IFELSE([AC_LANG_CALL([], [saCkptInitialize])],
ckpt_found=yes)
+ LIBS="$saved_LIBS"
LDFLAGS="$saved_LDFLAGS"
if test "x$ckpt_found" = "xyes"; then

View File

@ -1,45 +0,0 @@
From 34888925e54a210cb0e7989eef57ea8041fbc9e8 Mon Sep 17 00:00:00 2001
From: Kastixx <b.m.kast@gmail.com>
Date: Tue, 19 Oct 2021 01:32:14 +0300
Subject: [PATCH 1/2] Fixed `mounted.ocfs2` output when some devices are Not
Ready
When `mounted.ocfs2 -d` (quick scan) encounters a device in Not Ready state, it tries to read the device, fails, and in theory should skip it and proceed to the next one. However, due to an integer comparison with mixed signedness it does not break out of a read loop when `do_pread` returns an error code (-1), and fills the structure for current file system with the data that is left in the buffer from the previous file system.
In such conditions, the command produces the following output:
```
# these two devices are working
/dev/mapper/360000970000197600444533037353334_part1 pcmk hacluster B9223C9922754CE88236EDDE6B281D15 ALPHA
/dev/mapper/360000970000197600444533037353335_part1 pcmk hacluster ACAC4B66517D4EDEA6FA8A9D8E9FC9CF BETA
# these two are not ready
/dev/mapper/360000970000197600444533037423031 pcmk hacluster ACAC4B66517D4EDEA6FA8A9D8E9FC9CF BETA
/dev/mapper/360000970000197600444533037423032 pcmk hacluster ACAC4B66517D4EDEA6FA8A9D8E9FC9CF BETA
# this one is OK
/dev/mapper/360000970000197600444533037423030_part1 pcmk hacluster 7A0C73F5A4C04135874F307384D3F67E GAMMA
# these two are not ready again
/dev/mapper/360000970000197600444533037423033 pcmk hacluster 7A0C73F5A4C04135874F307384D3F67E GAMMA
/dev/mapper/360000970000197600444533037423034 pcmk hacluster 7A0C73F5A4C04135874F307384D3F67E GAMMA
```
Here, labels and UUIDs for offline devices are the same as for preceding active ones.
The fix converts the unsigned value returned by `sizeof` to signed integer explicitly.
---
mounted.ocfs2/mounted.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mounted.ocfs2/mounted.c b/mounted.ocfs2/mounted.c
index 8902fe0c..4fc53da5 100644
--- a/mounted.ocfs2/mounted.c
+++ b/mounted.ocfs2/mounted.c
@@ -530,7 +530,7 @@ static void do_quick_detect(struct list_head *dev_list)
for (offset = 1; offset <= 8; offset <<= 1) {
ret = do_pread(fd, buf, sizeof(buf), (offset * 1024));
- if (ret < sizeof(buf))
+ if (ret < (int) sizeof(buf))
break;
di = (struct ocfs2_dinode *)buf;
if (!memcmp(di->i_signature,
--
2.12.3

View File

@ -1,54 +0,0 @@
From 7085e9177adc7197250d872c50a05dfc9c531bdc Mon Sep 17 00:00:00 2001
From: Konstantin N <b.m.kast@gmail.com>
Date: Thu, 3 Mar 2022 00:56:44 +0300
Subject: [PATCH] fsck.ocfs2: do not try locking after replaying journals if -F
is given
With -F option, `fsck.ocfs2` skips locking down the cluster, but not if
the journals are replayed. If it has to replay the journals then it
tries to lock down the cluster regardless of -F.
This fix moves the check to `fsck_lock_fs()` function so the flag
is checked in any case when cluster locking is attempted.
Signed-off-by: Konstantin Neshin <b.m.kast@gmail.com>
---
fsck.ocfs2/fsck.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/fsck.ocfs2/fsck.c b/fsck.ocfs2/fsck.c
index 757224f43846..13d68f9862f9 100644
--- a/fsck.ocfs2/fsck.c
+++ b/fsck.ocfs2/fsck.c
@@ -707,6 +707,10 @@ static errcode_t fsck_lock_fs(o2fsck_state *ost)
{
errcode_t ret;
+ if (!(ost->ost_fs->fs_flags & OCFS2_FLAG_RW) || ost->ost_skip_o2cb ||
+ ocfs2_mount_local(ost->ost_fs))
+ return 0;
+
ret = o2cb_init();
if (ret) {
com_err(whoami, ret, "while initializing the cluster");
@@ -986,13 +990,10 @@ int main(int argc, char **argv)
goto out;
}
- if (open_flags & OCFS2_FLAG_RW && !ost->ost_skip_o2cb &&
- !ocfs2_mount_local(ost->ost_fs)) {
- ret = fsck_lock_fs(ost);
- if (ret) {
- fsck_mask |= FSCK_ERROR;
- goto close;
- }
+ ret = fsck_lock_fs(ost);
+ if (ret) {
+ fsck_mask |= FSCK_ERROR;
+ goto close;
}
printf("Checking OCFS2 filesystem in %s:\n", filename);
--
2.34.1

View File

@ -1,110 +0,0 @@
From cd88c938afc7ce28efe032ba6081e8a77c5f4c52 Mon Sep 17 00:00:00 2001
From: Gang He <ghe@suse.com>
Date: Thu, 4 Nov 2021 13:57:34 +0800
Subject: [PATCH] libocfs2: roll-back when dir_index creation fails
When we try to create a directory index tree, we should truncate
the directory index tree if this creation failed for some reason,
e.g. there is not any more blocks to allocate.
Otherwise, the file was attached a problematic directory index
tree, this index will affect file lookup under this directory file.
---
libocfs2/dir_indexed.c | 40 ++++++++++++++++++++++++++--------------
1 file changed, 26 insertions(+), 14 deletions(-)
diff --git a/libocfs2/dir_indexed.c b/libocfs2/dir_indexed.c
index f59d9455..e5da18d5 100644
--- a/libocfs2/dir_indexed.c
+++ b/libocfs2/dir_indexed.c
@@ -1239,20 +1239,26 @@ errcode_t ocfs2_dx_dir_build(ocfs2_filesys *fs,
goto out;
ret = ocfs2_malloc_block(fs->fs_io, &dx_buf);
- if (ret)
+ if (ret) {
+ ocfs2_delete_dx_root(fs, dr_blkno);
goto out;
+ }
ret = ocfs2_read_dx_root(fs, dr_blkno, dx_buf);
- if (ret)
+ if (ret) {
+ ocfs2_delete_dx_root(fs, dr_blkno);
goto out;
+ }
dx_root = (struct ocfs2_dx_root_block *)dx_buf;
/* set inode to use indexed-dirs */
di->i_dyn_features |= OCFS2_INDEXED_DIR_FL;
ret = ocfs2_init_dir_trailers(fs, di, dx_root);
- if (ret)
+ if (ret) {
+ ocfs2_delete_dx_root(fs, dr_blkno);
goto out;
+ }
dx_root->dr_dir_blkno = di->i_blkno;
dx_root->dr_num_entries = 0;
@@ -1261,11 +1267,15 @@ errcode_t ocfs2_dx_dir_build(ocfs2_filesys *fs,
di->i_dx_root = dr_blkno;
ret = ocfs2_write_dx_root(fs, dr_blkno, dx_buf);
- if (ret)
+ if (ret) {
+ ocfs2_delete_dx_root(fs, dr_blkno);
goto out;
+ }
ret = ocfs2_write_inode(fs, dir, di_buf);
- if (ret)
+ if (ret) {
+ ocfs2_delete_dx_root(fs, dr_blkno);
goto out;
+ }
ctxt.dir_blkno = dir;
ctxt.dx_root_blkno = dr_blkno;
@@ -1276,18 +1286,18 @@ errcode_t ocfs2_dx_dir_build(ocfs2_filesys *fs,
if (ctxt.err)
ret = ctxt.err;
if (ret)
- goto out;
+ goto trunc_out;
ret = ocfs2_read_dx_root(fs, dr_blkno, dx_buf);
if (ret)
- goto out;
+ goto trunc_out;
ret = ocfs2_read_inode(fs, dir, di_buf);
if (ret)
- goto out;
+ goto trunc_out;
ret = ocfs2_write_inode(fs, dir, di_buf);
- if(ret)
- goto out;
+ if (ret)
+ goto trunc_out;
/* check quota for dx_leaf */
change = ocfs2_clusters_to_bytes(fs,
@@ -1297,10 +1307,12 @@ errcode_t ocfs2_dx_dir_build(ocfs2_filesys *fs,
ret = ocfs2_apply_quota_change(fs, usrhash, grphash,
uid, gid, change, 0);
- if (ret) {
- /* exceed quota, truncate the indexed tree */
- ret = ocfs2_dx_dir_truncate(fs, dir);
- }
+
+trunc_out:
+ /* if the indexed dir attribute creation fails,
+ * we must roll back */
+ if (ret)
+ ocfs2_dx_dir_truncate(fs, dir);
out:
err = ocfs2_finish_quota_change(fs, usrhash, grphash);
--
2.12.3

View File

@ -1,57 +0,0 @@
Index: ocfs2-tools/vendor/common/o2cb.init.sh
===================================================================
--- ocfs2-tools.orig/vendor/common/o2cb.init.sh 2012-08-24 10:22:54.000000000 -0500
+++ ocfs2-tools/vendor/common/o2cb.init.sh 2012-08-24 10:23:09.000000000 -0500
@@ -8,7 +8,8 @@
# Provides: o2cb
# Required-Start: $network
# Should-Start:
-# Required-Stop:
+# Should-Stop:
+# Required-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: Load O2CB cluster services at system boot.
@@ -671,7 +672,7 @@ status_filesystem()
status_daemon()
{
- DAEMON="/sbin/ocfs2_controld.${O2CB_STACK}"
+ DAEMON="/usr/sbin/ocfs2_controld.${O2CB_STACK}"
echo -n "Checking for control daemon: "
if [ -n "$(pidofproc "$DAEMON")" ]
then
@@ -700,6 +701,7 @@ bringup_daemon()
fi
sleep 1
done
+ sleep 2
return 0
}
@@ -707,7 +709,7 @@ bringup_daemon()
kill_daemon()
{
SIGNAL="$1"
- DAEMON="/sbin/ocfs2_controld.${O2CB_STACK}"
+ DAEMON="/usr/sbin/ocfs2_controld.${O2CB_STACK}"
status_daemon >/dev/null 2>&1 || return 2
Index: ocfs2-tools/vendor/common/ocfs2.init
===================================================================
--- ocfs2-tools.orig/vendor/common/ocfs2.init 2012-08-24 10:22:54.000000000 -0500
+++ ocfs2-tools/vendor/common/ocfs2.init 2012-08-24 10:23:09.000000000 -0500
@@ -8,9 +8,9 @@
### BEGIN INIT INFO
# Provides: ocfs2
# Required-Start: $network o2cb
-# Required-Stop:
-# X-UnitedLinux-Should-Start:
-# X-UnitedLinux-Should-Stop:
+# Required-Stop: $null
+# Should-Start:
+# Should-Stop:
# Default-Start: 2 3 5
# Default-Stop:
# Short-Description: Mount OCFS2 volumes at boot.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0d87b9982b6c186f963b39ba4a667d307efe4337748c02aa194f9fe6519bfac8
size 1522282

BIN
ocfs2-tools-1.8.8.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,14 +0,0 @@
Index: ocfs2-tools/include/ocfs2-kernel/ocfs2_fs.h
===================================================================
--- ocfs2-tools.orig/include/ocfs2-kernel/ocfs2_fs.h 2012-08-24 10:22:41.000000000 -0500
+++ ocfs2-tools/include/ocfs2-kernel/ocfs2_fs.h 2012-08-24 10:23:30.000000000 -0500
@@ -329,6 +329,9 @@
*/
#define OCFS2_CLUSTER_O2CB_GLOBAL_HEARTBEAT (0x01)
+// Reintroduce umode_t, which disappeared in kernel 3.3
+typedef unsigned short umode_t;
+
struct ocfs2_system_inode_info {
char *si_name;
int si_iflags;

View File

@ -1,12 +0,0 @@
Index: ocfs2-tools/ocfs2_hb_ctl/ocfs2_hb_ctl.c
===================================================================
--- ocfs2-tools.orig/ocfs2_hb_ctl/ocfs2_hb_ctl.c
+++ ocfs2-tools/ocfs2_hb_ctl/ocfs2_hb_ctl.c
@@ -40,6 +40,7 @@
#include <sys/stat.h>
#include <signal.h>
#include <syslog.h>
+#include <sys/resource.h>
#include "ocfs2/ocfs2.h"

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Dec 6 15:41:04 UTC 2023 - Anthony Iliopoulos <ailiop@suse.com>
- update to v1.8.8
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Oct 24 10:06:00 UTC 2022 - heming.zhao@suse.com Mon Oct 24 10:06:00 UTC 2022 - heming.zhao@suse.com

View File

@ -1,7 +1,7 @@
# #
# spec file for package ocfs2-tools # spec file for package ocfs2-tools
# #
# Copyright (c) 2021 SUSE LLC # Copyright (c) 2023 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -43,33 +43,13 @@
%endif %endif
Name: ocfs2-tools Name: ocfs2-tools
Version: 1.8.7 Version: 1.8.8
Release: 0 Release: 0
Summary: Oracle Cluster File System 2 Core Tools Summary: Oracle Cluster File System 2 Core Tools
License: GPL-2.0-only License: GPL-2.0-only
Group: System/Filesystems Group: System/Filesystems
URL: https://ocfs2.wiki.kernel.org/ URL: https://ocfs2.wiki.kernel.org/
Source: ocfs2-tools-%{version}.tar.gz Source: ocfs2-tools-%{version}.tar.gz
Source1: reflink.tar.bz2
Patch001: auto-setup-pcmk-stack-as-default-if-no-stack-is-setup.patch
Patch103: debug-ocfs2_hb_ctl.patch
Patch105: bug-470741-debug_start_failures.patch
Patch106: ocfs2-devel.diff
Patch107: reflink-no-syscall.patch
Patch202: fix-configure-check-libs.patch
Patch204: dont-use-var-lock-subsys.patch
Patch205: ocfs2-tools-kernel33.patch
Patch206: ocfs2-tools-resource.patch
Patch225: 0004-mkfs.ocfs2-Abort-if-cluster-information-is-not-detec.patch
Patch228: 0007-Improve-error-message-if-DLM-service-is-unavailable.patch
Patch405: 0007-vendor-Add-vendor-files-for-sles12.patch
Patch406: 0008-ocfs2-tools-add-systemd-support-fix.patch
# below are upstream patches
Patch501: fixed-mounted.ocfs2-output-when-some-devices-are-Not.patch
Patch502: update-mounted.ocfs2-mounted.c.patch
Patch503: libocfs2-roll-back-when-dir_index-creation-fails.patch
Patch504: fsck.ocfs2-do-not-try-locking-after-replaying-journa.patch
Patch505: bug-1203166-dump_fs_locks-support-v4.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: e2fsprogs-devel BuildRequires: e2fsprogs-devel
@ -163,25 +143,7 @@ This package contains the tools to manage the native o2cb stack for the
OCFS2 filesystem. OCFS2 filesystem.
%prep %prep
%setup -q -a 1 %setup -q
%patch001 -p1
%patch103 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p0
%patch202 -p1
%patch204 -p1
%patch205 -p1
%patch206 -p1
%patch225 -p1
%patch228 -p1
%patch405 -p1
%patch406 -p1
%patch501 -p1
%patch502 -p1
%patch503 -p1
%patch504 -p1
%patch505 -p1
%build %build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
@ -202,12 +164,6 @@ autoreconf -fi -I /usr/share/aclocal
make OPTS="%{optflags}" make OPTS="%{optflags}"
cd reflink
cp ../config.guess ../config.sub coreutils-6.9/build-aux/
%configure
make reflink
cd ..
%install %install
mkdir -p %{buildroot}%{sbindir} mkdir -p %{buildroot}%{sbindir}
mkdir -p %{buildroot}%{_prefix}/bin mkdir -p %{buildroot}%{_prefix}/bin
@ -231,10 +187,6 @@ cp -f vendor/common/o2cb.sysconfig %{buildroot}%{_fillupdir}/sysconfig.o2cb
%endif %endif
make DESTDIR="%{buildroot}" install make DESTDIR="%{buildroot}" install
cd reflink
make DESTDIR="%{buildroot}" install
cd ..
%if 0%{?suse_version} < 1550 %if 0%{?suse_version} < 1550
mv %{buildroot}/{,/usr}/sbin/o2image mv %{buildroot}/{,/usr}/sbin/o2image
mv %{buildroot}/{,/usr}/sbin/debugfs.ocfs2 mv %{buildroot}/{,/usr}/sbin/debugfs.ocfs2
@ -293,7 +245,6 @@ python -c "import compileall; compileall.compile_dir('%{buildroot}/%{py_sitedir}
%{_sbindir}/o2image %{_sbindir}/o2image
%{_sbindir}/debugfs.ocfs2 %{_sbindir}/debugfs.ocfs2
%{_sbindir}/o2hbmonitor %{_sbindir}/o2hbmonitor
%{_bindir}/reflink
%{_bindir}/o2info %{_bindir}/o2info
%{_udevrulesdir}/51-ocfs2.rules %{_udevrulesdir}/51-ocfs2.rules
%{_mandir}/man8/debugfs.ocfs2.8* %{_mandir}/man8/debugfs.ocfs2.8*

View File

@ -1,57 +0,0 @@
Index: reflink/coreutils-6.9/src/ln.c
===================================================================
--- reflink.orig/coreutils-6.9/src/ln.c
+++ reflink/coreutils-6.9/src/ln.c
@@ -152,52 +152,6 @@ target_directory_operand (char const *fi
return is_a_dir;
}
-#ifndef HAVE_REFLINK
-# ifndef HAVE_REFLINKAT
-# include <sys/syscall.h>
-
-# ifndef SYS_reflinkat
-# ifdef __i386__
-# define __NR_reflinkat 337
-# endif
-# ifdef __x86_64__
-# define __NR_reflinkat 299
-# endif
-# define SYS_reflinkat __NR_reflinkat
-# endif /* SYS_reflinkat */
-
-# ifdef SYS_reflinkat
-static int reflinkat(int olddirfd, const char *oldpath,
- int newdirfd, const char *newpath,
- int preserve, int flags)
-{
- return syscall(SYS_reflinkat, olddirfd, oldpath, newdirfd, newpath,
- preserve, flags);
-}
-# else
-static int reflinkat(int olddirfd, const char *oldpath,
- int newdirfd, const char *newpath,
- int preserve, int flags)
-{
- return -ENOSYS;
-}
-# endif /* SYS_reflinkat */
-# endif /* HAVE_REFLINKAT */
-
-/*
- * We've now defined reflinkat of some sort. We can use it to build
- * reflink.
- */
-# ifndef AT_FDCWD
-# define AT_FDCWD -100
-# endif
-static int reflink(const char *oldpath, const char *newpath,
- int preserve)
-{
- return reflinkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, preserve, 0);
-}
-#endif /* HAVE_REFLINK */
-
#ifndef REFLINK_ATTR_NONE
# define REFLINK_ATTR_NONE 0
#endif

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d197e3c716ab12213332d9787375fecda0ede55508ca1e71aec9922e8c124ba5
size 5167807

View File

@ -1,26 +0,0 @@
From 2fad0b521e244844a6a95e9f1df6201f5f51a203 Mon Sep 17 00:00:00 2001
From: Kastixx <b.m.kast@gmail.com>
Date: Tue, 19 Oct 2021 12:50:19 +0300
Subject: [PATCH 2/2] Update mounted.ocfs2/mounted.c
Co-authored-by: Yuri Kotov <jura.kotov@gmail.com>
---
mounted.ocfs2/mounted.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mounted.ocfs2/mounted.c b/mounted.ocfs2/mounted.c
index 4fc53da5..4e399910 100644
--- a/mounted.ocfs2/mounted.c
+++ b/mounted.ocfs2/mounted.c
@@ -530,7 +530,7 @@ static void do_quick_detect(struct list_head *dev_list)
for (offset = 1; offset <= 8; offset <<= 1) {
ret = do_pread(fd, buf, sizeof(buf), (offset * 1024));
- if (ret < (int) sizeof(buf))
+ if (ret == -1 || ret != sizeof(buf))
break;
di = (struct ocfs2_dinode *)buf;
if (!memcmp(di->i_signature,
--
2.12.3