mountd netlink fixes
Subsystems (2)
cover mountd netlink fixes
A handful of fixes for some issues I ran into on Fedora Rawhide.
Scott Mayhew (3):
configure: update check of system netlink headers nfs.conf: add no-netlink option to exportd and mountd stanzas mountd/exportd: disable netlink when falling back to /proc
configure.ac | 4 ++-- nfs.conf | 3 +++ support/export/cache.c | 7 +++++++ support/export/cache_flush.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-)
Signature · 1 line
2.55.0
PATCH 1/3 configure: update check of system netlink headers
Commit e1401387 ("nfsstat: add netlink support for fetching server statistics") added new symbols to support/include/nfsd_netlink.h that have not yet been added to the kernel headers. Update the check that defines USE_SYSTEM_NFSD_NETLINK_H - otherwise nfsstat will fail to compile.
--- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
configure.ac +2 -2
@@ -259,9 +259,9 @@ AC_CHECK_HEADERS(linux/nfsd_netlink.h) AC_DEFINE([HAVE_NFSD_NETLINK], 1, [Define to 1 if nfsd generic netlink support is available]) -# ensure we have the expkey attributes +# ensure the system netlink headers have the latest features AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/nfsd_netlink.h>]], - [[int foo = NFSD_A_EXPKEY_SEQNO;]])], + [[int foo = NFSD_CMD_SERVER_STATS_GET;]])], [AC_DEFINE([USE_SYSTEM_NFSD_NETLINK_H], 1, ["Use system's linux/nfsd_netlink.h"])]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/lockd_netlink.h>]],
Signature · 1 line
2.55.0
PATCH 2/3 nfs.conf: add no-netlink option to exportd and mountd stanzas
In reply to Scott MayhewThis option was added by commit 60c38383 ("mountd/exportd/exportfs:
add --no-netlink option to disable netlink"), but nfs.conf was not updated.
--- nfs.conf | 3 +++ 1 file changed, 3 insertions(+)
nfs.conf +3 -0
@@ -43,6 +43,8 @@ # threads=1 # cache-use-ipaddr=n # ttl=1800 +# no-netlink=0 +# [mountd] # debug="all|auth|call|general|parse" # apply-root-cred=n
@@ -55,6 +57,7 @@ # ha-callout= # cache-use-ipaddr=n # ttl=1800 +# no-netlink=0 # [nfsdcld] # debug=0
Signature · 1 line
2.55.0
PATCH 3/3 mountd/exportd: disable netlink when falling back to /proc
In reply to Scott MayhewIf cache_flush() has to fall back to the /proc interface, then there's a good chance that the netlink interface isn't going to work, so go ahead and disable it.
The netlink interface requires CAP_NET_ADMIN, which requires a policy update on systems running SELinux. If SELinux blocks mountd from using the netlink interface and there's no fallback, then mount requests just hang.
Also, when falling back, close both the sunrpc and the nfsd netlink sockets.
--- support/export/cache.c | 7 +++++++ support/export/cache_flush.c | 1 + 2 files changed, 8 insertions(+)
support/export/cache.c +7 -0
@@ -3072,6 +3072,8 @@ void cache_open(void)* were queued before we opened the socket. */ auth_reload (); +if (no_netlink) + goto fallback;cache_nl_process_export ();cache_nl_process_expkey ();cache_nl_process_ip_map ();
@@ -3079,11 +3081,16 @@ void cache_open(void)cache_nl_process_unix_gid ();return ; } +fallback:xlog (L_NOTICE ,"sunrpc netlink family unavailable, falling back to /proc" );nl_socket_free (nfsd_nl_notify_sock); nfsd_nl_notify_sock =NULL ;nl_socket_free (nfsd_nl_cmd_sock); nfsd_nl_cmd_sock =NULL ; +nl_socket_free (sunrpc_nl_notify_sock); + sunrpc_nl_notify_sock =NULL ; +nl_socket_free (sunrpc_nl_cmd_sock); + sunrpc_nl_cmd_sock =NULL ; }for (i=0 ; cachelist[i].cache_name; i++ ) {
support/export/cache_flush.c +1 -0
@@ -164,5 +164,6 @@ cache_flush(void)return ; }/* Fallback: /proc path */ + no_netlink =1 ;cache_proc_flush (); }
Signature · 1 line
2.55.0
Quoted 7 lines · Scott Mayhew
A handful of fixes for some issues I ran into on Fedora Rawhide.
Scott Mayhew (3):
configure: update check of system netlink headers nfs.conf: add no-netlink option to exportd and mountd stanzas mountd/exportd: disable netlink when falling back to /proc
Quoted 5 lines
configure.ac | 4 ++-- nfs.conf | 3 +++ support/export/cache.c | 7 +++++++ support/export/cache_flush.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-)
These all look good to me. Nice work, Scott.
Quoted 7 lines · Scott Mayhew
A handful of fixes for some issues I ran into on Fedora Rawhide.
Scott Mayhew (3):
configure: update check of system netlink headers nfs.conf: add no-netlink option to exportd and mountd stanzas mountd/exportd: disable netlink when falling back to /proc
Quoted 6 lines
configure.ac | 4 ++-- nfs.conf | 3 +++ support/export/cache.c | 7 +++++++ support/export/cache_flush.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-)
Committed... (tag: nfs-utils-2-9-2-rc5)
steved.