summaryrefslogtreecommitdiff
path: root/filesystems/glusterfs
diff options
context:
space:
mode:
authormanu <manu>2014-11-18 14:38:15 +0000
committermanu <manu>2014-11-18 14:38:15 +0000
commit1358e9285f506d17db48c9281cd4bf7d7cb07fec (patch)
tree2f805b55fc354d9cc9622a8b49b08f235a0d1d82 /filesystems/glusterfs
parentaf8827518b6cbf064d3ed4e88d58418fa758b093 (diff)
downloadpkgsrc-1358e9285f506d17db48c9281cd4bf7d7cb07fec.tar.gz
Upgrate to glusterfs 3.6.0
New features: - Volume Snapshots Distributed lvm thin-pool based snapshots for backing up volumes in a Gluster Trusted Storage Pool. Apart from providing cluster wide co-ordination to trigger a consistent snapshot, several improvements have been performed through the GlusterFS stack to make translators more crash consistent. Snapshotting of volumes is tightly coupled with lvm today but one could also enhance the same framework to integrate with a backend storage technology like btrfs that can perform snapshots. - Erasure Coding Xavier Hernandez from Datalab added support to perform erasure coding of data in a GlusterFS volume across nodes in a Trusted Storage Pool. Erasure Coding requires fewer nodes to provide better redundancy than a n-way replicated volume and can help in reducing the overall deployment cost. We look forward to build on this foundation and deliver more enhancememnts in upcoming releases. - Better SSL support Multiple improvements to SSL support in GlusterFS. The GlusterFS driver in OpenStack Manila that provides certificate based access to tenants relies on these improvements. - Meta translator This translator provides a /proc like view for examining internal state of translators on the client stack of a GlusterFS volume and certainly looks like an interface that I would be heavily consuming for introspection of GlusterFS. - Automatic File Replication (AFR) v2 A significant re-factor of the synchronous replication translator, provides granular entry self-healing and reduced resource consumption with entry self-heals. - NetBSD, OSX and FreeBSD ports Lot of fixes on the portability front. The NetBSD port passes most regression tests as of 3.6.0. At this point, none of these ports are ready to be deployed in production. However, with dedicated maintainers for each of these ports, we expect to reach production readiness on these platforms in a future release. Complete releases notes are available at https://github.com/gluster/glusterfs/blob/release-3.6/doc/release-notes/3.6.0.md
Diffstat (limited to 'filesystems/glusterfs')
-rw-r--r--filesystems/glusterfs/MESSAGE.NetBSD21
-rw-r--r--filesystems/glusterfs/Makefile60
-rw-r--r--filesystems/glusterfs/PLIST196
-rw-r--r--filesystems/glusterfs/PLIST.georeplication35
-rw-r--r--filesystems/glusterfs/distinfo21
-rwxr-xr-xfilesystems/glusterfs/files/glusterd.sh37
-rwxr-xr-xfilesystems/glusterfs/files/glusterfsd.sh19
-rwxr-xr-xfilesystems/glusterfs/files/xattr-init.sh67
-rw-r--r--filesystems/glusterfs/options.mk13
-rw-r--r--filesystems/glusterfs/patches/patch-900655
-rw-r--r--filesystems/glusterfs/patches/patch-901072
-rw-r--r--filesystems/glusterfs/patches/patch-904543
-rw-r--r--filesystems/glusterfs/patches/patch-9080264
-rw-r--r--filesystems/glusterfs/patches/patch-9084350
-rw-r--r--filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.c19
-rw-r--r--filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.h48
-rw-r--r--filesystems/glusterfs/patches/patch-configure61
-rw-r--r--filesystems/glusterfs/patches/patch-rpc_rpc-lib_src_rpcsvc.c17
-rw-r--r--filesystems/glusterfs/patches/patch-xlator_cluster_dht_src_dht-common.c17
-rw-r--r--filesystems/glusterfs/patches/patch-xlator_features_glupy_src_Makefile.in28
-rw-r--r--filesystems/glusterfs/patches/patch-xlator_storage_posix_src_posix.c17
21 files changed, 1141 insertions, 319 deletions
diff --git a/filesystems/glusterfs/MESSAGE.NetBSD b/filesystems/glusterfs/MESSAGE.NetBSD
index 37f41c74a70..ebbfbbb88bb 100644
--- a/filesystems/glusterfs/MESSAGE.NetBSD
+++ b/filesystems/glusterfs/MESSAGE.NetBSD
@@ -1,5 +1,5 @@
===========================================================================
-$NetBSD: MESSAGE.NetBSD,v 1.14 2013/04/08 11:17:13 rodent Exp $
+$NetBSD: MESSAGE.NetBSD,v 1.15 2014/11/18 14:38:15 manu Exp $
*** GlusterFS clients ***
This is required in /etc/sysctl.conf in order to avoid hangs on I/O operations
@@ -8,7 +8,7 @@ This is required in /etc/sysctl.conf in order to avoid hangs on I/O operations
net.inet.tcp.recvbuf_max=1048576
In order to use mount -t glusterfs, please install this link
- ln -s ${PREFIX}/sbin/mount.glusterfs /sbin/mount_glusterfs
+ ln -s ${PREFIX}/sbin/mount_glusterfs /sbin/mount_glusterfs
* Only for netbsd-5 branch (later NetBSD GENERIC kernels have it enabled):
A kernel with the following option is required:
@@ -18,17 +18,14 @@ A kernel with the following option is required:
*** GlusterFS servers ***
glusterfs servers will need extended attributes in exported filesystems.
-This require a kernel with the following options:
- options UFS_EXTATTR
-
-You will need to create the directories below on exported filesystems' roots,
-and then mount with -o extattr
+This is currently only supported in UFS1 (newfs -O1). You will need to
+create the directories below on exported filesystems' roots, and then
+mount with -o extattr
.attribute/system
.attribute/user
-
-* Only for netbsd-5 branch (later NetBSD version do not need that)
-mount -o extattr shall not be used, but the kernel needs options below:
- options UFS_EXTATTR_AUTOSTART
- options UFS_EXTATTR_AUTOCREATE=1024
+
+* For netbsd-6 branch and earlier (later NetBSD GENERIC kernels have it),
+the kernel must have the following option enabled:
+ options UFS_EXTATTR
===========================================================================
diff --git a/filesystems/glusterfs/Makefile b/filesystems/glusterfs/Makefile
index 8e26bbaffed..c9429b76c13 100644
--- a/filesystems/glusterfs/Makefile
+++ b/filesystems/glusterfs/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.43 2014/08/13 22:37:37 joerg Exp $
+# $NetBSD: Makefile,v 1.44 2014/11/18 14:38:15 manu Exp $
-DISTNAME= glusterfs-3.5.0
-PKGREVISION= 4
+DISTNAME= glusterfs-3.6.0
+#PKGREVISION= 1
CATEGORIES= filesystems
MASTER_SITES= http://bits.gluster.org/pub/gluster/glusterfs/src/
@@ -16,19 +16,31 @@ USE_TOOLS+= flex bison
CONFIGURE_ARGS+= --disable-fusermount
CONFIGURE_ARGS+= --localstatedir=${VARBASE}
-CONFIGURE_ARGS+= CFLAGS=${CFLAGS:M*:Q}\ -DDEBUG
# Make sure we do not attept to link with -lfl
# Only libfl.a is available, and libtool wants libfl.so
MAKE_FLAGS+= LEXLIB=""
MAKE_FLAGS+= libglusterfs_la_LIBADD=""
-MAKE_ENV+= AM_MAKEFLAGS=${MAKE_FLAGS:Q}
-REPLACE_PYTHON= api/examples/gfapi.py
+#REPLACE_PYTHON+= contrib/ipaddr-py/ipaddr.py
+#REPLACE_PYTHON+= gen-headers.py
+#REPLACE_PYTHON+= tests/bugs/overlap.py
+#REPLACE_PYTHON+= tests/utils/create-files.py
+REPLACE_PYTHON+= geo-replication/syncdaemon/changelogagent.py
+REPLACE_PYTHON+= geo-replication/syncdaemon/gsyncd.py
REPLACE_PYTHON+= contrib/ipaddr-py/ipaddr.py
-REPLACE_PYTHON+= gen-headers.py
-REPLACE_PYTHON+= tests/bugs/overlap.py
-REPLACE_PYTHON+= tests/utils/create-files.py
+
+REPLACE_BASH+= extras/geo-rep/generate-gfid-file.sh
+REPLACE_BASH+= extras/geo-rep/get-gfid.sh
+REPLACE_BASH+= extras/post-upgrade-script-for-quota.sh
+REPLACE_BASH+= extras/pre-upgrade-script-for-quota.sh
+REPLACE_BASH+= extras/geo-rep/slave-upgrade.sh
+REPLACE_BASH+= extras/geo-rep/gsync-upgrade.sh
+REPLACE_BASH+= geo-replication/src/gverify.sh
+REPLACE_BASH+= geo-replication/src/peer_add_secret_pub.in
+REPLACE_BASH+= geo-replication/src/peer_gsec_create.in
+REPLACE_BASH+= geo-replication/src/set_geo_rep_pem_keys.sh
+
SUBST_CLASSES+= mtab
SUBST_STAGE.mtab= post-build
@@ -47,14 +59,14 @@ SUBST_SED.etc= -e "s,/etc/gluster,${PREFIX}/etc/gluster,g"
SUBST_CLASSES+= vol
SUBST_STAGE.vol= post-build
SUBST_FILES.vol= extras/Makefile
-SUBST_SED.vol= -e "s/glusterd.vol/glusterd.vol.sample/g"
+SUBST_SED.vol= -e "/^vol_DATA/s/glusterd.vol/glusterd.vol.sample/g"
EGDIR= ${PREFIX}/etc/glusterfs
CONF_FILES+= ${EGDIR}/glusterd.vol.sample ${EGDIR}/glusterd.vol
OWN_DIRS+= ${VARBASE}/log/glusterfs
BUILD_DEFS+= VARBASE
-RCD_SCRIPTS= glusterfsd
+RCD_SCRIPTS= glusterd
PLIST_SRC= ${PLIST_SRC_DFLT}
PLIST_SUBST+= VARBASE=${VARBASE}
@@ -62,29 +74,27 @@ PLIST_SUBST+= PKG_SYSCONFDIR=${PKG_SYSCONFDIR}
PLIST_SUBST+= PYSITELIB=${PYSITELIB:Q}
MESSAGE_SRC= ${PKGDIR}/MESSAGE.${OPSYS}
-
pre-build:
- cd ${WRKSRC} && ./gen-headers.py
-
-post-build:
- cp ${WRKSRC}/extras/glusterd.vol ${WRKSRC}/extras/glusterd.vol.sample
+ cd ${WRKSRC}/extras && \
+ echo "glusterd.vol.sample: glusterd.vol" >> Makefile && \
+ echo " cp glusterd.vol glusterd.vol.sample" >> Makefile
post-install:
- ${INSTALL_SCRIPT} ${DESTDIR}/sbin/mount.glusterfs \
- ${DESTDIR}/${PREFIX}/sbin/mount.glusterfs
+ ${INSTALL_SCRIPT} ${DESTDIR}/sbin/mount_glusterfs \
+ ${DESTDIR}/${PREFIX}/sbin/mount_glusterfs
# Debug
CFLAGS+= -g
INSTALL_UNSTRIPPED= yes
-.include "../../devel/boehm-gc/buildlink3.mk"
-CFLAGS+=-DGC_DEBUG
-CFLAGS+=-include gc.h
-LIBS+=-lgc
-
-.include "options.mk"
+CONFIGURE_ARGS+= --enable-debug
+#.include "../../devel/boehm-gc/buildlink3.mk"
+#CFLAGS+=-DGC_DEBUG
+#CFLAGS+=-include gc.h
+#LIBS+=-lgc
.include "../../mk/bsd.prefs.mk"
-.include "../../devel/argp/buildlink3.mk"
+#.include "../../devel/argp/buildlink3.mk"
+.include "../../textproc/libxml2/buildlink3.mk"
.include "../../lang/python/application.mk"
.include "../../lang/python/extension.mk"
diff --git a/filesystems/glusterfs/PLIST b/filesystems/glusterfs/PLIST
index 6492432cf30..9e8e00e4dbd 100644
--- a/filesystems/glusterfs/PLIST
+++ b/filesystems/glusterfs/PLIST
@@ -1,75 +1,86 @@
-@comment $NetBSD: PLIST,v 1.19 2014/08/13 22:37:37 joerg Exp $
+@comment $NetBSD: PLIST,v 1.20 2014/11/18 14:38:15 manu Exp $
+${PYSITELIB}/gluster/__init__.py
+${PYSITELIB}/gluster/__init__.pyc
+${PYSITELIB}/gluster/__init__.pyo
+${PYSITELIB}/gluster/glupy.py
+${PYSITELIB}/gluster/glupy.pyc
+${PYSITELIB}/gluster/glupy.pyo
etc/glusterfs/gluster-rsyslog-5.8.conf
etc/glusterfs/gluster-rsyslog-7.2.conf
etc/glusterfs/glusterd.vol.sample
etc/glusterfs/glusterfs-georep-logrotate
etc/glusterfs/glusterfs-logrotate
+etc/glusterfs/group-virt.example
etc/glusterfs/logger.conf.example
include/glusterfs/api/glfs-handles.h
include/glusterfs/api/glfs.h
include/glusterfs/gfchangelog/changelog.h
-lib/glusterfs/3.5.0/auth/addr.la
-lib/glusterfs/3.5.0/auth/login.la
-lib/glusterfs/3.5.0/rpc-transport/socket.la
-lib/glusterfs/3.5.0/xlator/cluster/afr.la
-lib/glusterfs/3.5.0/xlator/cluster/dht.la
-lib/glusterfs/3.5.0/xlator/cluster/distribute.so
-lib/glusterfs/3.5.0/xlator/cluster/nufa.la
-lib/glusterfs/3.5.0/xlator/cluster/pump.la
-lib/glusterfs/3.5.0/xlator/cluster/replicate.so
-lib/glusterfs/3.5.0/xlator/cluster/stripe.la
-lib/glusterfs/3.5.0/xlator/cluster/switch.la
-lib/glusterfs/3.5.0/xlator/debug/error-gen.la
-lib/glusterfs/3.5.0/xlator/debug/io-stats.la
-lib/glusterfs/3.5.0/xlator/debug/trace.la
-lib/glusterfs/3.5.0/xlator/encryption/crypt.la
-lib/glusterfs/3.5.0/xlator/encryption/rot-13.la
-lib/glusterfs/3.5.0/xlator/features/access-control.so
-lib/glusterfs/3.5.0/xlator/features/cdc.la
-lib/glusterfs/3.5.0/xlator/features/changelog.la
-lib/glusterfs/3.5.0/xlator/features/gfid-access.la
-lib/glusterfs/3.5.0/xlator/features/glupy.la
-lib/glusterfs/3.5.0/xlator/features/glupy/debug-trace.py
-lib/glusterfs/3.5.0/xlator/features/glupy/debug-trace.pyc
-lib/glusterfs/3.5.0/xlator/features/glupy/debug-trace.pyo
-lib/glusterfs/3.5.0/xlator/features/glupy/helloworld.py
-lib/glusterfs/3.5.0/xlator/features/glupy/helloworld.pyc
-lib/glusterfs/3.5.0/xlator/features/glupy/helloworld.pyo
-lib/glusterfs/3.5.0/xlator/features/glupy/negative.py
-lib/glusterfs/3.5.0/xlator/features/glupy/negative.pyc
-lib/glusterfs/3.5.0/xlator/features/glupy/negative.pyo
-lib/glusterfs/3.5.0/xlator/features/index.la
-lib/glusterfs/3.5.0/xlator/features/locks.la
-lib/glusterfs/3.5.0/xlator/features/mac-compat.la
-lib/glusterfs/3.5.0/xlator/features/marker.la
-lib/glusterfs/3.5.0/xlator/features/posix-locks.so
-lib/glusterfs/3.5.0/xlator/features/prot_client.la
-lib/glusterfs/3.5.0/xlator/features/prot_dht.la
-lib/glusterfs/3.5.0/xlator/features/prot_server.la
-lib/glusterfs/3.5.0/xlator/features/quiesce.la
-lib/glusterfs/3.5.0/xlator/features/quota.la
-lib/glusterfs/3.5.0/xlator/features/quotad.la
-lib/glusterfs/3.5.0/xlator/features/read-only.la
-lib/glusterfs/3.5.0/xlator/features/worm.la
-lib/glusterfs/3.5.0/xlator/mgmt/glusterd.la
-lib/glusterfs/3.5.0/xlator/mount/api.la
-lib/glusterfs/3.5.0/xlator/mount/fuse.la
-lib/glusterfs/3.5.0/xlator/nfs/server.la
-lib/glusterfs/3.5.0/xlator/performance/io-cache.la
-lib/glusterfs/3.5.0/xlator/performance/io-threads.la
-lib/glusterfs/3.5.0/xlator/performance/md-cache.la
-lib/glusterfs/3.5.0/xlator/performance/open-behind.la
-lib/glusterfs/3.5.0/xlator/performance/quick-read.la
-lib/glusterfs/3.5.0/xlator/performance/read-ahead.la
-lib/glusterfs/3.5.0/xlator/performance/readdir-ahead.la
-lib/glusterfs/3.5.0/xlator/performance/stat-prefetch.so
-lib/glusterfs/3.5.0/xlator/performance/write-behind.la
-lib/glusterfs/3.5.0/xlator/protocol/client.la
-lib/glusterfs/3.5.0/xlator/protocol/server.la
-lib/glusterfs/3.5.0/xlator/storage/posix.la
-lib/glusterfs/3.5.0/xlator/system/posix-acl.la
-lib/glusterfs/3.5.0/xlator/testing/features/template.la
-lib/glusterfs/3.5.0/xlator/testing/performance/symlink-cache.la
+lib/glusterfs/3.6.0/auth/addr.la
+lib/glusterfs/3.6.0/auth/login.la
+lib/glusterfs/3.6.0/rpc-transport/socket.la
+lib/glusterfs/3.6.0/xlator/cluster/afr.la
+lib/glusterfs/3.6.0/xlator/cluster/dht.la
+lib/glusterfs/3.6.0/xlator/cluster/distribute.so
+lib/glusterfs/3.6.0/xlator/cluster/nufa.la
+lib/glusterfs/3.6.0/xlator/cluster/pump.la
+lib/glusterfs/3.6.0/xlator/cluster/replicate.so
+lib/glusterfs/3.6.0/xlator/cluster/stripe.la
+lib/glusterfs/3.6.0/xlator/cluster/switch.la
+lib/glusterfs/3.6.0/xlator/debug/error-gen.la
+lib/glusterfs/3.6.0/xlator/debug/io-stats.la
+lib/glusterfs/3.6.0/xlator/debug/trace.la
+lib/glusterfs/3.6.0/xlator/encryption/crypt.la
+lib/glusterfs/3.6.0/xlator/encryption/rot-13.la
+lib/glusterfs/3.6.0/xlator/features/access-control.so
+lib/glusterfs/3.6.0/xlator/features/barrier.la
+lib/glusterfs/3.6.0/xlator/features/cdc.la
+lib/glusterfs/3.6.0/xlator/features/changelog.la
+lib/glusterfs/3.6.0/xlator/features/gfid-access.la
+lib/glusterfs/3.6.0/xlator/features/glupy.la
+lib/glusterfs/3.6.0/xlator/features/glupy/debug-trace.py
+lib/glusterfs/3.6.0/xlator/features/glupy/debug-trace.pyc
+lib/glusterfs/3.6.0/xlator/features/glupy/debug-trace.pyo
+lib/glusterfs/3.6.0/xlator/features/glupy/helloworld.py
+lib/glusterfs/3.6.0/xlator/features/glupy/helloworld.pyc
+lib/glusterfs/3.6.0/xlator/features/glupy/helloworld.pyo
+lib/glusterfs/3.6.0/xlator/features/glupy/negative.py
+lib/glusterfs/3.6.0/xlator/features/glupy/negative.pyc
+lib/glusterfs/3.6.0/xlator/features/glupy/negative.pyo
+lib/glusterfs/3.6.0/xlator/features/index.la
+lib/glusterfs/3.6.0/xlator/features/locks.la
+lib/glusterfs/3.6.0/xlator/features/mac-compat.la
+lib/glusterfs/3.6.0/xlator/features/marker.la
+lib/glusterfs/3.6.0/xlator/features/posix-locks.so
+lib/glusterfs/3.6.0/xlator/features/prot_client.la
+lib/glusterfs/3.6.0/xlator/features/prot_dht.la
+lib/glusterfs/3.6.0/xlator/features/prot_server.la
+lib/glusterfs/3.6.0/xlator/features/quiesce.la
+lib/glusterfs/3.6.0/xlator/features/quota.la
+lib/glusterfs/3.6.0/xlator/features/quotad.la
+lib/glusterfs/3.6.0/xlator/features/read-only.la
+lib/glusterfs/3.6.0/xlator/features/snapview-client.la
+lib/glusterfs/3.6.0/xlator/features/snapview-server.la
+lib/glusterfs/3.6.0/xlator/features/worm.la
+lib/glusterfs/3.6.0/xlator/meta.la
+lib/glusterfs/3.6.0/xlator/mgmt/glusterd.la
+lib/glusterfs/3.6.0/xlator/mount/api.la
+lib/glusterfs/3.6.0/xlator/mount/fuse.la
+lib/glusterfs/3.6.0/xlator/nfs/server.la
+lib/glusterfs/3.6.0/xlator/performance/io-cache.la
+lib/glusterfs/3.6.0/xlator/performance/io-threads.la
+lib/glusterfs/3.6.0/xlator/performance/md-cache.la
+lib/glusterfs/3.6.0/xlator/performance/open-behind.la
+lib/glusterfs/3.6.0/xlator/performance/quick-read.la
+lib/glusterfs/3.6.0/xlator/performance/read-ahead.la
+lib/glusterfs/3.6.0/xlator/performance/readdir-ahead.la
+lib/glusterfs/3.6.0/xlator/performance/stat-prefetch.so
+lib/glusterfs/3.6.0/xlator/performance/write-behind.la
+lib/glusterfs/3.6.0/xlator/protocol/client.la
+lib/glusterfs/3.6.0/xlator/protocol/server.la
+lib/glusterfs/3.6.0/xlator/storage/posix.la
+lib/glusterfs/3.6.0/xlator/system/posix-acl.la
+lib/glusterfs/3.6.0/xlator/testing/features/template.la
+lib/glusterfs/3.6.0/xlator/testing/performance/symlink-cache.la
lib/libgfapi.la
lib/libgfchangelog.la
lib/libgfrpc.la
@@ -79,15 +90,51 @@ lib/ocf/resource.d/glusterfs/glusterd
lib/ocf/resource.d/glusterfs/volume
lib/pkgconfig/glusterfs-api.pc
lib/pkgconfig/libgfchangelog.pc
-${PYSITELIB}/gluster/__init__.py
-${PYSITELIB}/gluster/__init__.pyc
-${PYSITELIB}/gluster/__init__.pyo
-${PYSITELIB}/gluster/gfapi.py
-${PYSITELIB}/gluster/gfapi.pyc
-${PYSITELIB}/gluster/gfapi.pyo
-${PYSITELIB}/gluster/glupy.py
-${PYSITELIB}/gluster/glupy.pyc
-${PYSITELIB}/gluster/glupy.pyo
+libexec/glusterfs/gsyncd
+libexec/glusterfs/gverify.sh
+libexec/glusterfs/peer_add_secret_pub
+libexec/glusterfs/peer_gsec_create
+libexec/glusterfs/python/syncdaemon/README.md
+libexec/glusterfs/python/syncdaemon/__init__.py
+libexec/glusterfs/python/syncdaemon/__init__.pyc
+libexec/glusterfs/python/syncdaemon/__init__.pyo
+libexec/glusterfs/python/syncdaemon/changelogagent.py
+libexec/glusterfs/python/syncdaemon/changelogagent.pyc
+libexec/glusterfs/python/syncdaemon/changelogagent.pyo
+libexec/glusterfs/python/syncdaemon/configinterface.py
+libexec/glusterfs/python/syncdaemon/configinterface.pyc
+libexec/glusterfs/python/syncdaemon/configinterface.pyo
+libexec/glusterfs/python/syncdaemon/gconf.py
+libexec/glusterfs/python/syncdaemon/gconf.pyc
+libexec/glusterfs/python/syncdaemon/gconf.pyo
+libexec/glusterfs/python/syncdaemon/gsyncd.py
+libexec/glusterfs/python/syncdaemon/gsyncd.pyc
+libexec/glusterfs/python/syncdaemon/gsyncd.pyo
+libexec/glusterfs/python/syncdaemon/ipaddr.py
+libexec/glusterfs/python/syncdaemon/ipaddr.pyc
+libexec/glusterfs/python/syncdaemon/ipaddr.pyo
+libexec/glusterfs/python/syncdaemon/libcxattr.py
+libexec/glusterfs/python/syncdaemon/libcxattr.pyc
+libexec/glusterfs/python/syncdaemon/libcxattr.pyo
+libexec/glusterfs/python/syncdaemon/libgfchangelog.py
+libexec/glusterfs/python/syncdaemon/libgfchangelog.pyc
+libexec/glusterfs/python/syncdaemon/libgfchangelog.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/repce.py
+libexec/glusterfs/python/syncdaemon/repce.pyc
+libexec/glusterfs/python/syncdaemon/repce.pyo
+libexec/glusterfs/python/syncdaemon/resource.py
+libexec/glusterfs/python/syncdaemon/resource.pyc
+libexec/glusterfs/python/syncdaemon/resource.pyo
+libexec/glusterfs/python/syncdaemon/syncdutils.py
+libexec/glusterfs/python/syncdaemon/syncdutils.pyc
+libexec/glusterfs/python/syncdaemon/syncdutils.pyo
+libexec/glusterfs/set_geo_rep_pem_keys.sh
man/man8/gluster.8
man/man8/glusterd.8
man/man8/glusterfs.8
@@ -97,7 +144,8 @@ sbin/gluster
sbin/glusterd
sbin/glusterfs
sbin/glusterfsd
-sbin/mount.glusterfs
+sbin/mount_glusterfs
+sbin/umountd
share/doc/glusterfs/benchmarking/README
share/doc/glusterfs/benchmarking/glfs-bm.c
share/doc/glusterfs/benchmarking/launch-script.sh
@@ -105,7 +153,7 @@ share/doc/glusterfs/benchmarking/local-script.sh
share/doc/glusterfs/benchmarking/rdd.c
share/doc/glusterfs/glusterfs-mode.el
share/doc/glusterfs/glusterfs.vim
-share/examples/rc.d/glusterfsd
+share/examples/rc.d/glusterd
share/glusterfs/scripts/generate-gfid-file.sh
share/glusterfs/scripts/get-gfid.sh
share/glusterfs/scripts/gsync-sync-gfid
diff --git a/filesystems/glusterfs/PLIST.georeplication b/filesystems/glusterfs/PLIST.georeplication
deleted file mode 100644
index bf25c1067ec..00000000000
--- a/filesystems/glusterfs/PLIST.georeplication
+++ /dev/null
@@ -1,35 +0,0 @@
-@comment $NetBSD: PLIST.georeplication,v 1.7 2014/04/18 08:31:20 manu Exp $
-libexec/glusterfs/python/syncdaemon/README.md
-libexec/glusterfs/python/syncdaemon/__init__.py
-libexec/glusterfs/python/syncdaemon/__init__.pyc
-libexec/glusterfs/python/syncdaemon/__init__.pyo
-libexec/glusterfs/python/syncdaemon/configinterface.py
-libexec/glusterfs/python/syncdaemon/configinterface.pyc
-libexec/glusterfs/python/syncdaemon/configinterface.pyo
-libexec/glusterfs/python/syncdaemon/gconf.py
-libexec/glusterfs/python/syncdaemon/gconf.pyc
-libexec/glusterfs/python/syncdaemon/gconf.pyo
-libexec/glusterfs/python/syncdaemon/gsyncd.py
-libexec/glusterfs/python/syncdaemon/gsyncd.pyc
-libexec/glusterfs/python/syncdaemon/gsyncd.pyo
-libexec/glusterfs/python/syncdaemon/ipaddr.py
-libexec/glusterfs/python/syncdaemon/ipaddr.pyc
-libexec/glusterfs/python/syncdaemon/ipaddr.pyo
-libexec/glusterfs/python/syncdaemon/libcxattr.py
-libexec/glusterfs/python/syncdaemon/libcxattr.pyc
-libexec/glusterfs/python/syncdaemon/libcxattr.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/repce.py
-libexec/glusterfs/python/syncdaemon/repce.pyc
-libexec/glusterfs/python/syncdaemon/repce.pyo
-libexec/glusterfs/python/syncdaemon/resource.py
-libexec/glusterfs/python/syncdaemon/resource.pyc
-libexec/glusterfs/python/syncdaemon/resource.pyo
-libexec/glusterfs/python/syncdaemon/syncdutils.py
-libexec/glusterfs/python/syncdaemon/syncdutils.pyc
-libexec/glusterfs/python/syncdaemon/syncdutils.pyo
diff --git a/filesystems/glusterfs/distinfo b/filesystems/glusterfs/distinfo
index 0ff0cdbbbeb..99a266e5bb8 100644
--- a/filesystems/glusterfs/distinfo
+++ b/filesystems/glusterfs/distinfo
@@ -1,8 +1,15 @@
-$NetBSD: distinfo,v 1.34 2014/08/14 15:34:34 joerg Exp $
+$NetBSD: distinfo,v 1.35 2014/11/18 14:38:15 manu Exp $
-SHA1 (glusterfs-3.5.0.tar.gz) = 9900cae6c8c876ec69d244eeee1dd72a7797e03a
-RMD160 (glusterfs-3.5.0.tar.gz) = c836c58e224053632da65496c47eddf570e5e49b
-Size (glusterfs-3.5.0.tar.gz) = 4883901 bytes
-SHA1 (patch-argp-standalone_argp-fmtstream.c) = 241873f41bb774e1de4f777227c38b0dcae4ac59
-SHA1 (patch-argp-standalone_argp-fmtstream.h) = 9f2ead2a11c35fcc6347977082fa347343fccab2
-SHA1 (patch-glusterfsd_src_Makefile.in) = a26b706e0ff3dcf4fed625daa15c8187a934abca
+SHA1 (glusterfs-3.6.0.tar.gz) = fe19bf7128c955207f633261b9f0f87ac7341cfc
+RMD160 (glusterfs-3.6.0.tar.gz) = a0078c5a08617f981e09e96eed6eaa2f622dc4b5
+Size (glusterfs-3.6.0.tar.gz) = 5924875 bytes
+SHA1 (patch-9006) = 18ac4e9d58b587bd202f94323a2fb9a168aade80
+SHA1 (patch-9010) = 8d46f4c32c3a14da0724b65c9592196a2439dbea
+SHA1 (patch-9045) = 93cb986d8a2675a714ded956269ffa73f9495827
+SHA1 (patch-9080) = a5be37a2834859afc4cf2daab3bd8c68581ab221
+SHA1 (patch-9084) = bc24386464df02e2e6e7d0f42892881dd5d9ef3a
+SHA1 (patch-configure) = 51de89ba391cb699f34f11882dca0ca67c98e0a6
+SHA1 (patch-rpc_rpc-lib_src_rpcsvc.c) = a174a78d3daec9b784966b4c4502b335e4561558
+SHA1 (patch-xlator_cluster_dht_src_dht-common.c) = 835a240358948f310205c19514088cf93930b888
+SHA1 (patch-xlator_features_glupy_src_Makefile.in) = b338b98789d70f7c896ee29534a8dbae0ee93f08
+SHA1 (patch-xlator_storage_posix_src_posix.c) = 1ca56830afac7cda2fb4fc119fdd6161134eb8b5
diff --git a/filesystems/glusterfs/files/glusterd.sh b/filesystems/glusterfs/files/glusterd.sh
new file mode 100755
index 00000000000..e3a612774ec
--- /dev/null
+++ b/filesystems/glusterfs/files/glusterd.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $NetBSD: glusterd.sh,v 1.12 2014/11/18 14:38:15 manu Exp $
+#
+
+# PROVIDE: glusterd
+# REQUIRE: rpcbind
+
+$_rc_subr_loaded . /etc/rc.subr
+
+glusterd_precmd()
+{
+ fatal=0
+
+ for d in /var/lib/glusterd /usr/pkg/etc/glusterd ; do
+ if test -d /var/lib/glusterd ; then
+ echo "Please migrate $d to /var/db/glusterd" >&2
+ fatal=1
+ fi
+ done
+
+ if [ $fatal -eq 1 ] ; then
+ exit 1;
+ fi
+}
+
+name="glusterd"
+rcvar=$name
+command="/usr/pkg/sbin/${name}"
+#start_precmd="glusterd_precmd"
+pidfile="/var/run/${name}.pid"
+command_args="-p ${pidfile}"
+required_files="/usr/pkg/etc/glusterfs/${name}.vol"
+
+load_rc_config $name
+run_rc_command "$1"
+
diff --git a/filesystems/glusterfs/files/glusterfsd.sh b/filesystems/glusterfs/files/glusterfsd.sh
deleted file mode 100755
index 1e314f68925..00000000000
--- a/filesystems/glusterfs/files/glusterfsd.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-#
-# $NetBSD: glusterfsd.sh,v 1.9 2011/12/09 16:57:44 manu Exp $
-#
-
-# PROVIDE: glusterfsd
-# REQUIRE: rpcbind
-
-$_rc_subr_loaded . /etc/rc.subr
-
-name="glusterfsd"
-rcvar=$name
-command="@PREFIX@/sbin/${name}"
-pidfile="/var/run/${name}.pid"
-command_args="-p ${pidfile}"
-required_files="@PREFIX@/etc/glusterfs/${name}.vol"
-
-load_rc_config $name
-run_rc_command "$1"
diff --git a/filesystems/glusterfs/files/xattr-init.sh b/filesystems/glusterfs/files/xattr-init.sh
deleted file mode 100755
index a00f3daba61..00000000000
--- a/filesystems/glusterfs/files/xattr-init.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-
-# $NetBSD: xattr-init.sh,v 1.8 2011/08/09 07:15:42 manu Exp $
-
-GLUSTERFS_XATTR="
- trusted.distribute.linkinfo
- trusted.distribute.fix.layout
- trusted.glusterfs.pathinfo
- trusted.glusterfs.volume-mark
- trusted.glusterfs.test
- trusted.posix1.gen
- trusted.gfid
- trusted.afr
- glusterfs.open-fd-count
- glusterfs.inodelk-count
- glusterfs.entrylk-count
- glusterfs.posixlk-count
-"
-
-test $# -ne 1 && {
- echo "usage: $0 /export/volume/path"
- exit 1
-}
-
-VOLUME=$1
-
-test -d ${VOLUME} || {
- echo "$0: ${VOLUME} is not a directory"
- exit 1
-}
-
-mkdir -p ${VOLUME}/.attribute/user || {
- echo "$0: cannot create ${VOLUME}/.attribute/user"
- exit 1
-}
-
-mkdir -p ${VOLUME}/.attribute/system || {
- echo "$0: cannot create ${VOLUME}/.attribute/system"
- exit 1
-}
-
-extattrctl start ${VOLUME} || {
- echo "$0: cannot start extended attributes on ${VOLUME}"
- exit 1
-}
-
-for attr in ${GLUSTERFS_XATTR} ; do
- ns="user";
- echo ${attr} | egrep -q '^(trusted|system|security)\.' && ns="system"
-
- attrfile=${VOLUME}/.attribute/${ns}/${attr}
-
- test -e ${attrfile} && {
- echo "$0: ${attrfile} exists."
- exit 1
- }
-
- extattrctl initattr 1024 ${attrfile} || {
- echo "$0: cannot initialize ${attrfile}"
- exit 1
- }
-
- extattrctl enable ${VOLUME} ${ns} ${attr} ${attrfile} || {
- echo "$0: cannot enable ${attr} backed by ${attrfile}"
- exit 1
- }
-done
diff --git a/filesystems/glusterfs/options.mk b/filesystems/glusterfs/options.mk
deleted file mode 100644
index 2ae0cd915c3..00000000000
--- a/filesystems/glusterfs/options.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-# $NetBSD: options.mk,v 1.8 2013/04/08 11:17:13 rodent Exp $
-
-PKG_OPTIONS_VAR= PKG_OPTIONS.glusterfs
-PKG_SUPPORTED_OPTIONS= georeplication
-
-.include "../../mk/bsd.options.mk"
-
-.if !empty(PKG_OPTIONS:Mgeoreplication)
-CONFIGURE_ARGS+= --enable-georeplication
-PLIST_SRC+= ${PKGDIR}/PLIST.georeplication
-.else
-CONFIGURE_ARGS+= --disable-georeplication
-.endif
diff --git a/filesystems/glusterfs/patches/patch-9006 b/filesystems/glusterfs/patches/patch-9006
new file mode 100644
index 00000000000..a2464263bd8
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-9006
@@ -0,0 +1,55 @@
+$NetBSD: patch-9006,v 1.1 2014/11/18 14:38:15 manu Exp $
+From 4f97f9e26663f03da1ca675b16943544e39399a3 Mon Sep 17 00:00:00 2001
+From: Emmanuel Dreyfus <manu@netbsd.org>
+Date: Thu, 30 Oct 2014 09:50:41 +0100
+Subject: [PATCH] Lazy umount emulation: deal with stopped volumes
+
+On non Linux systems, lazy umount is emulated using contrib/umountd.
+It first check that the path given to unmount exists, but it should
+not give up on ENOTCONN as it is what happens when a volume is mounted
+but stopped.
+
+This lets NetBSD pass tests/bugs/bug-1049323.t
+
+Backport of: http://review.gluster.org/8991
+
+BUG: 1138897
+Change-Id: I39941577021c0b39f545f9777fe75cd39637427b
+Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
+---
+ contrib/umountd/umountd.c | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git contrib/umountd/umountd.c contrib/umountd/umountd.c
+index 42f867d..0d2c6f2 100644
+--- contrib/umountd/umountd.c
++++ contrib/umountd/umountd.c
+@@ -49,14 +49,20 @@ sanity_check (char *path, dev_t *devp)
+ if (path == NULL)
+ usage ();
+
+- if (stat (path, &st) != 0) {
+- gf_log ("umountd", GF_LOG_ERROR,
+- "Cannot access %s\n", path, strerror (errno));
+- goto out;
++ if ((ret = stat (path, &st)) != 0) {
++ switch (errno) {
++ case ENOTCONN:
++ /* volume is stopped */
++ break;
++ default:
++ gf_log ("umountd", GF_LOG_ERROR,
++ "Cannot access %s\n", path, strerror (errno));
++ goto out;
++ }
+ }
+
+ /* If dev was not specified, get it from path */
+- if (*devp == -1)
++ if (*devp == -1 && ret == 0)
+ *devp = st.st_dev;
+
+ strncpy (pathtmp, path, PATH_MAX);
+--
+1.8.2.3
+
diff --git a/filesystems/glusterfs/patches/patch-9010 b/filesystems/glusterfs/patches/patch-9010
new file mode 100644
index 00000000000..62457a1968e
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-9010
@@ -0,0 +1,72 @@
+$NetBSD: patch-9010,v 1.1 2014/11/18 14:38:15 manu Exp $
+From 70e4f2935ac858f2e83d0c3887b584af8fa0bd5b Mon Sep 17 00:00:00 2001
+From: Emmanuel Dreyfus <manu@netbsd.org>
+Date: Thu, 30 Oct 2014 10:54:24 +0100
+Subject: [PATCH] Use F_CLOSEM if available
+
+Use F_CLOSEM to close all file descriptors if available.
+
+Backport of Ib3c682825b89c163ebb152848f2533b3cb62cdce
+
+BUG: 1138897
+Change-Id: Ie44c8e07c77ca5509766e0addbb17c1979df68e7
+Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
+---
+ contrib/uuid/gen_uuid.c | 7 +++++++
+ libglusterfs/src/run.c | 8 ++++++--
+ 2 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git contrib/uuid/gen_uuid.c contrib/uuid/gen_uuid.c
+index 79923cd..e69995a 100644
+--- contrib/uuid/gen_uuid.c
++++ contrib/uuid/gen_uuid.c
+@@ -465,6 +465,12 @@ static ssize_t read_all(int fd, char *buf, size_t count)
+ #if defined(USE_UUIDD) && defined(HAVE_SYS_UN_H)
+ static void close_all_fds(void)
+ {
++#ifdef F_CLOSEM
++ (void)fcntl(0, F_CLOSEM);
++ (void)open("/dev/null", O_RDWR); /* stdin */
++ (void)open("/dev/null", O_RDWR); /* stdout */
++ (void)open("/dev/null", O_RDWR); /* stderr */
++#else /* F_CLOSEM */
+ int i, max;
+
+ #if defined(HAVE_SYSCONF) && defined(_SC_OPEN_MAX)
+@@ -485,6 +491,7 @@ static void close_all_fds(void)
+ if (i <= 2)
+ open("/dev/null", O_RDWR);
+ }
++#endif /* F_CLOSEM */
+ }
+ #endif
+
+diff --git libglusterfs/src/run.c libglusterfs/src/run.c
+index 4fd2a3a..93fe12a 100644
+--- libglusterfs/src/run.c
++++ libglusterfs/src/run.c
+@@ -289,7 +289,10 @@ runner_start (runner_t *runner)
+ closedir (d);
+ } else
+ ret = -1;
+-#else
++#else /* !GF_LINUX_HOST_OS */
++#ifdef F_CLOSEM /* NetBSD */
++ (void)fcntl(3, F_CLOSEM);
++#else /* !F_CLOSEM */
+ struct rlimit rl;
+ ret = getrlimit (RLIMIT_NOFILE, &rl);
+ GF_ASSERT (ret == 0);
+@@ -298,7 +301,8 @@ runner_start (runner_t *runner)
+ if (i != xpi[1])
+ close (i);
+ }
+-#endif
++#endif /* !F_CLOSEM */
++#endif /* !GF_LINUX_HOST_OS */
+ }
+
+ if (ret != -1) {
+--
+1.8.2.3
+
diff --git a/filesystems/glusterfs/patches/patch-9045 b/filesystems/glusterfs/patches/patch-9045
new file mode 100644
index 00000000000..0bd82d235ac
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-9045
@@ -0,0 +1,43 @@
+$NetBSD: patch-9045,v 1.1 2014/11/18 14:38:15 manu Exp $
+From fb36dbea2f492317a744b828d8ba8bdaab78ae3a Mon Sep 17 00:00:00 2001
+From: Emmanuel Dreyfus <manu@netbsd.org>
+Date: Tue, 4 Nov 2014 15:57:59 +0100
+Subject: [PATCH] Portability fix: mount.glusterfs
+
+Remove bash-specific syntax from mount.glusterfs
+
+This is a backport of Iec3a52686f7cee1825ac5a06c11fb8ac4d3e5d65
+
+BUG: 1138897
+Change-Id: I3149cd4d94c862a3857709c00cf0ed0377976f40
+Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
+---
+ xlators/mount/fuse/utils/mount_glusterfs.in | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git xlators/mount/fuse/utils/mount_glusterfs.in xlators/mount/fuse/utils/mount_glusterfs.in
+index e0a06ea..dc326b4 100755
+--- xlators/mount/fuse/utils/mount_glusterfs.in
++++ xlators/mount/fuse/utils/mount_glusterfs.in
+@@ -449,7 +449,7 @@ without_options()
+ parse_options()
+ {
+ local optarg=${1}
+- for pair in $(echo ${optarg//,/ }); do
++ for pair in $(echo $optarg | sed 's/,/ /g'); do
+ key=$(echo "$pair" | cut -f1 -d'=');
+ value=$(echo "$pair" | cut -f2- -d'=');
+ if [ "$key" = "$value" ]; then
+@@ -463,7 +463,8 @@ parse_options()
+ main ()
+ {
+ ## `mount` on OSX specifies options as first argument
+- if [[ $1 =~ "-o" ]]; then
++ echo $1|grep -q -- "-o"
++ if [ $? -eq 0 ]; then
+ volfile_loc=$3
+ mount_point=$4
+ else
+--
+1.8.2.3
+
diff --git a/filesystems/glusterfs/patches/patch-9080 b/filesystems/glusterfs/patches/patch-9080
new file mode 100644
index 00000000000..55d7999b631
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-9080
@@ -0,0 +1,264 @@
+$NetBSD: patch-9080,v 1.1 2014/11/18 14:38:15 manu Exp $
+From db7e7d493f763e0128c879280c9cec01bdea4260 Mon Sep 17 00:00:00 2001
+From: Emmanuel Dreyfus <manu@netbsd.org>
+Date: Thu, 30 Oct 2014 01:43:32 +0100
+Subject: [PATCH] glupy: portability fixes
+
+Fixes portability problems so that NetBSD passes tests/features/glupy.t
+
+- Use python-config to detect python build environment on all systems,
+ not just Linux and Darwin.
+- Get the site-package directory from python and make sure we install
+ glupy.py there, Previously we installed within glusterfs prefix,
+ which caused a problem if it was different that python's prefix.
+- Set PYTHONPATH for tests so that the detected site-packages is used
+ in python's search path. This should be useless, but let us have it
+ just in case.
+- Pass glupy.so path from glusterfsd to glupy.py through an
+ environment variable and use it in CDLL instead of "", as the
+ later seems not portable (at least it fails on NetBSD).
+- Use gil_init_key pthread_getspecific to avoid deadlocks (that
+ code was #ifdef out, perhaps because it was not needed on Linux,
+ but it seems to be required for NetBSD.
+- Recover the error message from Python and send it to the logs
+ to help debugging problems.
+
+Backport of: http://review.gluster.org/8978
+
+BUG: 1138897
+Change-Id: I1e23ba5cc18f129ee1032f905cb053953b683a81
+Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
+---
+ configure.ac | 18 +++++----------
+ tests/env.rc.in | 5 ++++-
+ tests/features/glupy.t | 1 +
+ xlators/features/glupy/src/Makefile.am | 4 ++--
+ xlators/features/glupy/src/glupy.c | 40 +++++++++++++++++++++++++---------
+ xlators/features/glupy/src/glupy.py | 3 ++-
+ 6 files changed, 45 insertions(+), 26 deletions(-)
+
+diff --git configure.ac configure.ac
+index ddc2cc5..dfcd976 100644
+--- configure.ac
++++ configure.ac
+@@ -217,6 +217,7 @@ AC_CANONICAL_HOST
+ AC_PROG_CC
+ AC_DISABLE_STATIC
+ AC_PROG_LIBTOOL
++AC_SUBST([shrext_cmds])
+
+ AC_CHECK_PROG([RPCGEN], [rpcgen], [yes], [no])
+
+@@ -967,18 +968,9 @@ saved_CFLAGS=$CFLAGS
+ saved_CPPFLAGS=$CPPFLAGS
+ saved_LDFLAGS=$LDFLAGS
+
+-case $host_os in
+- linux*)
+- CFLAGS="`${PYTHON}-config --cflags`"
+- CPPFLAGS=$CFLAGS
+- LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
+- ;;
+- darwin*)
+- CFLAGS="`${PYTHON}-config --cflags`"
+- CPPFLAGS=$CFLAGS
+- LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
+- ;;
+-esac
++CFLAGS="`${PYTHON}-config --cflags`"
++CPPFLAGS=$CFLAGS
++LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
+
+ AC_CHECK_HEADERS([python$PYTHON_VERSION/Python.h],[have_Python_h=yes],[])
+ AC_ARG_ENABLE([glupy],
+@@ -1029,12 +1021,14 @@ case $host_os in
+ esac
+
+ if test "x$BUILD_GLUPY" = "xyes"; then
++ BUILD_PYTHON_SITE_PACKAGES=`$PYTHON -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
+ BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`
+ BUILD_PYTHON_LIB=python$PYTHON_VERSION
+ GLUPY_SUBDIR=glupy
+ GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile
+ GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile
+ echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB"
++ AC_SUBST(BUILD_PYTHON_SITE_PACKAGES)
+ AC_SUBST(BUILD_PYTHON_INC)
+ AC_SUBST(BUILD_PYTHON_LIB)
+ AC_SUBST(GLUPY_SUBDIR)
+diff --git tests/env.rc.in tests/env.rc.in
+index 000a80f..1850b7a 100644
+--- tests/env.rc.in
++++ tests/env.rc.in
+@@ -8,4 +8,7 @@ LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH
+ export LD_LIBRARY_PATH
+
+ GLUSTERD_WORKDIR=@GLUSTERD_WORKDIR@
+-export GLUSTERD_WORKDIR
+\ No newline at end of file
++export GLUSTERD_WORKDIR
++
++PYTHONPATH=@BUILD_PYTHON_SITE_PACKAGES@:$PYTHON_PATH
++export PYTHONPATH
+diff --git tests/features/glupy.t tests/features/glupy.t
+index a34e48f..8b79a14 100755
+--- tests/features/glupy.t
++++ tests/features/glupy.t
+@@ -3,6 +3,7 @@
+ . $(dirname $0)/../include.rc
+ . $(dirname $0)/../volume.rc
+
++echo $PYTHON_PATH >&2
+ cleanup;
+
+ TEST mkdir -p $B0/glupytest
+diff --git xlators/features/glupy/src/Makefile.am xlators/features/glupy/src/Makefile.am
+index d9361a5..de8b0de 100644
+--- xlators/features/glupy/src/Makefile.am
++++ xlators/features/glupy/src/Makefile.am
+@@ -4,7 +4,7 @@ xlator_LTLIBRARIES = glupy.la
+ xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/features
+ glupydir = $(xlatordir)/glupy
+ AM_CPPFLAGS = $(PYTHONDEV_CPPFLAGS) $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src -isystem $(BUILD_PYTHON_INC)
+-AM_CFLAGS = $(PYTHONDEV_CFLAGS) -Wall -fno-strict-aliasing -DGLUSTER_PYTHON_PATH=\"$(glupydir)\" $(GF_CFLAGS)
++AM_CFLAGS = $(PYTHONDEV_CFLAGS) -Wall -fno-strict-aliasing -DGLUSTER_PYTHON_PATH=\"$(glupydir)\" -DPATH_GLUSTERFS_GLUPY_MODULE=\"${xlatordir}/glupy${shrext_cmds}\" $(GF_CFLAGS)
+
+ # Flags to build glupy.so with
+ glupy_la_LDFLAGS = $(PYTHONDEV_LDFLAGS) -module -avoid-version -shared -nostartfiles
+@@ -15,7 +15,7 @@ glupy_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \
+ noinst_HEADERS = glupy.h
+
+ # Install glupy.py into the Python site-packages area
+-pyglupydir = $(pythondir)/gluster
++pyglupydir = @BUILD_PYTHON_SITE_PACKAGES@/gluster
+ pyglupy_PYTHON = glupy.py __init__.py
+
+ CLEANFILES =
+diff --git xlators/features/glupy/src/glupy.c xlators/features/glupy/src/glupy.c
+index 292f5b7..7bb88c0 100644
+--- xlators/features/glupy/src/glupy.c
++++ xlators/features/glupy/src/glupy.c
+@@ -31,12 +31,10 @@ pthread_key_t gil_init_key;
+ PyGILState_STATE
+ glupy_enter (void)
+ {
+-#if 0
+ if (!pthread_getspecific(gil_init_key)) {
+ PyEval_ReleaseLock();
+ (void)pthread_setspecific(gil_init_key,(void *)1);
+ }
+-#endif
+
+ return PyGILState_Ensure();
+ }
+@@ -2333,6 +2331,9 @@ init (xlator_t *this)
+ PyObject *py_args = NULL;
+ PyObject *syspath = NULL;
+ PyObject *path = NULL;
++ PyObject *error_type = NULL;
++ PyObject *error_msg = NULL;
++ PyObject *error_bt = NULL;
+ static gf_boolean_t py_inited = _gf_false;
+ void * err_cleanup = &&err_return;
+
+@@ -2349,12 +2350,20 @@ init (xlator_t *this)
+ err_cleanup = &&err_free_priv;
+
+ if (!py_inited) {
++ /*
++ * This must be done before Py_Initialize(),
++ * because it will duplicate the environment,
++ * and fail to see later environment updates.
++ */
++ setenv("PATH_GLUSTERFS_GLUPY_MODULE",
++ PATH_GLUSTERFS_GLUPY_MODULE, 1);
++
+ Py_Initialize();
+ PyEval_InitThreads();
+-#if 0
++
+ (void)pthread_key_create(&gil_init_key,NULL);
+ (void)pthread_setspecific(gil_init_key,(void *)1);
+-#endif
++
+ /* PyEval_InitThreads takes this "for" us. No thanks. */
+ PyEval_ReleaseLock();
+ py_inited = _gf_true;
+@@ -2370,7 +2379,9 @@ init (xlator_t *this)
+ if (!py_mod_name) {
+ gf_log (this->name, GF_LOG_ERROR, "could not create name");
+ if (PyErr_Occurred()) {
+- PyErr_Print();
++ PyErr_Fetch (&error_type, &error_msg, &error_bt);
++ gf_log (this->name, GF_LOG_ERROR, "Python error: %s",
++ PyString_AsString(error_msg));
+ }
+ goto *err_cleanup;
+ }
+@@ -2379,9 +2390,12 @@ init (xlator_t *this)
+ priv->py_module = PyImport_Import(py_mod_name);
+ Py_DECREF(py_mod_name);
+ if (!priv->py_module) {
+- gf_log (this->name, GF_LOG_ERROR, "Python import failed");
++ gf_log (this->name, GF_LOG_ERROR, "Python import of %s failed",
++ module_name);
+ if (PyErr_Occurred()) {
+- PyErr_Print();
++ PyErr_Fetch (&error_type, &error_msg, &error_bt);
++ gf_log (this->name, GF_LOG_ERROR, "Python error: %s",
++ PyString_AsString(error_msg));
+ }
+ goto *err_cleanup;
+ }
+@@ -2392,7 +2406,9 @@ init (xlator_t *this)
+ if (!py_init_func || !PyCallable_Check(py_init_func)) {
+ gf_log (this->name, GF_LOG_ERROR, "missing init func");
+ if (PyErr_Occurred()) {
+- PyErr_Print();
++ PyErr_Fetch (&error_type, &error_msg, &error_bt);
++ gf_log (this->name, GF_LOG_ERROR, "Python error: %s",
++ PyString_AsString(error_msg));
+ }
+ goto *err_cleanup;
+ }
+@@ -2402,7 +2418,9 @@ init (xlator_t *this)
+ if (!py_args) {
+ gf_log (this->name, GF_LOG_ERROR, "could not create args");
+ if (PyErr_Occurred()) {
+- PyErr_Print();
++ PyErr_Fetch (&error_type, &error_msg, &error_bt);
++ gf_log (this->name, GF_LOG_ERROR, "Python error: %s",
++ PyString_AsString(error_msg));
+ }
+ goto *err_cleanup;
+ }
+@@ -2414,7 +2432,9 @@ init (xlator_t *this)
+ if (!priv->py_xlator) {
+ gf_log (this->name, GF_LOG_ERROR, "Python init failed");
+ if (PyErr_Occurred()) {
+- PyErr_Print();
++ PyErr_Fetch (&error_type, &error_msg, &error_bt);
++ gf_log (this->name, GF_LOG_ERROR, "Python error: %s",
++ PyString_AsString(error_msg));
+ }
+ goto *err_cleanup;
+ }
+diff --git xlators/features/glupy/src/glupy.py xlators/features/glupy/src/glupy.py
+index eda8aeb..b9fc370 100644
+--- xlators/features/glupy/src/glupy.py
++++ xlators/features/glupy/src/glupy.py
+@@ -9,9 +9,10 @@
+ ##
+
+ import sys
++import os
+ from ctypes import *
+
+-dl = CDLL("",RTLD_GLOBAL)
++dl = CDLL(os.getenv("PATH_GLUSTERFS_GLUPY_MODULE", ""),RTLD_GLOBAL)
+
+
+ class call_frame_t (Structure):
+--
+1.8.2.3
+
diff --git a/filesystems/glusterfs/patches/patch-9084 b/filesystems/glusterfs/patches/patch-9084
new file mode 100644
index 00000000000..d179a946495
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-9084
@@ -0,0 +1,350 @@
+$NetBSD: patch-9084,v 1.1 2014/11/18 14:38:15 manu Exp $
+From 23b7ead5de0f21abdcf5440a4a43dcf3a42c3822 Mon Sep 17 00:00:00 2001
+From: Emmanuel Dreyfus <manu@netbsd.org>
+Date: Mon, 10 Nov 2014 10:01:00 +0100
+Subject: [PATCH] telldir()/seekdir() portability fixes
+
+POSIX says that an offset obtained from telldir() can only be used
+on the same DIR *. Linux is abls to reuse the offset accross
+closedir()/opendir() for a given directory, but this is not portable
+and such a behavior should be fixed.
+
+An incomplete fix for the posix xlator was merged in
+http://review.gluster.org/8933
+This change set completes it.
+
+- Perform the same fix index xlator.
+- Use appropriate casts and variable types so that 32 bit signed
+ offsets obtained by telldir() do not get clobbered when copied into
+ 64 bit signed types.
+- modify afr-self-heald.c so that it does not use anonymous fd,
+ since this will cause closedir()/opendir() between each
+ syncop_readdir(). On failure we fallback to anonymous fs
+ only for Linux so that we can cope with updated client vs not
+ updated brick.
+- Avoid sending an EINVAL when the client request for the EOF offset.
+ Here we fix an error in previous fix for posix xlator: since we
+ fill each directory entry with the offset of the next entry, we
+ must consider as EOF the offset of the last entry, and not the
+ value of telldir() after we read it.
+
+This is a backport of I59fb7f06a872c4f98987105792d648141c258c6a
+
+BUG: 1138897
+Change-Id: I1e9f3e4a7d780b98adf6d9f197ee2198d43ef94d
+Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
+---
+ xlators/cluster/afr/src/afr-self-heald.c | 46 +++++++++++++++++++++++++++-----
+ xlators/features/index/src/index.c | 42 ++++++++++++++++++++---------
+ xlators/features/index/src/index.h | 1 +
+ xlators/storage/posix/src/posix.c | 26 +++++++++++-------
+ 4 files changed, 87 insertions(+), 28 deletions(-)
+
+diff --git xlators/cluster/afr/src/afr-self-heald.c xlators/cluster/afr/src/afr-self-heald.c
+index 10e1996..6ce52aa 100644
+--- xlators/cluster/afr/src/afr-self-heald.c
++++ xlators/cluster/afr/src/afr-self-heald.c
+@@ -276,6 +276,8 @@ afr_shd_index_opendir (xlator_t *this, int child)
+ #ifdef GF_LINUX_HOST_OS
+ fd_unref (fd);
+ fd = fd_anonymous (inode);
++ if (!fd)
++ goto out;
+ #else /* GF_LINUX_HOST_OS */
+ gf_log(this->name, GF_LOG_ERROR,
+ "opendir of %s for %s failed: %s",
+@@ -429,7 +431,7 @@ afr_shd_index_sweep (struct subvol_healer *healer)
+ fd_t *fd = NULL;
+ xlator_t *subvol = NULL;
+ afr_private_t *priv = NULL;
+- off_t offset = 0;
++ uint64_t offset = 0;
+ gf_dirent_t entries;
+ gf_dirent_t *entry = NULL;
+ uuid_t gfid;
+@@ -503,11 +505,12 @@ afr_shd_index_sweep (struct subvol_healer *healer)
+ int
+ afr_shd_full_sweep (struct subvol_healer *healer, inode_t *inode)
+ {
++ loc_t loc = {0, };
+ fd_t *fd = NULL;
+ xlator_t *this = NULL;
+ xlator_t *subvol = NULL;
+ afr_private_t *priv = NULL;
+- off_t offset = 0;
++ uint64_t offset = 0;
+ gf_dirent_t entries;
+ gf_dirent_t *entry = NULL;
+ int ret = 0;
+@@ -516,9 +519,38 @@ afr_shd_full_sweep (struct subvol_healer *healer, inode_t *inode)
+ priv = this->private;
+ subvol = priv->children[healer->subvol];
+
+- fd = fd_anonymous (inode);
+- if (!fd)
+- return -errno;
++ uuid_copy (loc.gfid, inode->gfid);
++ loc.inode = inode_ref(inode);
++
++ fd = fd_create (inode, GF_CLIENT_PID_AFR_SELF_HEALD);
++ if (!fd) {
++ gf_log(this->name, GF_LOG_ERROR,
++ "fd_create of %s failed: %s",
++ uuid_utoa (loc.gfid), strerror(errno));
++ ret = -errno;
++ goto out;
++ }
++
++ ret = syncop_opendir (subvol, &loc, fd);
++ if (ret) {
++#ifdef GF_LINUX_HOST_OS /* See comment in afr_shd_index_opendir() */
++ fd_unref(fd);
++ fd = fd_anonymous (inode);
++ if (!fd) {
++ gf_log(this->name, GF_LOG_ERROR,
++ "fd_anonymous of %s failed: %s",
++ uuid_utoa (loc.gfid), strerror(errno));
++ ret = -errno;
++ goto out;
++ }
++#else /* GF_LINUX_HOST_OS */
++ gf_log(this->name, GF_LOG_ERROR,
++ "opendir of %s failed: %s",
++ uuid_utoa (loc.gfid), strerror(errno));
++ ret = -errno;
++ goto out;
++#endif /* GF_LINUX_HOST_OS */
++ }
+
+ INIT_LIST_HEAD (&entries.list);
+
+@@ -560,6 +592,8 @@ afr_shd_full_sweep (struct subvol_healer *healer, inode_t *inode)
+ break;
+ }
+
++out:
++ loc_wipe (&loc);
+ if (fd)
+ fd_unref (fd);
+ return ret;
+@@ -949,7 +983,7 @@ afr_shd_gather_index_entries (xlator_t *this, int child, dict_t *output)
+ fd_t *fd = NULL;
+ xlator_t *subvol = NULL;
+ afr_private_t *priv = NULL;
+- off_t offset = 0;
++ uint64_t offset = 0;
+ gf_dirent_t entries;
+ gf_dirent_t *entry = NULL;
+ uuid_t gfid;
+diff --git xlators/features/index/src/index.c xlators/features/index/src/index.c
+index c342da8..50e2e0a 100644
+--- xlators/features/index/src/index.c
++++ xlators/features/index/src/index.c
+@@ -268,10 +268,11 @@ check_delete_stale_index_file (xlator_t *this, char *filename)
+ }
+
+ static int
+-index_fill_readdir (fd_t *fd, DIR *dir, off_t off,
++index_fill_readdir (fd_t *fd, index_fd_ctx_t *fctx, DIR *dir, off_t off,
+ size_t size, gf_dirent_t *entries)
+ {
+ off_t in_case = -1;
++ off_t last_off = 0;
+ size_t filled = 0;
+ int count = 0;
+ char entrybuf[sizeof(struct dirent) + 256 + 8];
+@@ -286,11 +287,11 @@ index_fill_readdir (fd_t *fd, DIR *dir, off_t off,
+ } else {
+ seekdir (dir, off);
+ #ifndef GF_LINUX_HOST_OS
+- if (telldir(dir) != off) {
++ if ((u_long)telldir(dir) != off && off != fctx->dir_eof) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+- "seekdir(%ld) failed on dir=%p: "
++ "seekdir(0x%llx) failed on dir=%p: "
+ "Invalid argument (offset reused from "
+- "another DIR * structure?)", (long)off, dir);
++ "another DIR * structure?)", off, dir);
+ errno = EINVAL;
+ count = -1;
+ goto out;
+@@ -299,7 +300,7 @@ index_fill_readdir (fd_t *fd, DIR *dir, off_t off,
+ }
+
+ while (filled <= size) {
+- in_case = telldir (dir);
++ in_case = (u_long)telldir (dir);
+
+ if (in_case == -1) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+@@ -335,12 +336,13 @@ index_fill_readdir (fd_t *fd, DIR *dir, off_t off,
+ if (this_size + filled > size) {
+ seekdir (dir, in_case);
+ #ifndef GF_LINUX_HOST_OS
+- if (telldir(dir) != in_case) {
++ if ((u_long)telldir(dir) != in_case &&
++ in_case != fctx->dir_eof) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+- "seekdir(%ld) failed on dir=%p: "
++ "seekdir(0x%llx) failed on dir=%p: "
+ "Invalid argument (offset reused from "
+ "another DIR * structure?)",
+- (long)in_case, dir);
++ in_case, dir);
+ errno = EINVAL;
+ count = -1;
+ goto out;
+@@ -357,7 +359,14 @@ index_fill_readdir (fd_t *fd, DIR *dir, off_t off,
+ entry->d_name, strerror (errno));
+ goto out;
+ }
+- this_entry->d_off = telldir (dir);
++ /*
++ * we store the offset of next entry here, which is
++ * probably not intended, but code using syncop_readdir()
++ * (glfs-heal.c, afr-self-heald.c, pump.c) rely on it
++ * for directory read resumption.
++ */
++ last_off = (u_long)telldir(dir);
++ this_entry->d_off = last_off;
+ this_entry->d_ino = entry->d_ino;
+
+ list_add_tail (&this_entry->list, &entries->list);
+@@ -366,9 +375,12 @@ index_fill_readdir (fd_t *fd, DIR *dir, off_t off,
+ count ++;
+ }
+
+- if ((!readdir (dir) && (errno == 0)))
++ if ((!readdir (dir) && (errno == 0))) {
+ /* Indicate EOF */
+ errno = ENOENT;
++ /* Remember EOF offset for later detection */
++ fctx->dir_eof = last_off;
++ }
+ out:
+ return count;
+ }
+@@ -581,6 +593,7 @@ __index_fd_ctx_get (fd_t *fd, xlator_t *this, index_fd_ctx_t **ctx)
+ fctx = NULL;
+ goto out;
+ }
++ fctx->dir_eof = -1;
+
+ ret = __fd_ctx_set (fd, this, (uint64_t)(long)fctx);
+ if (ret) {
+@@ -949,7 +962,7 @@ index_readdir_wrapper (call_frame_t *frame, xlator_t *this,
+ goto done;
+ }
+
+- count = index_fill_readdir (fd, dir, off, size, &entries);
++ count = index_fill_readdir (fd, fctx, dir, off, size, &entries);
+
+ /* pick ENOENT to indicate EOF */
+ op_errno = errno;
+@@ -1270,8 +1283,11 @@ index_releasedir (xlator_t *this, fd_t *fd)
+ goto out;
+
+ fctx = (index_fd_ctx_t*) (long) ctx;
+- if (fctx->dir)
+- closedir (fctx->dir);
++ if (fctx->dir) {
++ ret = closedir (fctx->dir);
++ if (ret)
++ gf_log (this->name, GF_LOG_ERROR, "closedir error: %s", strerror (errno));
++ }
+
+ GF_FREE (fctx);
+ out:
+diff --git xlators/features/index/src/index.h xlators/features/index/src/index.h
+index 661dcdb..206d280 100644
+--- xlators/features/index/src/index.h
++++ xlators/features/index/src/index.h
+@@ -34,6 +34,7 @@ typedef struct index_inode_ctx {
+
+ typedef struct index_fd_ctx {
+ DIR *dir;
++ off_t dir_eof;
+ } index_fd_ctx_t;
+
+ typedef struct index_priv {
+diff --git xlators/storage/posix/src/posix.c xlators/storage/posix/src/posix.c
+index 3e3d14f..5d37c9f 100644
+--- xlators/storage/posix/src/posix.c
++++ xlators/storage/posix/src/posix.c
+@@ -4839,6 +4839,7 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
+ gf_dirent_t *entries, xlator_t *this, int32_t skip_dirs)
+ {
+ off_t in_case = -1;
++ off_t last_off = 0;
+ size_t filled = 0;
+ int count = 0;
+ char entrybuf[sizeof(struct dirent) + 256 + 8];
+@@ -4874,11 +4875,11 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
+ } else {
+ seekdir (dir, off);
+ #ifndef GF_LINUX_HOST_OS
+- if (telldir(dir) != (long)off && off != pfd->dir_eof) {
++ if ((u_long)telldir(dir) != off && off != pfd->dir_eof) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+- "seekdir(%ld) failed on dir=%p: "
++ "seekdir(0x%llx) failed on dir=%p: "
+ "Invalid argument (offset reused from "
+- "another DIR * structure?)", (long)off, dir);
++ "another DIR * structure?)", off, dir);
+ errno = EINVAL;
+ count = -1;
+ goto out;
+@@ -4887,7 +4888,7 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
+ }
+
+ while (filled <= size) {
+- in_case = telldir (dir);
++ in_case = (u_long)telldir (dir);
+
+ if (in_case == -1) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+@@ -4947,13 +4948,13 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
+ if (this_size + filled > size) {
+ seekdir (dir, in_case);
+ #ifndef GF_LINUX_HOST_OS
+- if (telldir(dir) != (long)in_case &&
++ if ((u_long)telldir(dir) != in_case &&
+ in_case != pfd->dir_eof) {
+ gf_log (THIS->name, GF_LOG_ERROR,
+- "seekdir(%ld) failed on dir=%p: "
++ "seekdir(0x%llx) failed on dir=%p: "
+ "Invalid argument (offset reused from "
+ "another DIR * structure?)",
+- (long)in_case, dir);
++ in_case, dir);
+ errno = EINVAL;
+ count = -1;
+ goto out;
+@@ -4970,7 +4971,14 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
+ entry->d_name, strerror (errno));
+ goto out;
+ }
+- this_entry->d_off = telldir (dir);
++ /*
++ * we store the offset of next entry here, which is
++ * probably not intended, but code using syncop_readdir()
++ * (glfs-heal.c, afr-self-heald.c, pump.c) rely on it
++ * for directory read resumption.
++ */
++ last_off = (u_long)telldir(dir);
++ this_entry->d_off = last_off;
+ this_entry->d_ino = entry->d_ino;
+ this_entry->d_type = entry->d_type;
+
+@@ -4984,7 +4992,7 @@ posix_fill_readdir (fd_t *fd, DIR *dir, off_t off, size_t size,
+ /* Indicate EOF */
+ errno = ENOENT;
+ /* Remember EOF offset for later detection */
+- pfd->dir_eof = telldir (dir);
++ pfd->dir_eof = (u_long)last_off;
+ }
+ out:
+ return count;
+--
+1.8.2.3
+
diff --git a/filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.c b/filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.c
deleted file mode 100644
index cabdc4e540f..00000000000
--- a/filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.c
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-argp-standalone_argp-fmtstream.c,v 1.5 2013/10/04 08:07:23 manu Exp $
-
---- argp-standalone/argp-fmtstream.c.orig 2013-07-12 17:43:25.000000000 +0000
-+++ argp-standalone/argp-fmtstream.c
-@@ -389,6 +389,7 @@ __argp_fmtstream_printf (struct argp_fmt
- weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
- #endif
-
-+#if __STDC_VERSION__ - 199900L < 1
- /* Duplicate the inline definitions in argp-fmtstream.h, for compilers
- * that don't do inlining. */
- size_t
-@@ -471,5 +472,6 @@ __argp_fmtstream_point (argp_fmtstream_t
- __argp_fmtstream_update (__fs);
- return __fs->point_col >= 0 ? __fs->point_col : 0;
- }
-+#endif
-
- #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
diff --git a/filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.h b/filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.h
deleted file mode 100644
index 62d7c75268c..00000000000
--- a/filesystems/glusterfs/patches/patch-argp-standalone_argp-fmtstream.h
+++ /dev/null
@@ -1,48 +0,0 @@
-$NetBSD: patch-argp-standalone_argp-fmtstream.h,v 1.5 2013/10/04 08:07:23 manu Exp $
-
---- argp-standalone/argp-fmtstream.h.orig 2013-07-12 17:43:25.000000000 +0000
-+++ argp-standalone/argp-fmtstream.h
-@@ -153,6 +153,7 @@ extern ssize_t argp_fmtstream_printf (ar
- __const char *__fmt, ...)
- PRINTF_STYLE(2,3);
-
-+#if 0
- extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
- extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
-
-@@ -163,6 +164,7 @@ extern size_t __argp_fmtstream_write (ar
- __const char *__str, size_t __len);
- extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
- __const char *__str, size_t __len);
-+#endif
-
- /* Access macros for various bits of state. */
- #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
-@@ -172,6 +174,7 @@ extern size_t argp_fmtstream_write (argp
- #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
- #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
-
-+#if 0
- /* Set __FS's left margin to LMARGIN and return the old value. */
- extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
- size_t __lmargin);
-@@ -193,6 +196,7 @@ extern size_t __argp_fmtstream_set_wmarg
- /* Return the column number of the current output point in __FS. */
- extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
- extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
-+#endif
-
- /* Internal routines. */
- extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
-@@ -216,7 +220,11 @@ extern int __argp_fmtstream_ensure (argp
- #endif
-
- #ifndef ARGP_FS_EI
-+#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
- #define ARGP_FS_EI extern inline
-+#else
-+#define ARGP_FS_EI inline
-+#endif
- #endif
-
- ARGP_FS_EI size_t
diff --git a/filesystems/glusterfs/patches/patch-configure b/filesystems/glusterfs/patches/patch-configure
new file mode 100644
index 00000000000..ed56a7a6694
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-configure
@@ -0,0 +1,61 @@
+$NetBSD: patch-configure,v 1.1 2014/11/18 14:38:15 manu Exp $
+
+autoconf output after patch-9080
+
+--- configure.orig 2014-11-04 17:06:43.000000000 +0100
++++ configure 2014-11-04 17:09:32.000000000 +0100
+@@ -822,8 +822,9 @@
+ GLUPY_SUBDIR_MAKEFILE
+ GLUPY_SUBDIR
+ BUILD_PYTHON_LIB
+ BUILD_PYTHON_INC
++BUILD_PYTHON_SITE_PACKAGES
+ PYTHONDEV_LDFLAGS
+ PYTHONDEV_CPPFLAGS
+ PYTHONDEV_CFLAGS
+ ENABLE_SYSLOG_FALSE
+@@ -889,8 +890,9 @@
+ systemddir
+ mountutildir
+ pkgconfigdir
+ RPCGEN
++shrext_cmds
+ CPP
+ OTOOL64
+ OTOOL
+ LIPO
+@@ -19501,21 +19503,11 @@
+ saved_CFLAGS=$CFLAGS
+ saved_CPPFLAGS=$CPPFLAGS
+ saved_LDFLAGS=$LDFLAGS
+
+-case $host_os in
+- linux*)
+- CFLAGS="`${PYTHON}-config --cflags`"
+- CPPFLAGS=$CFLAGS
+- LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
+- ;;
+- darwin*)
+- CFLAGS="`${PYTHON}-config --cflags`"
+- CPPFLAGS=$CFLAGS
+- LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
+- ;;
+-esac
+-
++CFLAGS="`${PYTHON}-config --cflags`"
++CPPFLAGS=$CFLAGS
++LDFLAGS="-L`${PYTHON}-config --prefix`/lib `${PYTHON}-config --ldflags`"
+
+ for ac_header in python$PYTHON_VERSION/Python.h
+ do
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+@@ -19721,8 +19713,9 @@
+ ;;
+ esac
+
+ if test "x$BUILD_GLUPY" = "xyes"; then
++ BUILD_PYTHON_SITE_PACKAGES=`$PYTHON -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
+ BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"`
+ BUILD_PYTHON_LIB=python$PYTHON_VERSION
+ GLUPY_SUBDIR=glupy
+ GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile
diff --git a/filesystems/glusterfs/patches/patch-rpc_rpc-lib_src_rpcsvc.c b/filesystems/glusterfs/patches/patch-rpc_rpc-lib_src_rpcsvc.c
new file mode 100644
index 00000000000..7463236791f
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-rpc_rpc-lib_src_rpcsvc.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-rpc_rpc-lib_src_rpcsvc.c,v 1.3 2014/11/18 14:38:15 manu Exp $
+
+Shut up log-filling message
+
+--- rpc/rpc-lib/src/rpcsvc.c.orig 2014-11-04 14:27:15.000000000 +0100
++++ rpc/rpc-lib/src/rpcsvc.c 2014-11-04 14:28:46.000000000 +0100
+@@ -611,9 +611,9 @@
+ goto err_reply;
+
+ if (0 == svc->allow_insecure && unprivileged && !actor->unprivileged) {
+ /* Non-privileged user, fail request */
+- gf_log (GF_RPCSVC, GF_LOG_ERROR,
++ gf_log (GF_RPCSVC, GF_LOG_DEBUG,
+ "Request received from non-"
+ "privileged port. Failing request");
+ rpcsvc_request_destroy (req);
+ return -1;
diff --git a/filesystems/glusterfs/patches/patch-xlator_cluster_dht_src_dht-common.c b/filesystems/glusterfs/patches/patch-xlator_cluster_dht_src_dht-common.c
new file mode 100644
index 00000000000..1e365b37b4d
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-xlator_cluster_dht_src_dht-common.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-xlator_cluster_dht_src_dht-common.c,v 1.1 2014/11/18 14:38:15 manu Exp $
+
+Shut up log-filling message
+
+--- xlators/cluster/dht/src/dht-common.c.orig 2014-11-07 16:45:47.000000000 +0100
++++ xlators/cluster/dht/src/dht-common.c 2014-11-07 16:46:09.000000000 +0100
+@@ -1817,9 +1817,9 @@
+ "fresh_lookup returned for %s with op_ret %d and "
+ "op_errno %d", loc->path, op_ret, op_errno);
+
+ if (ENTRY_MISSING (op_ret, op_errno)) {
+- gf_log (this->name, GF_LOG_INFO, "Entry %s missing on subvol"
++ gf_log (this->name, GF_LOG_DEBUG, "Entry %s missing on subvol"
+ " %s", loc->path, prev->this->name);
+ if (conf->search_unhashed == GF_DHT_LOOKUP_UNHASHED_ON) {
+ local->op_errno = ENOENT;
+ dht_lookup_everywhere (frame, this, loc);
diff --git a/filesystems/glusterfs/patches/patch-xlator_features_glupy_src_Makefile.in b/filesystems/glusterfs/patches/patch-xlator_features_glupy_src_Makefile.in
new file mode 100644
index 00000000000..b684b64f943
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-xlator_features_glupy_src_Makefile.in
@@ -0,0 +1,28 @@
+$NetBSD: patch-xlator_features_glupy_src_Makefile.in,v 1.1 2014/11/18 14:38:15 manu Exp $
+
+automake output after patch-9006
+
+--- xlators/features/glupy/src/Makefile.in.orig 2014-11-04 16:37:44.000000000 +0100
++++ xlators/features/glupy/src/Makefile.in 2014-11-04 16:44:25.000000000 +0100
+@@ -314,9 +314,9 @@
+ # Ensure GLUSTER_PYTHON_PATH is passed to glupy.so
+ xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/features
+ glupydir = $(xlatordir)/glupy
+ AM_CPPFLAGS = $(PYTHONDEV_CPPFLAGS) $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src -isystem $(BUILD_PYTHON_INC)
+-AM_CFLAGS = $(PYTHONDEV_CFLAGS) -Wall -fno-strict-aliasing -DGLUSTER_PYTHON_PATH=\"$(glupydir)\" $(GF_CFLAGS)
++AM_CFLAGS = $(PYTHONDEV_CFLAGS) -Wall -fno-strict-aliasing -DGLUSTER_PYTHON_PATH=\"$(glupydir)\" -DPATH_GLUSTERFS_GLUPY_MODULE=\"${xlatordir}/glupy${shrext_cmds}\" $(GF_CFLAGS)
+
+ # Flags to build glupy.so with
+ glupy_la_LDFLAGS = $(PYTHONDEV_LDFLAGS) -module -avoid-version -shared -nostartfiles
+ glupy_la_SOURCES = glupy.c
+@@ -325,9 +325,9 @@
+
+ noinst_HEADERS = glupy.h
+
+ # Install glupy.py into the Python site-packages area
+-pyglupydir = $(pythondir)/gluster
++pyglupydir = @BUILD_PYTHON_SITE_PACKAGES@/gluster
+ pyglupy_PYTHON = glupy.py __init__.py
+ CLEANFILES =
+ all: all-am
+
diff --git a/filesystems/glusterfs/patches/patch-xlator_storage_posix_src_posix.c b/filesystems/glusterfs/patches/patch-xlator_storage_posix_src_posix.c
new file mode 100644
index 00000000000..9ca0cfad4c6
--- /dev/null
+++ b/filesystems/glusterfs/patches/patch-xlator_storage_posix_src_posix.c
@@ -0,0 +1,17 @@
+$NetBSD: patch-xlator_storage_posix_src_posix.c,v 1.1 2014/11/18 14:38:15 manu Exp $
+
+Shut up log-filling message
+
+--- xlators/storage/posix/src/posix.c.orig 2014-11-04 14:29:56.000000000 +0100
++++ xlators/storage/posix/src/posix.c 2014-11-04 14:30:49.000000000 +0100
+@@ -3431,9 +3431,9 @@
+ &nlink_samepgfid,
+ sizeof(nlink_samepgfid));
+ if (op_ret == -1) {
+ *op_errno = errno;
+- gf_log (this->name, GF_LOG_ERROR,
++ gf_log (this->name, GF_LOG_DEBUG,
+ "getxattr failed on "
+ "%s: key = %s (%s)",
+ leaf_path,
+ key,