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