!20 LVM-activate: Avoid false positive for VG activation

From: @bixiaoyan1 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
This commit is contained in:
openeuler-ci-bot 2024-02-23 08:45:00 +00:00 committed by Gitee
commit 9187e8df63
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 55 additions and 2 deletions

View File

@ -0,0 +1,49 @@
From 65a066cf9066390db65c4875e21c4c391793b9ae Mon Sep 17 00:00:00 2001
From: Arslan Ahmad <arslan.ahmad97@googlemail.com>
Date: Tue, 16 Jan 2024 09:11:17 +0530
Subject: [PATCH] Avoid false positive for VG activation
When lvm.conf file has `volume_list` parameter configured and the
cluster is managing the shared storage using `system_id_source`,
then the activation of the LV fails to happen. However it is
reported as a success.
The fixes will avoid starting of `LVM-activate` resource when
the cluster is configured with both `system_id_source` and
`volume_list`.
Signed-off-by: Arslan Ahmad <arslan.ahmad97@googlemail.com>
---
heartbeat/LVM-activate | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/heartbeat/LVM-activate b/heartbeat/LVM-activate
index f6f24a3b..3858ed8d 100755
--- a/heartbeat/LVM-activate
+++ b/heartbeat/LVM-activate
@@ -448,6 +448,10 @@ systemid_check()
{
# system_id_source is set in lvm.conf
source=$(lvmconfig 'global/system_id_source' 2>/dev/null | cut -d"=" -f2)
+
+ # Is volume_list set in lvm.conf
+ vol_list=$(lvmconfig 'activation/volume_list' 2>/dev/null | cut -d"=" -f2)
+
if [ "$source" = "" ] || [ "$source" = "none" ]; then
ocf_exit_reason "system_id_source in lvm.conf is not set correctly!"
exit $OCF_ERR_ARGS
@@ -458,6 +462,11 @@ systemid_check()
exit $OCF_ERR_ARGS
fi
+ if [ -n "$source" ] && [ -n "$vol_list" ]; then
+ ocf_exit_reason "Both system_id_source & volume_list cannot be defined!"
+ exit $OCF_ERR_ARGS
+ fi
+
return $OCF_SUCCESS
}
--
2.25.1

View File

@ -1,7 +1,7 @@
Name: resource-agents Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 4.13.0 Version: 4.13.0
Release: 5 Release: 6
License: GPLv2+ and LGPLv2+ License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/resource-agents URL: https://github.com/ClusterLabs/resource-agents
Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz
@ -10,6 +10,7 @@ Patch0001: Fix-PRIMARY_IFACE-variable.patch
Patch0002: fix-loopback-handling.patch Patch0002: fix-loopback-handling.patch
Patch0003: fix-handler-out-of-scope-leak.patch Patch0003: fix-handler-out-of-scope-leak.patch
Patch0004: fix-uninitialized-value-covscan-error.patch Patch0004: fix-uninitialized-value-covscan-error.patch
Patch0005: Avoid-false-positive-for-VG-activation.patch
Obsoletes: heartbeat-resources <= %{version} Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version} Provides: heartbeat-resources = %{version}
BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel
@ -107,7 +108,10 @@ export CFLAGS="$(echo '%{optflags}')"
%{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*}
%changelog %changelog
* Fri Feb 23 2024 bixiaoyan <bixiaoyoan@kylinos.cn> - 4.13.0-5 * Fri Feb 23 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-6
- LVM-activate: Avoid false positive for VG activation
* Fri Feb 23 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-5
- use memset() to fix "uninitialized value" covscan error, as qb_ipcc_recv() will always set a message (according to honzaf) - use memset() to fix "uninitialized value" covscan error, as qb_ipcc_recv() will always set a message (according to honzaf)
* Thu Feb 22 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-4 * Thu Feb 22 2024 bixiaoyan <bixiaoyan@kylinos.cn> - 4.13.0-4