e3c68b
From 19210e4fc551893d1545e719fa26d9ad2d2f5cba Mon Sep 17 00:00:00 2001
e3c68b
From: Jiffin Tony Thottan <jthottan@redhat.com>
e3c68b
Date: Mon, 13 Nov 2017 18:41:58 +0530
e3c68b
Subject: [PATCH 090/124] Revert "build: conditionally build legacy gNFS server
e3c68b
 and associated sub-packaging"
e3c68b
e3c68b
This reverts commit 83abcba6b42f94eb5a6495a634d4055362a9d79d.
e3c68b
e3c68b
label : DOWNSTREAM ONLY
e3c68b
e3c68b
Change-Id: If1c02d80b746e0a5b5e2c9a3625909158eff55d5
e3c68b
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/167575
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Soumya Koduri <skoduri@redhat.com>
e3c68b
Reviewed-by: Kaleb Keithley <kkeithle@redhat.com>
e3c68b
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e3c68b
---
e3c68b
 configure.ac                                 | 13 -------
e3c68b
 extras/LinuxRPM/Makefile.am                  |  4 +--
e3c68b
 glusterfs.spec.in                            | 54 ++++++----------------------
e3c68b
 xlators/Makefile.am                          |  5 +--
e3c68b
 xlators/mgmt/glusterd/src/glusterd-nfs-svc.c | 27 ++++++--------
e3c68b
 5 files changed, 24 insertions(+), 79 deletions(-)
e3c68b
e3c68b
diff --git a/configure.ac b/configure.ac
e3c68b
index 633e850..521671b 100644
e3c68b
--- a/configure.ac
e3c68b
+++ b/configure.ac
e3c68b
@@ -1359,18 +1359,6 @@ if test -n "$LIBAIO"; then
e3c68b
    BUILD_LIBAIO=yes
e3c68b
 fi
e3c68b
 
e3c68b
-dnl gnfs section
e3c68b
-BUILD_GNFS="no"
e3c68b
-AC_ARG_ENABLE([gnfs],
e3c68b
-              AC_HELP_STRING([--enable-gnfs],
e3c68b
-                             [Enable legacy gnfs server xlator.]))
e3c68b
-if test "x${with_server}" = "xyes" -a "x$enable_gnfs" = "xyes"; then
e3c68b
-    BUILD_GNFS="yes"
e3c68b
-fi
e3c68b
-AM_CONDITIONAL([BUILD_GNFS], [test x$BUILD_GNFS = xyes])
e3c68b
-AC_SUBST(BUILD_GNFS)
e3c68b
-dnl end gnfs section
e3c68b
-
e3c68b
 dnl Check for userspace-rcu
