Compare commits
No commits in common. "90019cba7d6a56d965c2406585cc18acfea96c7f" and "edd3cb75bbd68005566ebc80114fb262dcbfe8d7" have entirely different histories.
90019cba7d
...
edd3cb75bb
@ -1,84 +0,0 @@
|
|||||||
From 030d7edb179235b7df65ada3a79837b01e682a5b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
|
||||||
Date: Thu, 21 Jul 2022 10:48:21 +0200
|
|
||||||
Subject: [PATCH] Fix: query-watchdog: avoid issues on heap allocation failing
|
|
||||||
|
|
||||||
coverity is moaning either due to slight code rearangement
|
|
||||||
or new version/settings.
|
|
||||||
---
|
|
||||||
src/sbd-common.c | 27 ++++++++++++++++++++++++++-
|
|
||||||
1 file changed, 26 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/src/sbd-common.c b/src/sbd-common.c
|
|
||||||
index f3f226a..3abf75f 100644
|
|
||||||
--- a/src/sbd-common.c
|
|
||||||
+++ b/src/sbd-common.c
|
|
||||||
@@ -385,8 +385,17 @@ watchdog_populate_list(void)
|
|
||||||
struct link_list_item *lli =
|
|
||||||
calloc(1, sizeof(struct link_list_item));
|
|
||||||
|
|
||||||
+ if (lli == NULL) {
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
lli->dev_node = strdup(buf);
|
|
||||||
lli->link_name = strdup(entry_name);
|
|
||||||
+ if ((lli->dev_node == NULL) || (lli->link_name == NULL)) {
|
|
||||||
+ free(lli->dev_node);
|
|
||||||
+ free(lli->link_name);
|
|
||||||
+ free(lli);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
lli->next = link_list;
|
|
||||||
link_list = lli;
|
|
||||||
}
|
|
||||||
@@ -404,18 +413,27 @@ watchdog_populate_list(void)
|
|
||||||
if(!stat(entry_name, &statbuf) && S_ISCHR(statbuf.st_mode) &&
|
|
||||||
is_watchdog(statbuf.st_rdev)) {
|
|
||||||
|
|
||||||
- int wdfd = watchdog_init_fd(entry_name, -1);
|
|
||||||
+ int wdfd;
|
|
||||||
struct watchdog_list_item *wdg =
|
|
||||||
calloc(1, sizeof(struct watchdog_list_item));
|
|
||||||
int len;
|
|
||||||
struct link_list_item *tmp_list = NULL;
|
|
||||||
|
|
||||||
+ if (wdg == NULL) {
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
wdg->dev = statbuf.st_rdev;
|
|
||||||
wdg->dev_node = strdup(entry_name);
|
|
||||||
+ if (wdg->dev_node == NULL) {
|
|
||||||
+ free(wdg);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
wdg->next = watchdog_list;
|
|
||||||
watchdog_list = wdg;
|
|
||||||
watchdog_list_items++;
|
|
||||||
|
|
||||||
+ wdfd = watchdog_init_fd(entry_name, -1);
|
|
||||||
if (wdfd >= 0) {
|
|
||||||
struct watchdog_info ident;
|
|
||||||
|
|
||||||
@@ -450,11 +468,18 @@ watchdog_populate_list(void)
|
|
||||||
struct watchdog_list_item *dupe_wdg =
|
|
||||||
calloc(1, sizeof(struct watchdog_list_item));
|
|
||||||
|
|
||||||
+ if (dupe_wdg == NULL) {
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
/* as long as we never purge watchdog_list
|
|
||||||
* there is no need to dupe strings
|
|
||||||
*/
|
|
||||||
*dupe_wdg = *wdg;
|
|
||||||
dupe_wdg->dev_node = strdup(tmp_list->link_name);
|
|
||||||
+ if (dupe_wdg->dev_node == NULL) {
|
|
||||||
+ free(dupe_wdg);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
dupe_wdg->next = watchdog_list;
|
|
||||||
watchdog_list = dupe_wdg;
|
|
||||||
watchdog_list_items++;
|
|
||||||
--
|
|
||||||
2.39.0
|
|
||||||
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
From 48c9a11e5b4ace22011e51d4c5dcacaddf9bbc43 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
|
||||||
Date: Fri, 3 Feb 2023 10:58:10 +0100
|
|
||||||
Subject: [PATCH] Refactor: sbd-md: alloc/de-alloc reverse order
|
|
||||||
|
|
||||||
Having de-allocation in the reverse order compared to
|
|
||||||
allocation seems to make gcc-12 static analysis of
|
|
||||||
dynamic-memory-management happy.
|
|
||||||
---
|
|
||||||
src/sbd-md.c | 11 +++++------
|
|
||||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/sbd-md.c b/src/sbd-md.c
|
|
||||||
index 7a37522..2a237ad 100644
|
|
||||||
--- a/src/sbd-md.c
|
|
||||||
+++ b/src/sbd-md.c
|
|
||||||
@@ -441,9 +441,9 @@ init_device(struct sbd_context *st)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-out: free(s_node);
|
|
||||||
+out: free(s_mbox);
|
|
||||||
+ free(s_node);
|
|
||||||
free(s_header);
|
|
||||||
- free(s_mbox);
|
|
||||||
return(rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -556,9 +556,9 @@ slot_allocate(struct sbd_context *st, const char *name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-out: free(s_node);
|
|
||||||
+out: free(s_mbox);
|
|
||||||
+ free(s_node);
|
|
||||||
free(s_header);
|
|
||||||
- free(s_mbox);
|
|
||||||
return(rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1279,11 +1279,10 @@ int servant_md(const char *diskname, int mode, const void* argp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
out:
|
|
||||||
- free(s_header);
|
|
||||||
free(s_node);
|
|
||||||
free(s_mbox);
|
|
||||||
+ free(s_header);
|
|
||||||
close_device(st);
|
|
||||||
exit(rc);
|
|
||||||
}
|
|
||||||
|
|
||||||
-
|
|
||||||
--
|
|
||||||
2.39.0
|
|
||||||
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
From 0e4534ebdfe8d7a37beb0028e604e560a5674891 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
|
||||||
Date: Fri, 3 Feb 2023 15:35:22 +0100
|
|
||||||
Subject: [PATCH] spec: convert license naming to SPDX
|
|
||||||
|
|
||||||
---
|
|
||||||
sbd.spec | 4 ++--
|
|
||||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/sbd.spec b/sbd.spec
|
|
||||||
index e9ff7bc..b9e7f72 100644
|
|
||||||
--- a/sbd.spec
|
|
||||||
+++ b/sbd.spec
|
|
||||||
@@ -49,7 +49,7 @@
|
|
||||||
|
|
||||||
Name: sbd
|
|
||||||
Summary: Storage-based death
|
|
||||||
-License: GPLv2+
|
|
||||||
+License: GPL-2.0-or-later
|
|
||||||
Group: System Environment/Daemons
|
|
||||||
Version: 1.5.2
|
|
||||||
Release: 99.%{buildnum}.%{shortcommit}.%{modified}git%{?dist}
|
|
||||||
@@ -95,7 +95,7 @@ Available rpmbuild rebuild options:
|
|
||||||
|
|
||||||
%package tests
|
|
||||||
Summary: Storage-based death environment for regression tests
|
|
||||||
-License: GPLv2+
|
|
||||||
+License: GPL-2.0-or-later
|
|
||||||
Group: System Environment/Daemons
|
|
||||||
|
|
||||||
%description tests
|
|
||||||
--
|
|
||||||
2.39.0
|
|
||||||
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
From 367f461470a14a5441bbc016a72eede23b4ed151 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
|
||||||
Date: Wed, 20 Mar 2024 08:47:37 +0100
|
|
||||||
Subject: [PATCH] test: load libaio.so instead of libaio.so.1
|
|
||||||
|
|
||||||
as that is rather what sbd would link against without preloading
|
|
||||||
on distros linking different library versions under these 2 names
|
|
||||||
---
|
|
||||||
tests/sbd-testbed.c | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/tests/sbd-testbed.c b/tests/sbd-testbed.c
|
|
||||||
index 91920f2..02844a7 100644
|
|
||||||
--- a/tests/sbd-testbed.c
|
|
||||||
+++ b/tests/sbd-testbed.c
|
|
||||||
@@ -154,7 +154,7 @@ init (void)
|
|
||||||
orig_fopen = (orig_fopen_f_type)dlsym_fatal(RTLD_NEXT,"fopen");
|
|
||||||
orig_fclose = (orig_fclose_f_type)dlsym_fatal(RTLD_NEXT,"fclose");
|
|
||||||
|
|
||||||
- handle = dlopen("libaio.so.1", RTLD_NOW);
|
|
||||||
+ handle = dlopen("libaio.so", RTLD_NOW);
|
|
||||||
if (!handle) {
|
|
||||||
fprintf(stderr, "Failed opening libaio.so.1\n");
|
|
||||||
exit(1);
|
|
||||||
--
|
|
||||||
2.25.1
|
|
||||||
|
|
||||||
BIN
sbd-6bb085f5704dd4c3841c79504f2aed2228e6d76a.tar.gz
Normal file
BIN
sbd-6bb085f5704dd4c3841c79504f2aed2228e6d76a.tar.gz
Normal file
Binary file not shown.
Binary file not shown.
66
sbd.spec
66
sbd.spec
@ -1,41 +1,23 @@
|
|||||||
%global longcommit cf5c2208bad2db2dff9b09624b89b05415c3bc11
|
%global longcommit 6bb085f5704dd4c3841c79504f2aed2228e6d76a
|
||||||
%global shortcommit %(echo %{longcommit}|cut -c1-8)
|
%global shortcommit %(echo %{longcommit}|cut -c1-8)
|
||||||
%global modified %(echo %{longcommit}-|cut -f2 -d-)
|
%global modified %(echo %{longcommit}-|cut -f2 -d-)
|
||||||
%global github_owner Clusterlabs
|
%global github_owner Clusterlabs
|
||||||
%global buildnum 2
|
%global buildnum 1
|
||||||
|
|
||||||
%global watchdog_timeout_default 5
|
%global watchdog_timeout_default 5
|
||||||
|
|
||||||
# Be careful with sync_resource_startup_default
|
|
||||||
# being enabled. This configuration has
|
|
||||||
# to be in sync with configuration in pacemaker
|
|
||||||
# where it is called sbd_sync - assure by e.g.
|
|
||||||
# mutual rpm dependencies.
|
|
||||||
%bcond_without sync_resource_startup_default
|
|
||||||
# Syncing enabled per default will lead to
|
|
||||||
# syncing enabled on upgrade without adaption
|
|
||||||
# of the config.
|
|
||||||
# Setting can still be overruled via sysconfig.
|
|
||||||
# The setting in the config-template packaged
|
|
||||||
# will follow the default if below is is left
|
|
||||||
# empty. But it is possible to have the setting
|
|
||||||
# in the config-template deviate from the default
|
|
||||||
# by setting below to an explicit 'yes' or 'no'.
|
|
||||||
%global sync_resource_startup_sysconfig ""
|
%global sync_resource_startup_sysconfig ""
|
||||||
|
|
||||||
|
%bcond_without sync_resource_startup_default
|
||||||
|
|
||||||
Name: sbd
|
Name: sbd
|
||||||
Summary: Storage-based death
|
Summary: Storage-based death
|
||||||
License: GPL-2.0-or-later
|
License: GPLv2 and MIT
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
Version: 1.5.2
|
Version: 1.5.1
|
||||||
Release: %{buildnum}
|
Release: %{buildnum}
|
||||||
Url: https://github.com/%{github_owner}/%{name}
|
Url: https://github.com/%{github_owner}/%{name}
|
||||||
Source0: https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz
|
Source0: https://github.com/%{github_owner}/%{name}/archive/%{longcommit}/%{name}-%{longcommit}.tar.gz
|
||||||
Patch0: 0001-Fix-the-problem-of-service-error-when-uninstalling.patch
|
Patch0: 0001-Fix-the-problem-of-service-error-when-uninstalling.patch
|
||||||
Patch1: 0001-Fix-query-watchdog-avoid-issues-on-heap-allocation-f.patch
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Patch2: 0002-Refactor-sbd-md-alloc-de-alloc-reverse-order.patch
|
|
||||||
Patch3: 0003-spec-convert-license-naming-to-SPDX.patch
|
|
||||||
Patch4: 0004-test-load-libaio.so-instead-of-libaio.so.1.patch
|
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: automake
|
BuildRequires: automake
|
||||||
BuildRequires: libuuid-devel
|
BuildRequires: libuuid-devel
|
||||||
@ -49,24 +31,24 @@ BuildRequires: libxml2-devel
|
|||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
Conflicts: fence-agents-sbd < 4.5.0
|
Conflicts: fence-agents-sbd < 4.2.1
|
||||||
Conflicts: pacemaker-libs < 2.1.0
|
Conflicts: pacemaker-libs < 2.0.5
|
||||||
|
|
||||||
|
ExclusiveArch: x86_64 aarch64
|
||||||
|
|
||||||
ExclusiveArch: x86_64 aarch64 riscv64 loongarch64 ppc64le
|
|
||||||
%if %{defined systemd_requires}
|
%if %{defined systemd_requires}
|
||||||
%systemd_requires
|
%systemd_requires
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
|
|
||||||
This package contains the storage-based death functionality.
|
This package contains the storage-based death functionality.
|
||||||
|
|
||||||
Available rpmbuild rebuild options:
|
Available rpmbuild rebuild options:
|
||||||
--with(out) : sync_resource_startup_default
|
--with(out) : sync_resource_startup_default
|
||||||
|
|
||||||
%package tests
|
%package tests
|
||||||
Summary: Storage-based death environment for regression tests
|
Summary: Storage-based death environment for regression tests
|
||||||
License: GPL-2.0-or-later
|
License: GPLv2 and MIT
|
||||||
|
Group: System Environment/Daemons
|
||||||
|
|
||||||
%description tests
|
%description tests
|
||||||
This package provides an environment + testscripts for
|
This package provides an environment + testscripts for
|
||||||
@ -84,11 +66,10 @@ export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
|
|||||||
--with-runstatedir=%{_rundir}
|
--with-runstatedir=%{_rundir}
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
%install
|
|
||||||
|
|
||||||
|
%install
|
||||||
make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
|
make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
|
||||||
rm -rf ${RPM_BUILD_ROOT}%{_libdir}/stonith
|
rm -rf ${RPM_BUILD_ROOT}%{_libdir}/stonith
|
||||||
|
|
||||||
install -D -m 0755 tests/regressions.sh $RPM_BUILD_ROOT/usr/share/sbd/regressions.sh
|
install -D -m 0755 tests/regressions.sh $RPM_BUILD_ROOT/usr/share/sbd/regressions.sh
|
||||||
%if %{defined _unitdir}
|
%if %{defined _unitdir}
|
||||||
install -D -m 0644 src/sbd.service $RPM_BUILD_ROOT/%{_unitdir}/sbd.service
|
install -D -m 0644 src/sbd.service $RPM_BUILD_ROOT/%{_unitdir}/sbd.service
|
||||||
@ -102,10 +83,10 @@ install -m 644 src/sbd.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/sbd
|
|||||||
find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
|
find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
|
||||||
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
|
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
|
||||||
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf %{buildroot}
|
rm -rf %{buildroot}
|
||||||
|
|
||||||
|
|
||||||
%if %{defined _unitdir}
|
%if %{defined _unitdir}
|
||||||
%post
|
%post
|
||||||
%systemd_post sbd.service
|
%systemd_post sbd.service
|
||||||
@ -151,21 +132,6 @@ fi
|
|||||||
%{_libdir}/libsbdtestbed*
|
%{_libdir}/libsbdtestbed*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Thu Apr 25 2024 zouzhimin <zouzhimin@kylinos.cn> - 1.5.2-2
|
|
||||||
- test: load libaio.so instead of libaio.so.1
|
|
||||||
|
|
||||||
* Wed Mar 27 2024 bizhiyuan <bizhiyuan@kylinos.cn> - 1.5.2-1
|
|
||||||
- Update to 1.5.2
|
|
||||||
|
|
||||||
* Wed Mar 6 2024 xurui <rui.xu@shingroup.cn> - 1.5.1-4
|
|
||||||
- Add ppc64le to ExclusiveArch
|
|
||||||
|
|
||||||
* Fri Nov 24 2023 xuxiaojuan <xuxiaojuan@kylinos.cn> - 1.5.1-3
|
|
||||||
- Add loongarch64 to ExclusiveArch
|
|
||||||
|
|
||||||
* Mon Jun 05 2023 laokz <zhangkai@iscas.ac.cn> - 1.5.1-2
|
|
||||||
- Add riscv64 to ExclusiveArch
|
|
||||||
|
|
||||||
* Thu Feb 02 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 1.5.1-1
|
* Thu Feb 02 2023 jiangxinyu <jiangxinyu@kylinos.cn> - 1.5.1-1
|
||||||
- Update package to version 1.5.1
|
- Update package to version 1.5.1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user