tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wip/glusterfs to pkgsrc filesystems/glusterfs



On Mon, Feb 27, 2023 at 11:17:31PM +0100, Jonathan Schleifer wrote:
> Am 27.02.23 um 22:18 schrieb Alexander Schreiber:
> 
> > Hi,
> > 
> > so I've updated pkgsrc wip/glusterfs to 10.3 and didn't get any complaints
> > after announcing that here and on pkgsrc-users (I hope at least someone
> > else tried it).
> > 
> > How to I get this from wip to actual pkgsrc?
> 
> The best is to send a patch against what's currently in pkgsrc proper. E.g.:
> 
>  $ diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs wip/glusterfs

Diff is attached.

Comments from this thread have been acted upon and resulting changes
submitted to the wip tree, with the exception of the format-string noise,
as that:
 - has been around since at least 8.3 (and presumably much longer)
 - is IMHO not really in scope 0for packaging

Two upstream bugs have been filed for the integrated patches:
 - https://github.com/gluster/glusterfs/issues/3940
   PR submitted & accepted, bug closed as fixed
 - https://github.com/gluster/glusterfs/issues/3942
   PR submitted & pending

Please take another look.

Kind regards,
           Alex.
-- 
"Opportunity is missed by most people because it is dressed in overalls and
 looks like work."                                      -- Thomas A. Edison
Binary files /usr/pkgsrc/filesystems/glusterfs/.Makefile.swp and wip/glusterfs/.Makefile.swp differ
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/DESCR wip/glusterfs/DESCR
--- /usr/pkgsrc/filesystems/glusterfs/DESCR	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/DESCR	2023-03-08 21:52:02.384841746 +0000
@@ -2,10 +2,10 @@
 that can scale to several petabytes.
 
 GlusterFS works over either TCP/IP or high-performance Infiniband
-RDMA interconnect.
+RDMA interconnect.  It requires a 64-bit CPU.
 
 GlusterFS provides striping and on-the-fly synchronous replication
 of files. GlusterFS has a fully distributed design, with no single
 point of failure.
 
-Please visit http://www.gluster.org/glusterfs.php for more info.
+Please visit http://www.gluster.org/ for more info.
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/Makefile wip/glusterfs/Makefile
--- /usr/pkgsrc/filesystems/glusterfs/Makefile	2022-12-26 16:58:31.000000000 +0000
+++ wip/glusterfs/Makefile	2023-03-06 21:51:31.269904577 +0000
@@ -1,28 +1,40 @@
-# $NetBSD: Makefile,v 1.110 2022/11/23 16:20:00 adam Exp $
+# $NetBSD: Makefile,v 1.109 2022/06/30 11:18:23 nia Exp $
 
-DISTNAME=	glusterfs-8.2
-PKGREVISION=	8
+DISTNAME=	glusterfs-10.3
 CATEGORIES=	filesystems
 MASTER_SITES=	http://bits.gluster.org/pub/gluster/glusterfs/src/
 
-MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+MAINTAINER=	als%thangorodrim.ch@localhost
 HOMEPAGE=	https://www.gluster.org/
 COMMENT=	Cluster filesystem
 LICENSE=	gnu-gpl-v3
 
-GNU_CONFIGURE=		yes
-USE_LIBTOOL=		yes
-USE_TOOLS+=		flex bison pkg-config bash
+DEPENDS+=	bash>=4:../../shells/bash
+GNU_CONFIGURE=	yes
+USE_LIBTOOL=	yes
+USE_TOOLS+=	flex bison pkg-config bash autoconf autoreconf automake
 
 CONFIGURE_ARGS+=	--disable-fusermount
 CONFIGURE_ARGS+=	--disable-fuse-notifications
 CONFIGURE_ARGS+=	--localstatedir=${VARBASE}
+CONFIGURE_ARGS+=	--without-tcmalloc
+# libtirpc not in pkgsrc (yet)
+CONFIGURE_ARGS+=	--without-libtirpc
+
+# Upstream glusterfs effectively dropped support for 32bit platforms
+# somewhere between 8.2 (works on e.g. NetBSD/i386) and 10.3 as various
+# internal bits went from 32 to 64 bits and atomic updates where done
+# on those - can't do that for 64bit values on a 32bit arch.
+# https://github.com/gluster/glusterfs/issues/702 proposed an explicit
+# drop of 32bit and eventually it just happened. See
+# https://github.com/gluster/glusterfs/issues/3911#issuecomment-1451711686
+# for a more detailed explanation.
+BROKEN_ON_PLATFORM=	${LP32PLATFORMS}
 
 # Make sure we do not attept to link with -lfl
 # Only libfl.a is available, and libtool wants libfl.so
 MAKE_FLAGS+=		LEXLIB=""
 
-REPLACE_PYTHON+=	contrib/ipaddr-py/ipaddr.py
 REPLACE_PYTHON+=	events/src/glustereventsd.py
 REPLACE_PYTHON+=	events/src/peer_eventsapi.py
 REPLACE_PYTHON+=	events/tools/eventsdash.py
