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