e3c68b
 PKG_CHECK_MODULES([URCU], [liburcu-bp], [],
e3c68b
   [AC_CHECK_HEADERS([urcu-bp.h],
e3c68b
@@ -1624,7 +1612,6 @@ echo "EC dynamic support   : $EC_DYNAMIC_SUPPORT"
e3c68b
 echo "Use memory pools     : $USE_MEMPOOL"
e3c68b
 echo "Nanosecond m/atimes  : $BUILD_NANOSECOND_TIMESTAMPS"
e3c68b
 echo "Server components    : $with_server"
e3c68b
-echo "Legacy gNFS server   : $BUILD_GNFS"
e3c68b
 echo "IPV6 default         : $with_ipv6_default"
e3c68b
 echo "Use TIRPC            : $with_libtirpc"
e3c68b
 echo "With Python          : ${PYTHON_VERSION}"
e3c68b
diff --git a/extras/LinuxRPM/Makefile.am b/extras/LinuxRPM/Makefile.am
e3c68b
index f028537..61fd6da 100644
e3c68b
--- a/extras/LinuxRPM/Makefile.am
e3c68b
+++ b/extras/LinuxRPM/Makefile.am
e3c68b
@@ -18,7 +18,7 @@ autogen:
e3c68b
 	cd ../.. && \
e3c68b
 	rm -rf autom4te.cache && \
e3c68b
 	./autogen.sh && \
e3c68b
-	./configure --enable-gnfs --with-previous-options
e3c68b
+	./configure --with-previous-options
e3c68b
 
e3c68b
 prep:
e3c68b
 	$(MAKE) -C ../.. dist;
e3c68b
@@ -36,7 +36,7 @@ srcrpm:
e3c68b
 	mv rpmbuild/SRPMS/* .
e3c68b
 
e3c68b
 rpms:
e3c68b
-	rpmbuild --define '_topdir $(shell pwd)/rpmbuild' --with gnfs -bb rpmbuild/SPECS/glusterfs.spec
e3c68b
+	rpmbuild --define '_topdir $(shell pwd)/rpmbuild' -bb rpmbuild/SPECS/glusterfs.spec
e3c68b
 	mv rpmbuild/RPMS/*/* .
e3c68b
 
e3c68b
 # EPEL-5 does not like new versions of rpmbuild and requires some
e3c68b
diff --git a/glusterfs.spec.in b/glusterfs.spec.in
e3c68b
index f6b823d..cb17eaa 100644
e3c68b
--- a/glusterfs.spec.in
e3c68b
+++ b/glusterfs.spec.in
e3c68b
@@ -52,11 +52,6 @@
e3c68b
 # rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --without georeplication
e3c68b
 %{?_without_georeplication:%global _without_georeplication --disable-georeplication}
e3c68b
 
e3c68b
-# gnfs
e3c68b
-# if you wish to compile an rpm with the legacy gNFS server xlator
e3c68b
-# rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with gnfs
e3c68b
-%{?_with_gnfs:%global _with_gnfs --enable-gnfs}
e3c68b
-
e3c68b
 # ipv6default
e3c68b
 # if you wish to compile an rpm with IPv6 default...
e3c68b
 # rpmbuild -ta @PACKAGE_NAME@-@PACKAGE_VERSION@.tar.gz --with ipv6default
e3c68b
@@ -153,7 +148,6 @@
e3c68b
 %if 0%{?_without_server:1}
e3c68b
 %global _without_events --disable-events
e3c68b
 %global _without_georeplication --disable-georeplication
e3c68b
-%global _with_gnfs %{nil}
e3c68b
 %global _without_tiering --disable-tiering
e3c68b
 %global _without_ocf --without-ocf
e3c68b
 %endif
e3c68b
@@ -525,25 +519,6 @@ is in userspace and easily manageable.
e3c68b
 This package provides support to geo-replication.
e3c68b
 %endif
e3c68b
 
e3c68b
-%if ( 0%{?_with_gnfs:1} )
e3c68b
-%package gnfs
e3c68b
-Summary:          GlusterFS gNFS server
e3c68b
-Requires:         %{name}%{?_isa} = %{version}-%{release}
e3c68b
-Requires:         %{name}-client-xlators%{?_isa} = %{version}-%{release}
e3c68b
-Requires:         nfs-utils
e3c68b
-
e3c68b
-%description gnfs
e3c68b
-GlusterFS is a distributed file-system capable of scaling to several
e3c68b
-petabytes. It aggregates various storage bricks over Infiniband RDMA
e3c68b
-or TCP/IP interconnect into one large parallel network file
e3c68b
-system. GlusterFS is one of the most sophisticated file systems in
e3c68b
-terms of features and extensibility.  It borrows a powerful concept
e3c68b
-called Translators from GNU Hurd kernel. Much of the code in GlusterFS
e3c68b
-is in user space and easily manageable.
e3c68b
-
e3c68b
-This package provides the glusterfs legacy gNFS server xlator
e3c68b
-%endif
e3c68b
-
e3c68b
 %package libs
e3c68b
 Summary:          GlusterFS common libraries
e3c68b
 
e3c68b
@@ -659,6 +634,7 @@ Requires:         %{name}-api%{?_isa} = %{version}-%{release}
e3c68b
 Requires:         %{name}-client-xlators%{?_isa} = %{version}-%{release}
e3c68b
 # lvm2 for snapshot, and nfs-utils and rpcbind/portmap for gnfs server
e3c68b
 Requires:         lvm2
e3c68b
+Requires:         nfs-utils
e3c68b
 %if ( 0%{?_with_systemd:1} )
e3c68b
 %{?systemd_requires}
e3c68b
 %else
e3c68b
@@ -789,7 +765,6 @@ export LDFLAGS
e3c68b
         %{?_with_cmocka} \
e3c68b
         %{?_with_debug} \
e3c68b
         %{?_with_firewalld} \
e3c68b
-        %{?_with_gnfs} \
e3c68b
         %{?_with_tmpfilesdir} \
e3c68b
         %{?_with_tsan} \
e3c68b
         %{?_with_valgrind} \
e3c68b
@@ -1286,17 +1261,6 @@ exit 0
e3c68b
 %{_bindir}/fusermount-glusterfs
e3c68b
 %endif
e3c68b
 
e3c68b
-%if ( 0%{?_with_gnfs:1} && 0%{!?_without_server:1} )
e3c68b
-%files gnfs
e3c68b
-%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
e3c68b
-%dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs
e3c68b
-     %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs/server.so
e3c68b
-%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs
e3c68b
-%ghost      %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
e3c68b
-%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run
e3c68b
-%ghost      %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
e3c68b
-%endif
e3c68b
-
e3c68b
 %files thin-arbiter
e3c68b
 %dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator
e3c68b
 %dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features
e3c68b
@@ -1409,11 +1373,6 @@ exit 0
e3c68b
 %config(noreplace) %{_sysconfdir}/glusterfs
e3c68b
 %exclude %{_sysconfdir}/glusterfs/thin-arbiter.vol
e3c68b
 %exclude %{_sysconfdir}/glusterfs/eventsconfig.json
e3c68b
-%exclude %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
e3c68b
-%exclude %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
e3c68b
-%if ( 0%{?_with_gnfs:1} )
e3c68b
-%exclude %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs/*
e3c68b
-%endif
e3c68b
 %config(noreplace) %{_sysconfdir}/sysconfig/glusterd
e3c68b
 %if ( 0%{_for_fedora_koji_builds} )
e3c68b
 %config(noreplace) %{_sysconfdir}/sysconfig/glusterfsd
e3c68b
@@ -1461,6 +1420,7 @@ exit 0
e3c68b
      %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/trash.so
e3c68b
      %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/upcall.so
e3c68b
      %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/features/leases.so
e3c68b
+     %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/nfs*
e3c68b
 %dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt
e3c68b
      %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/mgmt/glusterd.so
e3c68b
 %dir %{_libdir}/glusterfs/%{version}%{?prereltag}/xlator/protocol
e3c68b
@@ -1477,6 +1437,7 @@ exit 0
e3c68b
 
e3c68b
 # /var/lib/glusterd, e.g. hookscripts, etc.
e3c68b
 %ghost      %attr(0644,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/glusterd.info
e3c68b
+%ghost      %attr(0600,-,-) %config(noreplace) %{_sharedstatedir}/glusterd/options
e3c68b
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd
e3c68b
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/bitd
e3c68b
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/groups
e3c68b
@@ -1529,7 +1490,11 @@ exit 0
e3c68b
        %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre
e3c68b
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S30samba-stop.sh
e3c68b
             %attr(0755,-,-) %{_sharedstatedir}/glusterd/hooks/1/stop/pre/S29CTDB-teardown.sh
e3c68b
-%config(noreplace) %ghost      %attr(0600,-,-) %{_sharedstatedir}/glusterd/options
e3c68b
+%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs
e3c68b
+%ghost      %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/nfs-server.vol
e3c68b
+%ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/nfs/run
e3c68b
+%ghost      %attr(0600,-,-) %{_sharedstatedir}/glusterd/nfs/run/nfs.pid
e3c68b
+%ghost      %attr(0600,-,-) %{_sharedstatedir}/glusterd/options
e3c68b
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/peers
e3c68b
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/quotad
e3c68b
 %ghost %dir %attr(0755,-,-) %{_sharedstatedir}/glusterd/scrub
e3c68b
@@ -1995,6 +1960,9 @@ fi
e3c68b
 %endif
e3c68b
 
e3c68b
 %changelog
e3c68b
+* Sun Apr 7 2019 Jiffin Tony Thottan <jthottan@redhat.com>
e3c68b
+- DOWNSTREAM ONLY - revert of 83abcb(gnfs in an optional subpackage)
e3c68b
+
e3c68b
 * Sun Apr 7 2019 Soumya Koduri <skoduri@redhat.com>
e3c68b
 - As an interim fix add dependency on netstat(/net-tools) for glusterfs-ganesha package (#1395574)
e3c68b
 
e3c68b
diff --git a/xlators/Makefile.am b/xlators/Makefile.am
e3c68b
index ef20cbb..be54eb3 100644
e3c68b
--- a/xlators/Makefile.am
e3c68b
+++ b/xlators/Makefile.am
e3c68b
@@ -1,12 +1,9 @@
e3c68b
-if BUILD_GNFS
e3c68b
-  GNFS_DIR = nfs
e3c68b
-endif
e3c68b
 
e3c68b
 DIST_SUBDIRS = cluster storage protocol performance debug features \
e3c68b
           mount nfs mgmt system playground meta
e3c68b
 
e3c68b
 SUBDIRS = cluster storage protocol performance debug features \
e3c68b
-          mount ${GNFS_DIR} mgmt system playground meta
e3c68b
+          mount nfs mgmt system playground meta
e3c68b
 
e3c68b
 EXTRA_DIST = xlator.sym
e3c68b
 
e3c68b
diff --git a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
e3c68b
index 36e9052..3960031 100644
e3c68b
--- a/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
e3c68b
+++ b/xlators/mgmt/glusterd/src/glusterd-nfs-svc.c
e3c68b
@@ -18,6 +18,8 @@
e3c68b
 #include "glusterd-messages.h"
e3c68b
 #include "glusterd-svc-helper.h"
e3c68b
 
e3c68b
+static char *nfs_svc_name = "nfs";
e3c68b
+
e3c68b
 static gf_boolean_t
e3c68b
 glusterd_nfssvc_need_start()
e3c68b
 {
e3c68b
@@ -41,6 +43,12 @@ glusterd_nfssvc_need_start()
e3c68b
     return start;
e3c68b
 }
e3c68b
 
e3c68b
+int
e3c68b
+glusterd_nfssvc_init(glusterd_svc_t *svc)
e3c68b
+{
e3c68b
+    return glusterd_svc_init(svc, nfs_svc_name);
e3c68b
+}
e3c68b
+
e3c68b
 static int
e3c68b
 glusterd_nfssvc_create_volfile()
e3c68b
 {
e3c68b
@@ -49,7 +57,7 @@ glusterd_nfssvc_create_volfile()
e3c68b
     };
e3c68b
     glusterd_conf_t *conf = THIS->private;
e3c68b
 
e3c68b
-    glusterd_svc_build_volfile_path(conf->nfs_svc.name, conf->workdir, filepath,
e3c68b
+    glusterd_svc_build_volfile_path(nfs_svc_name, conf->workdir, filepath,
e3c68b
                                     sizeof(filepath));
e3c68b
     return glusterd_create_global_volfile(build_nfs_graph, filepath, NULL);
e3c68b
 }
e3c68b
@@ -60,7 +68,7 @@ glusterd_nfssvc_manager(glusterd_svc_t *svc, void *data, int flags)
e3c68b
     int ret = -1;
e3c68b
 
e3c68b
     if (!svc->inited) {
e3c68b
-        ret = glusterd_svc_init(svc, "nfs");
e3c68b
+        ret = glusterd_nfssvc_init(svc);
e3c68b
         if (ret) {
e3c68b
             gf_msg(THIS->name, GF_LOG_ERROR, 0, GD_MSG_FAILED_INIT_NFSSVC,
e3c68b
                    "Failed to init nfs service");
e3c68b
@@ -75,13 +83,6 @@ glusterd_nfssvc_manager(glusterd_svc_t *svc, void *data, int flags)
e3c68b
     if (ret)
e3c68b
         goto out;
e3c68b
 
e3c68b
-    /* not an error, or a (very) soft error at best */
e3c68b
-    if (sys_access(XLATORDIR "/nfs/server.so", R_OK) != 0) {
e3c68b
-        gf_msg(THIS->name, GF_LOG_INFO, 0, GD_MSG_GNFS_XLATOR_NOT_INSTALLED,
e3c68b
-               "nfs/server.so xlator is not installed");
e3c68b
-        goto out;
e3c68b
-    }
e3c68b
-
e3c68b
     ret = glusterd_nfssvc_create_volfile();
e3c68b
     if (ret)
e3c68b
         goto out;
e3c68b
@@ -155,14 +156,6 @@ glusterd_nfssvc_reconfigure()
e3c68b
     priv = this->private;
e3c68b
     GF_VALIDATE_OR_GOTO(this->name, priv, out);
e3c68b
 
e3c68b
-    /* not an error, or a (very) soft error at best */
e3c68b
-    if (sys_access(XLATORDIR "/nfs/server.so", R_OK) != 0) {
e3c68b
-        gf_msg(THIS->name, GF_LOG_INFO, 0, GD_MSG_GNFS_XLATOR_NOT_INSTALLED,
e3c68b
-               "nfs/server.so xlator is not installed");
e3c68b
-        ret = 0;
e3c68b
-        goto out;
e3c68b
-    }
e3c68b
-
e3c68b
     cds_list_for_each_entry(volinfo, &priv->volumes, vol_list)
e3c68b
     {
e3c68b
         if (GLUSTERD_STATUS_STARTED == volinfo->status) {
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b