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