From e30d22aab0538ecb57332421523169bf8865c97a Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sun, 20 Apr 2025 14:24:14 +0000 Subject: [PATCH] - merged fixes from PLD --- glusterfs-atomic32.patch | 45 ++++++++++++++++++++++++++++++++++++++++ glusterfs-glibc.patch | 11 ++++++++++ glusterfs.spec | 10 ++++++--- 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 glusterfs-atomic32.patch create mode 100644 glusterfs-glibc.patch diff --git a/glusterfs-atomic32.patch b/glusterfs-atomic32.patch new file mode 100644 index 0000000..5a34e23 --- /dev/null +++ b/glusterfs-atomic32.patch @@ -0,0 +1,45 @@ +diff -ur glusterfs-10.5.orig/libglusterfs/src/gf-io-legacy.c glusterfs-10.5/libglusterfs/src/gf-io-legacy.c +--- glusterfs-10.5.orig/libglusterfs/src/gf-io-legacy.c 2023-11-14 15:03:34.000000000 +0000 ++++ glusterfs-10.5/libglusterfs/src/gf-io-legacy.c 2025-04-20 13:16:07.787544191 +0000 +@@ -45,7 +45,11 @@ + { + uint64_t seq; + ++#ifdef __LP64__ + seq = uatomic_add_return(&gf_io_legacy_seq, 1) - 1; ++#else ++ seq = __atomic_fetch_add(&gf_io_legacy_seq, 1, __ATOMIC_SEQ_CST); ++#endif + + gf_io_cbk(NULL, seq, id, res); + } +diff -ur glusterfs-10.5.orig/libglusterfs/src/gf-io-uring.c glusterfs-10.5/libglusterfs/src/gf-io-uring.c +--- glusterfs-10.5.orig/libglusterfs/src/gf-io-uring.c 2023-11-14 15:03:34.000000000 +0000 ++++ glusterfs-10.5/libglusterfs/src/gf-io-uring.c 2025-04-20 13:17:10.011727047 +0000 +@@ -668,7 +668,11 @@ + idx = tail & gf_io_uring.sq.mask; + nr = gf_io_uring_sq_length(idx); + if (nr != 0) { ++#ifdef __LP64__ + nr = (uint32_t)uatomic_xchg(&gf_io_uring.sq.sqes[idx].__pad2[2], 0); ++#else ++ nr = (uint32_t)__atomic_exchange_n(&gf_io_uring.sq.sqes[idx].__pad2[2], 0, __ATOMIC_SEQ_CST); ++#endif + } + + return nr; +diff -ur glusterfs-10.5.orig/libglusterfs/src/glusterfs/gf-io.h glusterfs-10.5/libglusterfs/src/glusterfs/gf-io.h +--- glusterfs-10.5.orig/libglusterfs/src/glusterfs/gf-io.h 2023-11-14 15:03:34.000000000 +0000 ++++ glusterfs-10.5/libglusterfs/src/glusterfs/gf-io.h 2025-04-20 13:16:07.787544191 +0000 +@@ -358,7 +358,11 @@ + static inline uint64_t + gf_io_reserve(uint32_t nr) + { ++#ifdef __LP64__ + return uatomic_add_return(&gf_io.op_seq, nr) - nr; ++#else ++ return __atomic_fetch_add(&gf_io.op_seq, nr, __ATOMIC_SEQ_CST); ++#endif + } + + /* Wait for a particular entry in gf_io.data_map to be available. */ diff --git a/glusterfs-glibc.patch b/glusterfs-glibc.patch new file mode 100644 index 0000000..3d120d7 --- /dev/null +++ b/glusterfs-glibc.patch @@ -0,0 +1,11 @@ +--- glusterfs-10.3/libglusterfs/src/glusterfs/compat-io_uring.h.orig 2022-09-20 12:24:29.627820825 +0200 ++++ glusterfs-10.3/libglusterfs/src/glusterfs/compat-io_uring.h 2023-03-17 21:47:37.793704259 +0100 +@@ -11,6 +11,8 @@ + #ifndef __COMPAT_IO_URING_H__ + #define __COMPAT_IO_URING_H__ + ++#include ++#define _LINUX_MOUNT_H + #include + + /* io_uring setup flags. */ diff --git a/glusterfs.spec b/glusterfs.spec index d3dd361..efecb9f 100644 --- a/glusterfs.spec +++ b/glusterfs.spec @@ -14,7 +14,7 @@ Summary: Clustered File Storage that can scale to peta bytes Summary(pl.UTF-8): Klastrowy system przechowywania plików skalujący się do petabajtów Name: glusterfs Version: 10.5 -Release: 1 +Release: 2 License: LGPL v3+ or GPL v2 (libraries), GPL v3+ (programs) Group: Applications/System Source0: https://download.gluster.org/pub/gluster/glusterfs/10/%{version}/glusterfs-%{version}.tar.gz @@ -22,6 +22,8 @@ Source0: https://download.gluster.org/pub/gluster/glusterfs/10/%{version}/gluste Source1: glusterfsd.init Patch0: ssl_paths.patch Patch1: ksh_getopts.patch +Patch2: %{name}-glibc.patch +Patch3: %{name}-atomic32.patch URL: https://www.gluster.org/ BuildRequires: acl-devel BuildRequires: autoconf >= 2.50 @@ -267,8 +269,10 @@ Plik składni Vima do edycji konfiguracji GlusterFS-a. %prep %setup -q -%patch0 -p1 -%patch1 -p1 +%patch -P0 -p1 +%patch -P1 -p1 +%patch -P2 -p1 +%patch -P3 -p1 %build %{__libtoolize} -- 2.49.0