@@ -32,35 +44,27 @@
 REPLACE_PYTHON+=	extras/snap_scheduler/snap_scheduler.py
 REPLACE_PYTHON+=	geo-replication/src/peer_georep-sshkey.py.in
 REPLACE_PYTHON+=	geo-replication/src/peer_mountbroker.in
-REPLACE_PYTHON+=	geo-replication/src/peer_mountbroker.py
 REPLACE_PYTHON+=	geo-replication/src/peer_mountbroker.py.in
-REPLACE_PYTHON+=	geo-replication/syncdaemon/changelogagent.py
 REPLACE_PYTHON+=	geo-replication/syncdaemon/gsyncd.py
 REPLACE_PYTHON+=	geo-replication/syncdaemon/gsyncdstatus.py
 REPLACE_PYTHON+=	tools/gfind_missing_files/gfid_to_path.py
 REPLACE_PYTHON+=	tools/glusterfind/S57glusterfind-delete-post.py
 REPLACE_PYTHON+=	tools/glusterfind/glusterfind.in
-REPLACE_PYTHON+=	tools/glusterfind/src/__init__.py
 REPLACE_PYTHON+=	tools/glusterfind/src/brickfind.py
 REPLACE_PYTHON+=	tools/glusterfind/src/changelog.py
-REPLACE_PYTHON+=	tools/glusterfind/src/changelogdata.py
-REPLACE_PYTHON+=	tools/glusterfind/src/conf.py
-REPLACE_PYTHON+=	tools/glusterfind/src/libgfchangelog.py
 REPLACE_PYTHON+=	tools/glusterfind/src/main.py
 REPLACE_PYTHON+=	tools/glusterfind/src/nodeagent.py
-REPLACE_PYTHON+=	tools/glusterfind/src/utils.py
 
 REPLACE_BASH+=		extras/ganesha/ocf/ganesha_grace
 REPLACE_BASH+=		extras/ganesha/ocf/ganesha_mon
 REPLACE_BASH+=		extras/ganesha/ocf/ganesha_nfsd
-REPLACE_BASH+=		extras/ganesha/scripts/copy-export-ganesha.sh
 REPLACE_BASH+=		extras/ganesha/scripts/create-export-ganesha.sh
 REPLACE_BASH+=		extras/ganesha/scripts/dbus-send.sh
 REPLACE_BASH+=		extras/ganesha/scripts/ganesha-ha.sh
 REPLACE_BASH+=		extras/geo-rep/generate-gfid-file.sh
 REPLACE_BASH+=		extras/geo-rep/get-gfid.sh
 REPLACE_BASH+=		extras/geo-rep/gsync-upgrade.sh
-REPLACE_BASH+=		extras/geo-rep/slave-upgrade.sh
+REPLACE_BASH+=		extras/geo-rep/secondary-upgrade.sh
 REPLACE_BASH+=		extras/peer_add_secret_pub.in
 REPLACE_BASH+=		extras/post-upgrade-script-for-quota.sh
 REPLACE_BASH+=		extras/pre-upgrade-script-for-quota.sh
@@ -76,17 +80,20 @@
 
 SUBST_CLASSES+=		mtab
 SUBST_STAGE.mtab=	post-build
-SUBST_FILES.mtab=	doc/mount.glusterfs.8
-SUBST_FILES.mtab=	libglusterfs/src/compat.h
-SUBST_FILES.mtab=	xlators/mount/fuse/utils/mount.glusterfs.in
-SUBST_SED.mtab=		-e "s,mtab,/proc/mounts,g"
+SUBST_FILES.mtab+=	xlators/mount/fuse/utils/mount.glusterfs.in
+SUBST_SED.mtab+=	-e "s,mtab,/proc/mounts,g"
 
 SUBST_CLASSES+=		etc
 SUBST_STAGE.etc=	pre-build
-SUBST_FILES.etc+=	libglusterfs/src/logging.c
+SUBST_FILES.etc=	libglusterfs/src/logging.c
 SUBST_FILES.etc+=	doc/glusterfsd.8
 SUBST_SED.etc=		-e "s,/etc/gluster,${PREFIX}/etc/gluster,g"
 
+SUBST_CLASSES+=		bash
+SUBST_STAGE.bash=	pre-configure
+SUBST_FILES.bash=	build-aux/pkg-version
+SUBST_SED.bash=		-e "s,/bin/bash,/usr/pkg/bin/bash,g"
+
 #EGDIR=			${PREFIX}/etc/glusterfs
 #CONF_FILES+=		${EGDIR}/glusterd.vol.sample ${EGDIR}/glusterd.vol
 OWN_DIRS+=		${VARBASE}/log/glusterfs
