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