Additional patches for 9.3.0 lvm2

Resolves: #2184390
This commit is contained in:
Marian Csontos 2023-04-05 18:02:55 +02:00
parent 075bd55c91
commit 2114c4103f
4 changed files with 127 additions and 19 deletions

View File

@ -0,0 +1,26 @@
From d1ed4ce6ce9f201435af61982a36f97e9d9d2f94 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Tue, 21 Mar 2023 11:46:54 -0700
Subject: [PATCH] Fix import of utils from lvmdbusd.cfg
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
daemons/lvmdbusd/cfg.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemons/lvmdbusd/cfg.py b/daemons/lvmdbusd/cfg.py
index 9da4b1267..9f4360100 100644
--- a/daemons/lvmdbusd/cfg.py
+++ b/daemons/lvmdbusd/cfg.py
@@ -11,7 +11,7 @@ import os
import multiprocessing
import queue
import itertools
-from utils import LvmDebugData
+from lvmdbusd.utils import LvmDebugData
from lvmdbusd import path
--
2.40.0

View File

@ -0,0 +1,42 @@
From da1255cdb68ab33a90136ebbec2fa0fda034f6a2 Mon Sep 17 00:00:00 2001
From: Tony Asleson <tasleson@redhat.com>
Date: Thu, 30 Mar 2023 10:07:13 -0500
Subject: [PATCH 2/3] lvmdbusd: Correct locking for _common_log
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reduce the lock time and include the flush in the lock.
Reported by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
---
daemons/lvmdbusd/utils.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py
index 6013b656f..fdd7578c1 100644
--- a/daemons/lvmdbusd/utils.py
+++ b/daemons/lvmdbusd/utils.py
@@ -323,16 +323,17 @@ def _format_log_entry(msg):
def _common_log(msg, *attributes):
- cfg.stdout_lock.acquire()
msg = _format_log_entry(msg)
+ cfg.stdout_lock.acquire()
+
if STDOUT_TTY and attributes:
print(color(msg, *attributes))
else:
print(msg)
- cfg.stdout_lock.release()
sys.stdout.flush()
+ cfg.stdout_lock.release()
# Serializes access to stdout to prevent interleaved output
--
2.39.2

View File

@ -0,0 +1,47 @@
From feb7c701aa86fda1f13f6c262770a8e90e8ddb09 Mon Sep 17 00:00:00 2001
From: Tony Asleson <tasleson@redhat.com>
Date: Thu, 30 Mar 2023 10:10:23 -0500
Subject: [PATCH 3/3] lvmdbusd: Correct seg. fault on s390x ELN
syscall 186 is specific to x86 64bit. As this is different from arch
to arch and between same arch different arch size we will only grab
thread ID using built-in python support if it is supported.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2166931
---
daemons/lvmdbusd/utils.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/daemons/lvmdbusd/utils.py b/daemons/lvmdbusd/utils.py
index fdd7578c1..27b869c13 100644
--- a/daemons/lvmdbusd/utils.py
+++ b/daemons/lvmdbusd/utils.py
@@ -11,7 +11,6 @@ import xml.etree.ElementTree as Et
import sys
import inspect
import collections
-import ctypes
import errno
import fcntl
import os
@@ -305,8 +304,16 @@ class DebugMessages(object):
self.queue.clear()
+def _get_tid():
+ try:
+ # Only 3.8 and later have this
+ return threading.get_native_id()
+ except:
+ return -1
+
+
def _format_log_entry(msg):
- tid = ctypes.CDLL('libc.so.6').syscall(186)
+ tid = _get_tid()
if not cfg.systemd and STDOUT_TTY:
msg = "%s: %d:%d - %s" % \
--
2.39.2

View File

