!75 使用上游社区补丁替代华为补丁
From: @lixiaokeng Reviewed-by: @volcanodragon,@wubo009 Signed-off-by: @wubo009
This commit is contained in:
commit
eaf1da2e13
35
0017-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch
Normal file
35
0017-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From faff5affb1ec7772d7d5c9ceaf1244b35ed12327 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Benjamin Marzinski <bmarzins@redhat.com>
|
||||||
|
Date: Thu, 2 Sep 2021 16:57:48 -0500
|
||||||
|
Subject: [PATCH] libmultipath: deal with dynamic PTHREAD_STACK_MIN
|
||||||
|
|
||||||
|
Starting in glibc-2.34 (commit 5d98a7da), PTHREAD_STACK_MIN is defined
|
||||||
|
as sysconf(_SC_THREAD_STACK_MIN) if _GNU_SOURCE is defined. sysconf()
|
||||||
|
returns a long and can, at least in theory, return -1. This change
|
||||||
|
causes compilation to fail in setup_thread_attr() due to a comparision
|
||||||
|
with different signedness, since stacksize is a size_t.
|
||||||
|
|
||||||
|
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
||||||
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
||||||
|
---
|
||||||
|
libmultipath/util.c | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libmultipath/util.c b/libmultipath/util.c
|
||||||
|
index baebb81..cc10543 100644
|
||||||
|
--- a/libmultipath/util.c
|
||||||
|
+++ b/libmultipath/util.c
|
||||||
|
@@ -223,8 +223,8 @@ setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached)
|
||||||
|
|
||||||
|
ret = pthread_attr_init(attr);
|
||||||
|
assert(ret == 0);
|
||||||
|
- if (stacksize < PTHREAD_STACK_MIN)
|
||||||
|
- stacksize = PTHREAD_STACK_MIN;
|
||||||
|
+ if (PTHREAD_STACK_MIN > 0 && stacksize < (size_t)PTHREAD_STACK_MIN)
|
||||||
|
+ stacksize = (size_t)PTHREAD_STACK_MIN;
|
||||||
|
ret = pthread_attr_setstacksize(attr, stacksize);
|
||||||
|
assert(ret == 0);
|
||||||
|
if (detached) {
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
From 8cce6eb0d83151c97c18094e380d38b6085ff282 Mon Sep 17 00:00:00 2001
|
|
||||||
From: lixiaokeng <lixiaokeng@huawei.com>
|
|
||||||
Date: Wed, 11 Aug 2021 19:42:04 +0800
|
|
||||||
Subject: [PATCH] libmultipath: fix compile error
|
|
||||||
|
|
||||||
There is an error when complie with glibc-2.34:
|
|
||||||
comparison of integer expressions of different signedness:
|
|
||||||
'size_t' {aka 'long unsigned int'} and 'long int'
|
|
||||||
[-Werror=sign-compare]
|
|
||||||
|
|
||||||
Explicit convert PTHREAD_STACK_MIN to size_t to fix it.
|
|
||||||
|
|
||||||
Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
|
|
||||||
---
|
|
||||||
libmultipath/util.c | 5 +++--
|
|
||||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/libmultipath/util.c b/libmultipath/util.c
|
|
||||||
index 1748eaf..4d20cc1 100644
|
|
||||||
--- a/libmultipath/util.c
|
|
||||||
+++ b/libmultipath/util.c
|
|
||||||
@@ -220,11 +220,12 @@ void
|
|
||||||
setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
+ size_t pthread_stack_min = PTHREAD_STACK_MIN;
|
|
||||||
|
|
||||||
ret = pthread_attr_init(attr);
|
|
||||||
assert(ret == 0);
|
|
||||||
- if (stacksize < PTHREAD_STACK_MIN)
|
|
||||||
- stacksize = PTHREAD_STACK_MIN;
|
|
||||||
+ if (stacksize < pthread_stack_min)
|
|
||||||
+ stacksize = pthread_stack_min;
|
|
||||||
ret = pthread_attr_setstacksize(attr, stacksize);
|
|
||||||
assert(ret == 0);
|
|
||||||
if (detached) {
|
|
||||||
--
|
|
||||||
1.8.3.1
|
|
||||||
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#needsrootforbuild
|
#needsrootforbuild
|
||||||
Name: multipath-tools
|
Name: multipath-tools
|
||||||
Version: 0.8.5
|
Version: 0.8.5
|
||||||
Release: 6
|
Release: 7
|
||||||
Summary: Tools to manage multipath devices with the device-mapper
|
Summary: Tools to manage multipath devices with the device-mapper
|
||||||
License: GPL-2.0-or-later and LGPL-2.0-only
|
License: GPL-2.0-or-later and LGPL-2.0-only
|
||||||
URL: http://christophe.varoqui.free.fr/
|
URL: http://christophe.varoqui.free.fr/
|
||||||
@ -25,7 +25,7 @@ Patch13: 0013-fix-find-multipath-failure.patch
|
|||||||
Patch14: 0014-kpartx-change-kpartx-file-and-default-bindir.patch
|
Patch14: 0014-kpartx-change-kpartx-file-and-default-bindir.patch
|
||||||
Patch15: 0015-bugfix-RH-remove-local-disk-from-pathvec.patch
|
Patch15: 0015-bugfix-RH-remove-local-disk-from-pathvec.patch
|
||||||
Patch16: 0016-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch
|
Patch16: 0016-bugfix-clear-mpp-path-reference-when-path-is-freed-otherwis.patch
|
||||||
Patch17: 0017-libmultipath-fix-compile-error.patch
|
Patch17: 0017-libmultipath-deal-with-dynamic-PTHREAD_STACK_MIN.patch
|
||||||
|
|
||||||
BuildRequires: multipath-tools, libcmocka, libcmocka-devel
|
BuildRequires: multipath-tools, libcmocka, libcmocka-devel
|
||||||
BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89
|
BuildRequires: gcc, libaio-devel, userspace-rcu-devel, device-mapper-devel >= 1.02.89
|
||||||
@ -170,6 +170,12 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Sep 24 2021 lixiaokeng<lixiaokeng@huawei.com> - 0.8.5-7
|
||||||
|
- Type:codeclean
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC:use upstream patch instead huawei patch
|
||||||
|
|
||||||
* Thu Sep 23 2021 lixiaokeng<lixiaokeng@huawei.com> - 0.8.5-6
|
* Thu Sep 23 2021 lixiaokeng<lixiaokeng@huawei.com> - 0.8.5-6
|
||||||
- Type:testcode
|
- Type:testcode
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user