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