@@ -101,6 +108,10 @@
 PLIST_SUBST+=		GLUSTERFS_VERSION=${DISTNAME:S/glusterfs-//}
 MESSAGE_SRC=		${PKGDIR}/MESSAGE.${OPSYS}
 
+
+pre-configure:
+	cd ${WRKSRC} && ./autogen.sh
+
 pre-build:
 	cd ${WRKSRC}/extras && 					\
 	${ECHO} "glusterd.vol.sample: glusterd.vol" >> Makefile &&	\
@@ -111,7 +122,7 @@
 	    ${DESTDIR}/${PREFIX}/sbin/mount_glusterfs
 
 # Debug
-CFLAGS+=		-g 
+CFLAGS+=		-g
 INSTALL_UNSTRIPPED=	yes
 CONFIGURE_ARGS+=	--enable-debug
 #.include "../../devel/boehm-gc/buildlink3.mk"
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/PLIST wip/glusterfs/PLIST
--- /usr/pkgsrc/filesystems/glusterfs/PLIST	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/PLIST	2023-03-03 22:07:53.661193801 +0000
@@ -38,6 +38,7 @@
 include/glusterfs/cluster-syncop.h
 include/glusterfs/common-utils.h
 include/glusterfs/compat-errno.h
+include/glusterfs/compat-io_uring.h
 include/glusterfs/compat-uuid.h
 include/glusterfs/compat.h
 include/glusterfs/daemon.h
@@ -51,6 +52,9 @@
 include/glusterfs/gd-common-utils.h
 include/glusterfs/gf-dirent.h
 include/glusterfs/gf-event.h
+include/glusterfs/gf-io-common.h
+include/glusterfs/gf-io-legacy.h
+include/glusterfs/gf-io.h
 include/glusterfs/gfchangelog/changelog.h
 include/glusterfs/gidcache.h
 include/glusterfs/glfs-message-id.h
@@ -289,12 +293,12 @@
 libexec/glusterfs/python/syncdaemon/logutils.py
 libexec/glusterfs/python/syncdaemon/logutils.pyc
 libexec/glusterfs/python/syncdaemon/logutils.pyo
-libexec/glusterfs/python/syncdaemon/master.py
-libexec/glusterfs/python/syncdaemon/master.pyc
-libexec/glusterfs/python/syncdaemon/master.pyo
 libexec/glusterfs/python/syncdaemon/monitor.py
 libexec/glusterfs/python/syncdaemon/monitor.pyc
 libexec/glusterfs/python/syncdaemon/monitor.pyo
+libexec/glusterfs/python/syncdaemon/primary.py
+libexec/glusterfs/python/syncdaemon/primary.pyc
+libexec/glusterfs/python/syncdaemon/primary.pyo
 libexec/glusterfs/python/syncdaemon/py2py3.py
 libexec/glusterfs/python/syncdaemon/py2py3.pyc
 libexec/glusterfs/python/syncdaemon/py2py3.pyo
@@ -318,7 +322,7 @@
 libexec/glusterfs/scripts/gsync-sync-gfid
 libexec/glusterfs/scripts/gsync-upgrade.sh
 libexec/glusterfs/scripts/schedule_georep.py
-libexec/glusterfs/scripts/slave-upgrade.sh
+libexec/glusterfs/scripts/secondary-upgrade.sh
 libexec/glusterfs/set_geo_rep_pem_keys.sh
 man/man8/gluster-setgfid2path.8
 man/man8/gluster.8
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/distinfo wip/glusterfs/distinfo
--- /usr/pkgsrc/filesystems/glusterfs/distinfo	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/distinfo	2023-03-06 21:51:31.270855634 +0000
@@ -1,14 +1,8 @@
 $NetBSD: distinfo,v 1.73 2021/10/26 10:25:29 nia Exp $
 
-BLAKE2s (glusterfs-8.2.tar.gz) = 8e3161a768b5875b190f44cc3698de3ea9703c2550306c019dc6776c4ab12cd7
-SHA512 (glusterfs-8.2.tar.gz) = e11ffd544cdfd55e4309bcf10d9f6d3cb13b3c0beeaf578e024c9b40df19f5bc5dc6965bca1166e96e05e42041093c48772b160952c235f7456f0898594d01d2
-Size (glusterfs-8.2.tar.gz) = 7761620 bytes
-SHA1 (patch-config.h.in) = 1560806ebd786139b404544461dcda0ec1d60b37
-SHA1 (patch-configure) = 07d7a61d7c24ab8b0e4bb00ab6ae2452e41d903f
-SHA1 (patch-configure.ac) = fcb7da30005e9a08e7a0f4ac2f5e55511580aa18
-SHA1 (patch-rpc_rpc_lib_rpcsvc.c) = 287e5da091a2610ee010a44a5b51a90a402cff01
-SHA1 (patch-tools_gfind__missing__files_gfind__missing__files.sh) = 67d374d8dc3213bd3d159e7cb8479c14e8ba162d
-SHA1 (patch-xlators_mgmt_glusterd_src_glusterd-utils.c) = 3e8e6fa5e4baff94532f58a6509f7b5817ce02bf
-SHA1 (patch-xlators_mount_fuse_src_fuse-bridge.c) = 4706bc7264b7e4ec7f01cc143f3edce96213401e
-SHA1 (patch-xlators_performance_write-behind_src_write-behind.c) = cf3eea86ab4255a7714b25a35a98495eff0f772e
-SHA1 (patch-xlators_storage_posix_src_posix-entry-ops.c) = 2c1acf30097ca4ce7b6ec6e1212f989c86201553
+BLAKE2s (glusterfs-10.3.tar.gz) = c2f9b5670d1df7a787e445207caa421a949f1fb98cafb587441925efe8d9e25a
+SHA512 (glusterfs-10.3.tar.gz) = af7c8a15db48196a5f7022e4da87ae8d8d43a12c8968b242f40fb43ea562d1d214e75b3a67800f8594c97847e15c01367b6d464964252551d6f8d3e93fb0f832
+Size (glusterfs-10.3.tar.gz) = 8283537 bytes
+SHA1 (patch-configure.ac_no_bash) = eea22135006c11a25ad94eaf04ee1cbe8ac2ea9b
+SHA1 (patch-configure.ac_time_t) = 2bf7b3d6845216429d0064b4b5c47c9daf328c94
+SHA1 (patch-libglusterfs-src-glusterfs-dict.h) = ebfdfe6ffbdda3532d15fe108d4214b1e9596304
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-config.h.in wip/glusterfs/patches/patch-config.h.in
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-config.h.in	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-config.h.in	1970-01-01 00:00:00.000000000 +0000
@@ -1,19 +0,0 @@
-$NetBSD: patch-config.h.in,v 1.2 2020/09/27 01:13:11 manu Exp $
-
-Make FUSE notification optional at configure time
-From upstream https://review.gluster.org/24731
-
---- config.h.in.orig	2020-07-22 02:24:03.169608070 +0200
-+++ config.h.in	2020-07-22 02:24:28.887999809 +0200
-@@ -47,8 +47,11 @@
- 
- /* define if fdatasync exists */
- #undef HAVE_FDATASYNC
- 
-+/* Use FUSE notifications */
-+#undef HAVE_FUSE_NOTIFICATIONS
-+
- /* Define to 1 if you have the <inttypes.h> header file. */
- #undef HAVE_INTTYPES_H
- 
- /* have sys/ioctl.h */
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure wip/glusterfs/patches/patch-configure
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-configure	1970-01-01 00:00:00.000000000 +0000
@@ -1,67 +0,0 @@
-$NetBSD: patch-configure,v 1.5 2020/09/27 01:13:11 manu Exp $
-
-Make FUSE notification optional at configure time
-From upstream https://review.gluster.org/24731
-
-NetBSD build fixes
-From upstream https://review.gluster.org/24648
-
---- configure.orig	2020-07-06 03:22:43.222722780 +0200
-+++ configure	2020-07-22 02:28:26.017707376 +0200
-@@ -932,8 +932,9 @@
- with_tmpfilesdir
- with_ocf
- with_server
- enable_fuse_client
-+enable_fuse_notifications
- enable_fusermount
- enable_epoll
- enable_georeplication
- enable_events
-@@ -1619,8 +1620,10 @@
-                           Disable internal tracking of privileged ports.
-   --enable-valgrind       Enable valgrind for resource leak debugging.
-   --disable-fuse-client   Do not build the fuse client. NOTE: you cannot mount
-                           glusterfs without the client
-+  --disable-fuse-notifications
-+                          Disable FUSE notifications
-   --disable-fusermount    Use system's fusermount
-   --disable-epoll         Use poll instead of epoll.
-   --disable-georeplication
-                           Do not install georeplication components
-@@ -14172,8 +14175,23 @@
- if test "x$enable_fuse_client" != "xno"; then
-    FUSE_CLIENT_SUBDIR=fuse
-    BUILD_FUSE_CLIENT="yes"
- fi
-+  
-+  
-+                          
-+# Check whether --enable-fuse-notifications was given.
-+if test "${enable_fuse_notifications+set}" = set; then :
-+  enableval=$enable_fuse_notifications;
-+fi
-+  
-+                          
-+if test "x$enable_fuse_notifications" != "xno"; then :    
-+  
-+  
-+$as_echo "#define HAVE_FUSE_NOTIFICATIONS 1" >>confdefs.h
-+  
-+fi
- 
- 
- # end FUSE section
- 
-@@ -14973,8 +14991,11 @@
-     *freebsd*)
-     CFLAGS="${CFLAGS} -isystem /usr/local/include"
-     ARGP_LDADD=-largp
-     ;;
-+    *netbsd*)
-+    ARGP_LDADD=-largp
-+    ;;
- esac
- ac_fn_c_check_header_mongrel "$LINENO" "argp.h" "ac_cv_header_argp_h" "$ac_includes_default"
- if test "x$ac_cv_header_argp_h" = xyes; then :
- 
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure.ac wip/glusterfs/patches/patch-configure.ac
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure.ac	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-configure.ac	1970-01-01 00:00:00.000000000 +0000
@@ -1,36 +0,0 @@
-$NetBSD: patch-configure.ac,v 1.3 2020/09/27 01:13:11 manu Exp $
-
-Make FUSE notification optional at configure time
-From upstream https://review.gluster.org/24731
-
---- configure.ac.orig	2020-07-06 03:22:37.734704915 +0200
-+++ configure.ac	2020-07-22 02:26:32.903778538 +0200
-@@ -683,8 +683,16 @@
-    BUILD_FUSE_CLIENT="yes"
- fi
- 
- AC_SUBST(FUSE_CLIENT_SUBDIR)
-+
-+AC_ARG_ENABLE([fuse-notifications],
-+  AS_HELP_STRING([--disable-fuse-notifications], [Disable FUSE notifications]))
-+
-+AS_IF([test "x$enable_fuse_notifications" != "xno"], [
-+  AC_DEFINE([HAVE_FUSE_NOTIFICATIONS], [1], [Use FUSE notifications])
-+])
-+
- # end FUSE section
- 
- 
- AC_CHECK_LIB([ssl], TLS_method, [HAVE_OPENSSL_1_1="yes"], [HAVE_OPENSSL_1_1="no"])
-@@ -945,8 +953,11 @@
-     *freebsd*)
-     CFLAGS="${CFLAGS} -isystem /usr/local/include"
-     ARGP_LDADD=-largp
-     ;;
-+    *netbsd*)
-+    ARGP_LDADD=-largp
-+    ;;
- esac
- dnl argp-standalone does not provide a pkg-config file
- AC_CHECK_HEADER([argp.h], AC_DEFINE(HAVE_ARGP, 1, [have argp]))
- if test "x$ac_cv_header_argp_h" != "xyes"; then
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure.ac_no_bash wip/glusterfs/patches/patch-configure.ac_no_bash
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure.ac_no_bash	1970-01-01 00:00:00.000000000 +0000
+++ wip/glusterfs/patches/patch-configure.ac_no_bash	2023-03-06 21:51:31.271838748 +0000
@@ -0,0 +1,22 @@
+$NetBSD$
+
+Defang bash 4.0 syntax in configure.
+
+upstream bugs
+ - (bash) https://github.com/gluster/glusterfs/issues/3940
+
+--- configure.ac.orig   2022-09-20 12:24:29.568820624 +0200
++++ configure.ac        2023-03-06 22:45:21.897057433 +0100
+@@ -1896,10 +1896,10 @@
+ echo "Building with LTO    : $LTO_BUILD"
+ echo
+ 
+-# dnl Note: ${X^^} capitalization assumes bash >= 4.x
+ if test "x$SANITIZER" != "xnone"; then
++        UC_SANITIZER=$(echo ${SANITIZER} | tr 'a-z' 'A-Z')
+         echo "Note: since glusterfs processes are daemon processes, use"
+-        echo "'export ${SANITIZER^^}_OPTIONS=log_path=/path/to/xxx.log' to collect"
++        echo "'export ${UC_SANITIZER}_OPTIONS=log_path=/path/to/xxx.log' to collect"
+         echo "sanitizer output. Further details and more options can be"
+         echo "found at https://github.com/google/sanitizers.";
+ fi
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure.ac_time_t wip/glusterfs/patches/patch-configure.ac_time_t
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-configure.ac_time_t	1970-01-01 00:00:00.000000000 +0000
+++ wip/glusterfs/patches/patch-configure.ac_time_t	2023-03-02 20:23:30.274589921 +0000
@@ -0,0 +1,21 @@
+$NetBSD$
+
+Check for sizeof(time_t).
+
+upstream bugs
+ - (bash) https://github.com/gluster/glusterfs/issues/3940
+
+--- configure.ac.orig   2023-01-01 23:19:38.254216893 +0100
++++ configure.ac        2023-01-02 15:14:21.968041528 +0100
+@@ -544,6 +544,11 @@
+ AC_SUBST(SIZEOF_LONG)
+ AC_SUBST(SIZEOF_LONG_LONG)
+ 
++# size of time_t
++AC_CHECK_SIZEOF(time_t)
++SIZEOF_TIME_T=$ac_cv_sizeof_time_t
++AC_SUBST(SIZEOF_TIME_T)
++
+ # YACC needs a check
+ AC_PROG_YACC
+ if test "x${YACC}" = "xbyacc" -o "x${YACC}" = "xyacc" -o "x${YACC}" = "x"; then
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-libglusterfs-src-glusterfs-dict.h wip/glusterfs/patches/patch-libglusterfs-src-glusterfs-dict.h
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-libglusterfs-src-glusterfs-dict.h	1970-01-01 00:00:00.000000000 +0000
+++ wip/glusterfs/patches/patch-libglusterfs-src-glusterfs-dict.h	2023-03-01 11:21:38.735260789 +0000
@@ -0,0 +1,42 @@
+$NetBSD$
+
+Do not use __WORDSIZE as proxy for sizeof(time_t), since:
+ - __WORDSIZE is glibc (and thus Linux) only
+ - machine word size is a bad proxy for sizeof(time_t), e.g.
+   NetBSD on 32bit arch (i386) also has sizeof(time_t) == 8
+
+Instead use configure to check sizeof(time_t) and use this.
+
+upstream bug https://github.com/gluster/glusterfs/issues/3942
+
+--- libglusterfs/src/glusterfs/dict.h.orig      2023-01-01 23:19:50.909999764 +0100
++++ libglusterfs/src/glusterfs/dict.h   2023-01-01 23:09:15.920888776 +0100
+@@ -15,6 +15,7 @@
+ #include <sys/uio.h>
+ #include <pthread.h>
+ 
++#include "config.h"
+ #include "glusterfs/common-utils.h"
+ 
+ typedef struct _data data_t;
+@@ -320,17 +321,17 @@
+ dict_set_uint64(dict_t *this, char *key, uint64_t val);
+ 
+ /* POSIX-compliant systems requires the 'time_t' to be a signed integer. */
+-#if __WORDSIZE == 64
++#if SIZEOF_TIME_T == 8
+ #define dict_get_time(dict, key, val) dict_get_int64((dict), (key), (val))
+ #define dict_set_time(dict, key, val) dict_set_int64((dict), (key), (val))
+-#elif __WORDSIZE == 32
++#elif SIZEOF_TIME_T == 4
+ #define dict_get_time(dict, key, val)                   \
+     dict_get_int32((dict), (key), ((int32_t *)(val)))
+ #define dict_set_time(dict, key, val)                   \
+     dict_set_int32((dict), (key), ((int32_t)(val)))
+ #else
+ #error "unknown word size"
+-#endif /* WORDSIZE check */
++#endif /* SIZEOF_TIME_T check */
+ 
+ GF_MUST_CHECK int
+ dict_check_flag(dict_t *this, char *key, int flag);
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-rpc_rpc_lib_rpcsvc.c wip/glusterfs/patches/patch-rpc_rpc_lib_rpcsvc.c
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-rpc_rpc_lib_rpcsvc.c	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-rpc_rpc_lib_rpcsvc.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,23 +0,0 @@
-$NetBSD: patch-rpc_rpc_lib_rpcsvc.c,v 1.3 2020/09/27 01:13:11 manu Exp $
-
-NetBSD build fixes
-From upstream https://review.gluster.org/24648
-
-NetBSD build fixes
-From upstream https://review.gluster.org/24648
-
---- ./rpc/rpc-lib/src/rpcsvc.c.orig	2020-06-28 02:37:34.988840145 +0200
-+++ ./rpc/rpc-lib/src/rpcsvc.c	2020-06-28 02:38:41.302115459 +0200
-@@ -40,8 +40,12 @@
- 
- #include "xdr-rpcclnt.h"
- #include <glusterfs/glusterfs-acl.h>
- 
-+#ifndef PTHREAD_MUTEX_ADAPTIVE_NP
-+#define PTHREAD_MUTEX_ADAPTIVE_NP PTHREAD_MUTEX_DEFAULT
-+#endif
-+
- static struct rpcsvc_program gluster_dump_prog;
- 
- #define rpcsvc_alloc_request(svc, request)                                     \
-     do {                                                                       \
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-tools_gfind__missing__files_gfind__missing__files.sh wip/glusterfs/patches/patch-tools_gfind__missing__files_gfind__missing__files.sh
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-tools_gfind__missing__files_gfind__missing__files.sh	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-tools_gfind__missing__files_gfind__missing__files.sh	1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
-$NetBSD: patch-tools_gfind__missing__files_gfind__missing__files.sh,v 1.2 2020/07/27 16:06:08 manu Exp $
-
-NetBSD build fixes
-From upstream https://review.gluster.org/24648
-
---- tools/gfind_missing_files/gfind_missing_files.sh.orig	2018-04-12 17:46:46.697237625 +0000
-+++ tools/gfind_missing_files/gfind_missing_files.sh
-@@ -61,7 +61,7 @@ mount_slave()
- 
- parse_cli()
- {
--    if [[ $# -ne 4 ]]; then
-+    if [ "$#" -ne 4 ]; then
-         echo "Usage: gfind_missing_files <brick-path> <slave-host> <slave-vol> <OUTFILE>"
-         exit 1
-     else
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_mgmt_glusterd_src_glusterd-utils.c wip/glusterfs/patches/patch-xlators_mgmt_glusterd_src_glusterd-utils.c
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_mgmt_glusterd_src_glusterd-utils.c	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-xlators_mgmt_glusterd_src_glusterd-utils.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,19 +0,0 @@
-$NetBSD: patch-xlators_mgmt_glusterd_src_glusterd-utils.c,v 1.2 2020/09/27 01:13:11 manu Exp $
-
-fix NULL pointer reference
-From upstream https://review.gluster.org/24726
-
---- ./xlators/mgmt/glusterd/src/glusterd-utils.c.orig	2020-07-10 02:53:59.416898136 +0200
-+++ ./xlators/mgmt/glusterd/src/glusterd-utils.c	2020-07-10 02:54:16.956178597 +0200
-@@ -6394,9 +6394,10 @@
-             }
-         }
-     }
- out:
--    sys_closedir(dirp);
-+    if (dirp)
-+      sys_closedir(dirp);
-     return brick_path;
- }
- 
- int
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_mount_fuse_src_fuse-bridge.c wip/glusterfs/patches/patch-xlators_mount_fuse_src_fuse-bridge.c
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_mount_fuse_src_fuse-bridge.c	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-xlators_mount_fuse_src_fuse-bridge.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,62 +0,0 @@
-$NetBSD: patch-xlators_mount_fuse_src_fuse-bridge.c,v 1.2 2020/09/27 01:13:11 manu Exp $
-
-Make FUSE notification optional at configure time
-From upstream https://review.gluster.org/24731
-
---- xlators/mount/fuse/src/fuse-bridge.c.orig
-+++ xlators/mount/fuse/src/fuse-bridge.c
-@@ -8,6 +8,8 @@
-   cases as published by the Free Software Foundation.
- */
- 
-+#include <config.h>
-+
- #include <sys/wait.h>
- #include "fuse-bridge.h"
- #include <glusterfs/glusterfs.h>
-@@ -405,7 +407,7 @@ send_fuse_data(xlator_t *this, fuse_in_header_t *finh, void *data, size_t size)
- static int32_t
- fuse_invalidate_entry(xlator_t *this, uint64_t fuse_ino)
- {
--#if FUSE_KERNEL_MINOR_VERSION >= 11
-+#if (FUSE_KERNEL_MINOR_VERSION >= 11 && defined(HAVE_FUSE_NOTIFICATIONS))
-     struct fuse_out_header *fouh = NULL;
-     struct fuse_notify_inval_entry_out *fnieo = NULL;
-     fuse_private_t *priv = NULL;
-@@ -496,7 +498,7 @@ fuse_invalidate_entry(xlator_t *this, uint64_t fuse_ino)
- static int32_t
- fuse_invalidate_inode(xlator_t *this, uint64_t fuse_ino)
- {
--#if FUSE_KERNEL_MINOR_VERSION >= 11
-+#if (FUSE_KERNEL_MINOR_VERSION >= 11 && defined(HAVE_FUSE_NOTIFICATIONS))
-     struct fuse_out_header *fouh = NULL;
-     struct fuse_notify_inval_inode_out *fniio = NULL;
-     fuse_private_t *priv = NULL;
-@@ -4918,7 +4920,7 @@ fuse_setlk(xlator_t *this, fuse_in_header_t *finh, void *msg,
-     return;
- }
- 
--#if FUSE_KERNEL_MINOR_VERSION >= 11
-+#if FUSE_KERNEL_MINOR_VERSION >= 11 && defined(HAVE_FUSE_NOTIFICATIONS)
- static void *
- notify_kernel_loop(void *data)
- {
-@@ -5165,6 +5167,7 @@ fuse_init(xlator_t *this, fuse_in_header_t *finh, void *msg,
-     priv->timed_response_fuse_thread_started = _gf_true;
- 
-     /* Used for 'reverse invalidation of inode' */
-+#ifdef HAVE_FUSE_NOTIFICATIONS
-     if (fini->minor >= 12) {
-         ret = gf_thread_create(&messenger, NULL, notify_kernel_loop, this,
-                                "fusenoti");
-@@ -5176,7 +5179,9 @@ fuse_init(xlator_t *this, fuse_in_header_t *finh, void *msg,
-             goto out;
-         }
-         priv->reverse_fuse_thread_started = _gf_true;
--    } else {
-+    } else
-+#endif
-+    {
-         /*
-          * FUSE minor < 12 does not implement invalidate notifications.
-          * This mechanism is required for fopen-keep-cache to operate
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_performance_write-behind_src_write-behind.c wip/glusterfs/patches/patch-xlators_performance_write-behind_src_write-behind.c
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_performance_write-behind_src_write-behind.c	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-xlators_performance_write-behind_src_write-behind.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,29 +0,0 @@
-$NetBSD: patch-xlators_performance_write-behind_src_write-behind.c,v 1.3 2020/09/27 01:13:11 manu Exp $
-
-NetBSD build fixes
-from upstream https://review.gluster.org/24648
-
---- xlators/performance/write-behind/src/write-behind.c.orig	2020-07-06 03:22:38.006705801 +0200
-+++ xlators/performance/write-behind/src/write-behind.c	2020-07-27 17:55:06.263570589 +0200
-@@ -2488,9 +2488,9 @@
-     wb_inode_t *wb_directory_inode = NULL;
- 
-     wb_directory_inode = wb_inode_create(this, directory);
- 
--    if (!wb_directory_inode || !wb_directory_inode->lock.spinlock)
-+    if (!wb_directory_inode)
-         return;
- 
-     LOCK(&wb_directory_inode->lock);
-     {
-@@ -2508,9 +2508,9 @@
-     int readdirps = 0;
- 
-     wb_directory_inode = wb_inode_ctx_get(this, directory);
- 
--    if (!wb_directory_inode || !wb_directory_inode->lock.spinlock)
-+    if (!wb_directory_inode)
-         return;
- 
-     LOCK(&wb_directory_inode->lock);
-     {
diff -Nru --exclude=CVS /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_storage_posix_src_posix-entry-ops.c wip/glusterfs/patches/patch-xlators_storage_posix_src_posix-entry-ops.c
--- /usr/pkgsrc/filesystems/glusterfs/patches/patch-xlators_storage_posix_src_posix-entry-ops.c	2022-11-18 21:55:40.000000000 +0000
+++ wip/glusterfs/patches/patch-xlators_storage_posix_src_posix-entry-ops.c	1970-01-01 00:00:00.000000000 +0000
@@ -1,75 +0,0 @@
-$NetBSD: patch-xlators_storage_posix_src_posix-entry-ops.c,v 1.2 2020/09/27 01:13:12 manu Exp $
-
-Properly screen the .attribute directory where NetBSD UFS1 stores 
-extended attributes.
-From upstream https://review.gluster.org/24702
-
---- xlators/storage/posix/src/posix-entry-ops.c.orig	2020-07-08 09:00:29.350013944 +0200
-+++ xlators/storage/posix/src/posix-entry-ops.c	2020-07-08 09:04:15.087789405 +0200
-@@ -197,8 +197,22 @@
-         op_ret = -1;
-         goto out;
-     }
- 
-+#ifdef __NetBSD__
-+    /* Same for NetBSD's .attribute directory */
-+    if (__is_root_gfid(loc->pargfid) && loc->name &&
-+        (strcmp(loc->name, ".attribute") == 0)) {
-+        gf_msg(this->name, GF_LOG_WARNING, EPERM, P_MSG_LOOKUP_NOT_PERMITTED,
-+               "Lookup issued on .attribute,"
-+               " which is not permitted");
-+        op_errno = EPERM;
-+        op_ret = -1;
-+        goto out;
-+    }
-+#endif /* __NetBSD__ */  
-+
-+
-     op_ret = dict_get_int32_sizen(xdata, GF_GFIDLESS_LOOKUP, &gfidless);
-     op_ret = -1;
-     if (gf_uuid_is_null(loc->pargfid) || (loc->name == NULL)) {
-         /* nameless lookup */
-@@ -649,8 +663,21 @@
-         op_ret = -1;
-         goto out;
-     }
- 
-+#ifdef __NetBSD__
-+    /* Same for NetBSD's .attribute directory */
-+    if (__is_root_gfid(loc->pargfid) &&
-+        (strcmp(loc->name, ".attribute") == 0)) {
-+        gf_msg(this->name, GF_LOG_WARNING, EPERM, P_MSG_MKDIR_NOT_PERMITTED,
-+               "mkdir issued on .attribute, which"
-+               "is not permitted");
-+        op_errno = EPERM;
-+        op_ret = -1;
-+        goto out;
-+    }
-+#endif
-+
-     priv = this->private;
-     VALIDATE_OR_GOTO(priv, out);
-     GFID_NULL_CHECK_AND_GOTO(frame, this, loc, xdata, op_ret, op_errno,
-                              uuid_req, out);
-@@ -1415,8 +1442,21 @@
-         op_ret = -1;
-         goto out;
-     }
- 
-+#ifdef __NetBSD__
-+    /* Same for NetBSD's .attribute directory */
-+    if (__is_root_gfid(loc->pargfid) &&
-+        (strcmp(loc->name, ".attribute") == 0)) {
-+        gf_msg(this->name, GF_LOG_WARNING, EPERM, P_MSG_RMDIR_NOT_PERMITTED,
-+               "rmdir issued on .attribute, which"
-+               "is not permitted");
-+        op_errno = EPERM;
-+        op_ret = -1;
-+        goto out;
-+    }
-+#endif
-+
-     priv = this->private;
- 
-     MAKE_ENTRY_HANDLE(real_path, par_path, this, loc, &stbuf);
-     if (!real_path || !par_path) {


Home | Main Index | Thread Index | Old Index