NFS-Ganesha 3.3 GA

Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
This commit is contained in:
Kaleb S. KEITHLEY 2020-06-08 19:22:54 -04:00
parent 88c1030d09
commit 3ef69e3bfe
4 changed files with 19 additions and 279 deletions

View File

@ -1,134 +0,0 @@
From fc62d0dcc1b7e2f5c45fecacc3dddfa3ec600585 Mon Sep 17 00:00:00 2001
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
Date: Thu, 2 Jan 2020 10:10:40 -0500
Subject: [PATCH] core: multiple definitions of 'common' data compiling with
gcc-10
Winter is coming. So is gcc-10.
gcc-10 changes the way declared data is defined. Previously it was
defined as common data, now it is BSS. Common data was silently
merged by the linker.
See https://review.gluster.org/#/c/glusterfs/+/23956/ for a specific
example. The variables fixed in this patch are similar.
There are many changes coming in gcc-10 described in
https://gcc.gnu.org/gcc-10/changes.html
See nm(1) and ld(1) for a description C (common) and B (BSS) and how
they are treated by the linker.
Note: there is still a small chance that gcc-10 will land in Fedora-32,
despite 31 Dec. 2019 having been the deadline for that to happen.
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
Change-Id: I212a9c82c4d79012f25b9a4803776ab7a5a8af6d
---
src/FSAL/commonlib.c | 2 ++
src/MainNFSD/libganesha_nfsd.ver | 3 ++-
src/config_parsing/conf_yacc.y | 4 +++-
src/dbus/dbus_server.c | 2 ++
src/include/FSAL/fsal_commonlib.h | 8 ++++----
src/include/nfs_init.h | 2 +-
6 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/FSAL/commonlib.c b/src/FSAL/commonlib.c
index a780ddc55..254c8fcdc 100644
--- a/src/FSAL/commonlib.c
+++ b/src/FSAL/commonlib.c
@@ -92,6 +92,8 @@
static struct blkid_struct_cache *cache;
#endif
+pthread_rwlock_t fs_lock;
+
/* fsal_attach_export
* called from the FSAL's create_export method with a reference on the fsal.
*/
diff --git a/src/MainNFSD/libganesha_nfsd.ver b/src/MainNFSD/libganesha_nfsd.ver
index 7291d84b3..0e5774915 100644
--- a/src/MainNFSD/libganesha_nfsd.ver
+++ b/src/MainNFSD/libganesha_nfsd.ver
@@ -51,7 +51,9 @@
fridgethr_init;
fridgethr_submit;
fridgethr_sync_command;
+ fs_lock;
fsal_acl_2_posix_acl;
+ fsal_acl_support;
fsal_attach_export;
fsal_common_is_referral;
fsal_create;
diff --git a/src/config_parsing/conf_yacc.y b/src/config_parsing/conf_yacc.y
index 1911daea9..23403f24d 100644
--- a/src/config_parsing/conf_yacc.y
+++ b/src/config_parsing/conf_yacc.y
@@ -80,7 +80,7 @@ void ganesha_yyerror(YYLTYPE *yylloc_param,
void *yyscanner,
char*);
-struct glist_head all_blocks;
+extern struct glist_head all_blocks;
struct config_node *config_block(char *blockname,
struct config_node *list,
@@ -379,6 +379,8 @@ void ganesha_yyerror(YYLTYPE *yylloc_param,
* Create a block item with the given content
*/
+struct glist_head all_blocks;
+
void dump_all_blocks(void)
{
struct glist_head *glh;
diff --git a/src/dbus/dbus_server.c b/src/dbus/dbus_server.c
index 4e964baf1..fc665ce71 100644
--- a/src/dbus/dbus_server.c
+++ b/src/dbus/dbus_server.c
@@ -669,6 +669,8 @@ int32_t gsh_dbus_register_path(const char *name,
return code;
}
+pthread_t gsh_dbus_thrid;
+
void gsh_dbus_pkgshutdown(void)
{
struct avltree_node *node, *next_node;
diff --git a/src/include/FSAL/fsal_commonlib.h b/src/include/FSAL/fsal_commonlib.h
index 1529f0d98..729d54e6d 100644
--- a/src/include/FSAL/fsal_commonlib.h
+++ b/src/include/FSAL/fsal_commonlib.h
@@ -97,12 +97,12 @@ void fsal_ds_handle_fini(struct fsal_ds_handle *dsh);
int open_dir_by_path_walk(int first_fd, const char *path, struct stat *stat);
-struct avltree avl_fsid;
-struct avltree avl_dev;
+extern struct avltree avl_fsid;
+extern struct avltree avl_dev;
-struct glist_head posix_file_systems;
+extern struct glist_head posix_file_systems;
-pthread_rwlock_t fs_lock;
+extern pthread_rwlock_t fs_lock;
void free_fs(struct fsal_filesystem *fs);
diff --git a/src/include/nfs_init.h b/src/include/nfs_init.h
index deef2084e..e32de26ce 100644
--- a/src/include/nfs_init.h
+++ b/src/include/nfs_init.h
@@ -50,7 +50,7 @@ struct nfs_init {
extern struct nfs_init nfs_init;
-pthread_t gsh_dbus_thrid;
+extern pthread_t gsh_dbus_thrid;
void nfs_init_init(void);
void nfs_init_complete(void);
--
2.24.1

View File

@ -1,91 +0,0 @@
From bbc92214b5b104550bb1bad6865ad4bf461ef935 Mon Sep 17 00:00:00 2001
From: "ashish.sangwan" <ashishsangwan2@gmail.com>
Date: Tue, 21 Jan 2020 02:55:02 -0800
Subject: [PATCH] Fix seg fault when NFSv4 compound op fails for regular files.
We are hitting this seg-fault on our system:
3 0x00007f2837583f2d in mdcache_handle_to_key (obj_hdl=0x7f281f01a638, fh_desc=0x7f281def8b70) at /usr/src/debug/nfs-ganesha-2.8.3/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c:1377
4 0x00007f28374dea77 in state_obj_value_hash_func (hparam=0x7f2831838000, key=0x7f281defb500) at /usr/src/debug/nfs-ganesha-2.8.3/SAL/nfs4_state_id.c:369
5 0x00007f28374a2f51 in compute (ht=0x7f2831838000, key=0x7f281defb500, index=0x7f281defac54, rbt_hash=0x7f281defac40) at /usr/src/debug/nfs-ganesha-2.8.3/hashtable/hashtable.c:253
6 0x00007f28374a39b0 in hashtable_getlatch (ht=0x7f2831838000, key=0x7f281defb500, val=0x7f281defb4e0, may_write=true, latch=0x7f281defb4c0) at /usr/src/debug/nfs-ganesha-2.8.3/hashtable/hashtable.c:490
7 0x00007f28374df971 in nfs4_State_Del (state=0x7f281f04b480) at /usr/src/debug/nfs-ganesha-2.8.3/SAL/nfs4_state_id.c:759
8 0x00007f28374d9363 in _state_del_locked (state=0x7f281f04b480, func=0x7f28375d7ee0 <__func__.20139> "state_nfs4_state_wipe", line=669) at /usr/src/debug/nfs-ganesha-2.8.3/SAL/nfs4_state.c:351
9 0x00007f28374db4ac in state_nfs4_state_wipe (ostate=0x7f281f01a890) at /usr/src/debug/nfs-ganesha-2.8.3/SAL/nfs4_state.c:669
10 0x00007f28374cf045 in state_wipe_file (obj=0x7f281f01a638) at /usr/src/debug/nfs-ganesha-2.8.3/SAL/state_misc.c:1323
11 0x00007f28375a247c in _mdcache_lru_unref (entry=0x7f281f01a600, flags=0, func=0x7f28375fb8ef <__func__.23337> "mdcache_put", line=199) at /usr/src/debug/nfs-ganesha-2.8.3/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.c:2017
12 0x00007f283757f363 in mdcache_put (entry=0x7f281f01a600) at /usr/src/debug/nfs-ganesha-2.8.3/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.h:199
13 0x00007f28375842e0 in mdcache_put_ref (obj_hdl=0x7f281f01a638) at /usr/src/debug/nfs-ganesha-2.8.3/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c:1540
14 0x00007f283752e6cc in set_current_entry (data=0x7f2818c4e300, obj=0x0) at /usr/src/debug/nfs-ganesha-2.8.3/include/nfs_proto_data.h:392
15 0x00007f2837530838 in compound_data_Free (data=0x7f2818c4e300) at /usr/src/debug/nfs-ganesha-2.8.3/Protocols/NFS/nfs4_Compound.c:1451
16 0x00007f2837530584 in nfs4_Compound (arg=0x7f2818c23028, req=0x7f2818c22800, res=0x7f2818c4e1c0) at /usr/src/debug/nfs-ganesha-2.8.3/Protocols/NFS/nfs4_Compound.c:1362
17 0x00007f28374576c2 in nfs_rpc_process_request (reqdata=0x7f2818c22800) at /usr/src/debug/nfs-ganesha-2.8.3/MainNFSD/nfs_worker_thread.c:1986
(gdb) f 3
1377 subcall(
(gdb) p op_ctx->ctx_export
$2 = (struct gsh_export *) 0x0
(gdb) f 11
2017 state_wipe_file(&entry->obj_handle);
(gdb) p entry->lru
$1 = {q = {next = 0x7f2837854aa0 <LRU+3424>, prev = 0x7f2837854aa0 <LRU+3424>}, qid = LRU_ENTRY_CLEANUP, refcnt = 2, flags = 3, lane = 15, cf = 0}
The current compound op being executed is setattr which fails with ERR_FSAL_STALE because the file is deleted.
When we get ERR_FSAL_STALE in setattr we call mdcache_kill_entry which moves the mdcache entry to cleanup lane
and when we try to delete the state as part of cleanup, we hit this crash.
All the ops which are calling mdcache_kill_entry on receiving error for regular files could hit this crash.
We should not reset ctx_export until the compond data is freed.
Signed-off-by: ashish.sangwan <ashishsangwan2@gmail.com>
Change-Id: I3859e6e4599233c67d7640711e05cc5ab8647a3e
---
src/Protocols/NFS/nfs4_Compound.c | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/Protocols/NFS/nfs4_Compound.c b/src/Protocols/NFS/nfs4_Compound.c
index 42fd55009..64186642c 100644
--- a/src/Protocols/NFS/nfs4_Compound.c
+++ b/src/Protocols/NFS/nfs4_Compound.c
@@ -1052,12 +1052,6 @@ void complete_nfs4_compound(compound_data_t *data, int status,
LogDebug(COMPONENT_NFS_V4, "End status = %s lastindex = %d",
nfsstat4_to_str(status), data->oppos);
- /* release current active export in op_ctx. */
- if (op_ctx->ctx_export) {
- put_gsh_export(op_ctx->ctx_export);
- op_ctx->ctx_export = NULL;
- op_ctx->fsal_export = NULL;
- }
}
static enum xprt_stat nfs4_compound_resume(struct svc_req *req)
@@ -1106,6 +1100,13 @@ static enum xprt_stat nfs4_compound_resume(struct svc_req *req)
complete_nfs4_compound(data, status, result);
compound_data_Free(data);
+ /* release current active export in op_ctx. */
+ if (op_ctx->ctx_export) {
+ put_gsh_export(op_ctx->ctx_export);
+ op_ctx->ctx_export = NULL;
+ op_ctx->fsal_export = NULL;
+ }
+
nfs_rpc_complete_async_request(reqdata, NFS_REQ_OK);
@@ -1342,6 +1343,13 @@ out:
compound_data_Free(data);
+ /* release current active export in op_ctx. */
+ if (op_ctx->ctx_export) {
+ put_gsh_export(op_ctx->ctx_export);
+ op_ctx->ctx_export = NULL;
+ op_ctx->fsal_export = NULL;
+ }
+
return drop ? NFS_REQ_DROP : NFS_REQ_OK;
} /* nfs4_Compound */
--
2.24.1

View File

@ -1,18 +1,6 @@
%global _hardened_build 1
%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7
%global with_nfsidmap 1
%else
%global with_nfsidmap 0
%endif
%if ( 0%{?fedora} >= 18 || 0%{?rhel} >= 7 )
%global with_systemd 1
%else
%global with_systemd 0
%endif
%if ( 0%{?suse_version} )
BuildRequires: distribution-release
%if ( ! 0%{?is_opensuse} )
@ -22,9 +10,6 @@ Requires: sles-release >= 12
BuildRequires: openSUSE-release
Requires: openSUSE-release
%endif
%global with_systemd 1
%global with_nfsidmap 1
%endif
# Conditionally enable some FSALs, disable others.
@ -63,7 +48,7 @@ Requires: openSUSE-release
%global use_fsal_ceph %{on_off_switch ceph}
%ifnarch i686 armv7hl
%bcond_with rgw
%bcond_without rgw
%else
%bcond_with rgw
%endif
@ -129,15 +114,13 @@ Requires: openSUSE-release
# %%global dev rc5
Name: nfs-ganesha
Version: 3.2
Release: 6%{?dev:%{dev}}%{?dist}
Version: 3.3
Release: 1%{?dev:%{dev}}%{?dist}
Summary: NFS-Ganesha is a NFS Server running in user space
License: LGPLv3+
Url: https://github.com/nfs-ganesha/nfs-ganesha/wiki
Source0: https://github.com/%{name}/%{name}/archive/V%{version}%{?dev:-%{dev}}/%{name}-%{version}%{?dev:-%{dev}}.tar.gz
Patch0001: 0001-core-multiple-definitions-of-common-data-compiling-w.patch
Patch0002: 0002-Fix-seg-fault-when-NFSv4-compound-op-fails-for-regul.patch
BuildRequires: cmake
BuildRequires: bison
@ -171,7 +154,7 @@ BuildRequires: libwbclient-devel
%endif
BuildRequires: gcc-c++
%if ( %{with_system_ntirpc} )
BuildRequires: libntirpc-devel = 3.2
BuildRequires: libntirpc-devel >= 3.2
%else
Requires: libntirpc = @NTIRPC_VERSION_EMBED@
%endif
@ -197,15 +180,11 @@ Requires: portmap
%endif
%endif
%if %{with_nfsidmap}
%if ( 0%{?suse_version} )
BuildRequires: nfsidmap-devel
%else
BuildRequires: libnfsidmap-devel
%endif
%else
BuildRequires: nfs-utils-lib-devel
%endif
%if %{with rdma}
BuildRequires: libmooshika-devel >= 0.6-0
@ -213,14 +192,10 @@ BuildRequires: libmooshika-devel >= 0.6-0
%if %{with jemalloc}
BuildRequires: jemalloc-devel
%endif
%if %{with_systemd}
BuildRequires: systemd
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
BuildRequires: initscripts
%endif
%if %{with man_page}
%if ( 0%{?rhel} && 0%{?rhel} < 8 )
BuildRequires: python-sphinx
@ -517,8 +492,6 @@ Development headers and auxiliary files for developing with %{name}.
%prep
%setup -q -n %{name}-%{version}%{?dev:-%{dev}}
%patch0001 -p1
%patch0002 -p1
%build
cd src && %cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -581,18 +554,21 @@ install -m 644 config_samples/vfs.conf %{buildroot}%{_sysconfdir}/ganesha
install -m 644 config_samples/rgw.conf %{buildroot}%{_sysconfdir}/ganesha
%endif
%if %{with_systemd}
mkdir -p %{buildroot}%{_unitdir}
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
mkdir -p %{buildroot}%{_sysconfdir}/systemd/system/nfs-ganesha.d
%endif
install -m 644 scripts/systemd/nfs-ganesha.service.el7 %{buildroot}%{_unitdir}/nfs-ganesha.service
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
install -m 644 scripts/systemd/nfs-ganesha-lock.service.el8 %{buildroot}%{_unitdir}/nfs-ganesha-lock.service
install -m 644 scripts/systemd/rpc-statd.conf.el8 %{buildroot}%{_sysconfdir}/systemd/system/nfs-ganesha.d/rpc-statd.conf
%else
install -m 644 scripts/systemd/nfs-ganesha-lock.service.el7 %{buildroot}%{_unitdir}/nfs-ganesha-lock.service
%endif
install -m 644 scripts/systemd/nfs-ganesha-config.service %{buildroot}%{_unitdir}/nfs-ganesha-config.service
install -m 644 scripts/systemd/sysconfig/nfs-ganesha %{buildroot}%{_sysconfdir}/sysconfig/ganesha
mkdir -p %{buildroot}%{_localstatedir}/log/ganesha
%else
mkdir -p %{buildroot}%{_sysconfdir}/init.d
install -m 755 scripts/init.d/nfs-ganesha.el6 %{buildroot}%{_sysconfdir}/init.d/nfs-ganesha
install -m 644 scripts/init.d/sysconfig/ganesha %{buildroot}%{_sysconfdir}/sysconfig/ganesha
%endif
%if %{with lustre}
install -m 644 config_samples/lustre.conf %{buildroot}%{_sysconfdir}/ganesha
@ -621,10 +597,6 @@ install -m 644 config_samples/gpfs.ganesha.nfsd.conf %{buildroot}%{_sysconfdir}/
install -m 644 config_samples/gpfs.ganesha.main.conf %{buildroot}%{_sysconfdir}/ganesha
install -m 644 config_samples/gpfs.ganesha.log.conf %{buildroot}%{_sysconfdir}/ganesha
install -m 644 config_samples/gpfs.ganesha.exports.conf %{buildroot}%{_sysconfdir}/ganesha
%if ! %{with_systemd}
mkdir -p %{buildroot}%{_sysconfdir}/init.d
install -m 755 scripts/init.d/nfs-ganesha.gpfs %{buildroot}%{_sysconfdir}/init.d/nfs-ganesha-gpfs
%endif
%endif
make DESTDIR=%{buildroot} install
@ -656,12 +628,10 @@ semanage fcontext -a -t ganesha_var_log_t %{_localstatedir}/log/ganesha/ganesha-
%endif
restorecon %{_localstatedir}/log/ganesha
%endif
%if %{with_systemd}
%systemd_post nfs-ganesha.service
%systemd_post nfs-ganesha-lock.service
%systemd_post nfs-ganesha-config.service
%endif
%endif
killall -SIGHUP dbus-daemon >/dev/null 2>&1 || :
%pre
@ -673,20 +643,16 @@ exit 0
%if ( 0%{?suse_version} )
%service_del_preun nfs-ganesha-lock.service
%else
%if %{with_systemd}
%systemd_preun nfs-ganesha-lock.service
%endif
%endif
%postun
%if ( 0%{?suse_version} )
%service_del_postun nfs-ganesha-lock.service
%debug_package
%else
%if %{with_systemd}
%systemd_postun_with_restart nfs-ganesha-lock.service
%endif
%endif
%files
%license src/LICENSE.txt
@ -705,12 +671,11 @@ exit 0
%{_libexecdir}/ganesha/nfs-ganesha-config.sh
%dir %attr(0755,ganesha,ganesha) %{_localstatedir}/log/ganesha
%if %{with_systemd}
%{_unitdir}/nfs-ganesha.service
%{_unitdir}/nfs-ganesha-lock.service
%{_unitdir}/nfs-ganesha-config.service
%else
%{_sysconfdir}/init.d/nfs-ganesha
%if ( 0%{?fedora} ) || ( 0%{?rhel} && 0%{?rhel} >= 8 )
%{_sysconfdir}/systemd/system/nfs-ganesha.d/rpc-statd.conf
%endif
%if %{with man_page}
@ -786,9 +751,6 @@ exit 0
%config(noreplace) %{_sysconfdir}/ganesha/gpfs.ganesha.log.conf
%config(noreplace) %{_sysconfdir}/ganesha/gpfs.ganesha.exports.conf
%{_libexecdir}/ganesha/gpfs-epoch
%if ! %{with_systemd}
%{_sysconfdir}/init.d/nfs-ganesha-gpfs
%endif
%if %{with man_page}
%{_mandir}/*/ganesha-gpfs-config.8.gz
%endif
@ -895,6 +857,9 @@ exit 0
%endif
%changelog
* Mon Jun 8 2020 Kaleb S. KEITHLEY <kkeithle at redhat.com> - 3.3-1
- NFS-Ganesha 3.3 GA
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.2-6
- Rebuilt for Python 3.9

View File

@ -1 +1 @@
SHA512 (nfs-ganesha-3.2.tar.gz) = 12360d9aa38cbfc6d5b252c53526d80f4e98a47b963cd55ed8f68f6f2e1102caed4b62cd50885d516bb412347ec179a65f677a7755a718ef7edc129aef6775b3
SHA512 (nfs-ganesha-3.3.tar.gz) = 35b5f0da26ba7a29738e7c80bb339d7643a1e06cb70e96c790a750a6d8d2ae76434f0e912e9bd00c9fcddb2916fdadc0c5f224069b1699cb4f90926231d64e71