@ -1,7 +1,6 @@
%global device_mapper_version 1.02.193
%global enable_cache 1
%global enable_cluster 1
%global enable_lvmdbusd 1
%global enable_lvmlockd 1
%global enable_lvmpolld 1
@ -29,7 +28,6 @@
%if 0%{?rhel} && 0%{?rhel} <= 8
%ifnarch i686 x86_64 ppc64le s390x
%global enable_cluster 0
%global enable_lockd_dlm 0
%endif
@ -38,12 +36,6 @@
%endif
%endif
%if %{enable_cluster}
%global configure_cluster --with-cluster=internal
%else
%global configure_cluster --with-cluster=internal
%endif
%global from_snapshot 0
%if 0%{?from_snapshot}
%global commit 4a1f6173d29a7d7ecab14a9313000aa5f81170d0
@ -63,7 +55,7 @@ Version: 2.03.20
#Release: 0.1.20211115git%{shortcommit}%{?dist}%{?rel_suffix}
Release: 4%{?dist}%{?rel_suffix}
%else
Release: 1%{?dist}%{?rel_suffix}
Release: 2%{?dist}%{?rel_suffix}
%endif
License: GPLv2
URL: http://sourceware.org/lvm2
@ -72,7 +64,10 @@ Source0: lvm2-%{shortcommit}.tgz
%else
Source0: ftp://sourceware.org/pub/lvm2/releases/LVM2.%{version}.tgz
%endif
#Patch1: 0001-*
# BZ2184390:
Patch1: 0001-Fix-import-of-utils-from-lvmdbusd.cfg.patch
Patch2: 0002-lvmdbusd-Correct-locking-for-_common_log.patch
Patch3: 0003-lvmdbusd-Correct-seg.-fault-on-s390x-ELN.patch
BuildRequires: make
BuildRequires: gcc
@ -84,10 +79,7 @@ BuildRequires: libblkid-devel >= %{util_linux_version}
BuildRequires: ncurses-devel
BuildRequires: libedit-devel
BuildRequires: libaio-devel
%if %{enable_cluster}
BuildRequires: corosynclib-devel >= %{corosync_version}
%endif
%if %{enable_cluster} || %{enable_lockd_dlm}
%if %{enable_lockd_dlm}
BuildRequires: dlm-devel >= %{dlm_version}
%endif
BuildRequires: module-init-tools
@ -108,7 +100,7 @@ BuildRequires: sanlock-devel >= %{sanlock_version}
%endif
Requires: %{name}-libs = %{?epoch}:%{version}-%{release}
%if 0%{?fedora}
Requires: system-release >= %{system_release_version}
Requires(post): (system-release >= %{system_release_version} if system-release)
%endif
Requires: bash >= %{bash_version}
Requires(post): systemd-units >= %{systemd_version}, systemd-sysv
@ -131,9 +123,8 @@ or more physical volumes and creating one or more logical volumes
%if 0%{?from_snapshot}
%setup -q -n lvm2-%{commit}
%else
%setup -q -n LVM2.%{version}
%autosetup -p1 -n LVM2.%{version}
%endif
#%%patch1 -p1 -b .backup1
%build
%global _default_pid_dir /run
@ -160,7 +151,6 @@ or more physical volumes and creating one or more logical volumes
--enable-cmdlib \
--enable-dmeventd \
--enable-blkid_wiping \
%{?configure_cluster} \
--with-udevdir=%{_udevdir} --enable-udev_sync \
%if %{enable_thin}
--with-thin=internal \
@ -553,7 +543,7 @@ Version: %{device_mapper_version}
License: GPLv2
URL: http://sources.redhat.com/dm
Requires: device-mapper-libs = %{?epoch}:%{device_mapper_version}-%{release}
Requires: util-linux >= %{util_linux_version}
Requires: util-linux-core >= %{util_linux_version}
Requires: systemd >= %{systemd_version}
# We need dracut to install required udev rules if udev_sync
# feature is turned on so we don't lose required notifications.
@ -705,6 +695,9 @@ An extensive functional testsuite for LVM2.
%endif
%changelog
* Wed Apr 05 2023 Marian Csontos <mcsontos@redhat.com> - 2.03.20-2
- Fix ModuleNotFoundError: No module named 'utils' in lvmdbusd.
* Tue Mar 21 2023 Marian Csontos <mcsontos@redhat.com> - 2.03.20-1
- Update to upstream version 2.03.20.