commit 5bf27d95b9fb7611a1acedf6e29781dc7d405b5a Author: Ryan Doyle Date: Mon Oct 30 11:19:37 2017 -0400 nfsiostat: display NFS RPC queue time for mountstats and nfs-iostat Display the NFS queue statistics for mountstats and nfsiostat exported in /proc/self/mountstats. The RTT and total execution time is currently displayed but it's also useful displaying how long the task was queued for too Signed-off-by: Steve Dickson commit 545b7409de356168a39644d38e2ab5f77f468de7 Author: Justin Mitchell Date: Thu Sep 28 14:29:01 2017 -0400 nfs-utils: cleanup warnings from merged libnfsidmap code Clean up a bunch of warnings about unused parameters, signedness differences, etc that we inherited from the merged libnfsidmap code. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit f821eb7f9624f047a12fbf5c9dce23994eeb50e8 Author: Justin Mitchell Date: Thu Oct 26 08:46:43 2017 -0400 nfs-utils: integrate libnfsidmap code with rest of nfs-utils Modify libnfsidmap to use the now shared conffile code, adjust the build structure to generate everything correctly, and modify the other utils to use the merged version of libnfsidmap instead of testing for an external dependancy. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 1ea6d9231f839b968adb44eaf98b363f436cb1d5 Author: Justin Mitchell Date: Thu Sep 28 14:22:17 2017 -0400 nfs-utils: Import libnfsidmap codebase Merge the libnfsidmap code tree into nfs-utils. These are the original unmodified files, cherry picked only the necessary files that dont duplicate code, so will not build correctly at this stage. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 745287cca2fad6dfe63290bb8053ffe86637c18b Author: Justin Mitchell Date: Thu Sep 28 14:18:35 2017 -0400 nfs-utils: split conffile to a separate convenience lib To allow better reuse of the code we split conffile and xlog into their own separate convenience library, then merge it back so as to not create extra dependancies for everything Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit d1392d80cdd6c40e36c965c6ff000e01a2ee1694 Author: Justin Mitchell Date: Thu Sep 28 14:09:10 2017 -0400 conffile: Add get_str with default value The similar config code in libnfsidmap had one additional feature of a get_str function with a default value option, include an equivalent function here to maintain compatibility. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 45484cb3ca377c03c0c6b1ac5d4f7975b81d3ff5 Author: Justin Mitchell Date: Thu Sep 28 14:06:29 2017 -0400 conffile: Merge conf_get_str and conf_get_section conf_get_section() started as conf_get_str() with one extra search parameter, subsequent patches have not maintained feature parity, combine the code to make a single more generic function and just call that differently where required. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit b92df37d104c1790e16ec0f688202dec735d3eaa Author: Justin Mitchell Date: Thu Sep 28 14:04:07 2017 -0400 conffile: const-ify the config handling functions Tighten up the conffile interface by switching to const arguments where appropriate. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 5781bae4276348e4331cd3824c161c231e507f01 Author: Orion Poplawski Date: Wed Oct 25 15:30:10 2017 -0400 sm-notify needs to call res_init() before each try Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=625531 Signed-off-by: Steve Dickson commit 3d569cb3bedc448e52de831bf891e8c0729fa757 Author: Steve Dickson Date: Thu Oct 12 13:27:29 2017 -0400 nfsdcltrack: return an non-zero value for invalid options Signed-off-by: Steve Dickson commit 25b8f8b9691f10651d900f1ee17f8606853ec544 Author: J. Bruce Fields Date: Thu Oct 12 10:18:31 2017 -0400 exports(5): minor exports man page typo From: "J. Bruce Fields" Signed-off-by: Steve Dickson commit dcb5b1a7aba7c54c796cd892f2f9071b63ee80e1 Author: J. Bruce Fields Date: Thu Oct 12 10:12:58 2017 -0400 nfs(5): update some version information From: "J. Bruce Fields" We've seen some confusion from people not understanding why newer clients may not support NFSv2. It might help a little to note in the man page that version support depends on how the kernel was built. While we're there: - update some references to NFS protocol versions. - update 4.0 RFC, and add references to 4.1 and 4.2 RFCs. - rename "BUGS" to "NOTES"; the section mostly isn't about bugs. (Might be time to remove some of the linux-2.4 notes too.) - remove some outdated references to optional NFSv4+ features. (Or should we try to keep this information up to date?) Signed-off-by: J. Bruce Fields Signed-off-by: Steve Dickson commit fe375ac038f8dfce01131e3c67c42c73b8838f96 Author: NeilBrown Date: Thu Oct 12 10:08:31 2017 -0400 systemd: Add RemainAfterExit to two services Both auth-rpcgss-module and rpc-statd-notify only ever need to be run once - the effect they have is permanent. We can give this information to systemd by setting RemainAfterExit=yes This avoids the minor cost of running them a second time if something "Wants" either service after it was first run, (e.g. both client and server startup can Want these), and avoids systemd complaining that it restarts to fast if multiple Wants happen at nearly the same time. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 8110103404b35d9e86057ef0764f8aa87585f455 Author: Justin Mitchell Date: Thu Oct 5 10:40:51 2017 -0400 mount.nfs: merge in vers= and nfsvers= options When using mount.nfs if an nfsvers= option is set in a config file, and a vers= option is given on the commandline, then they are not always correctly combined and this can result in both being present in the resulting mount call. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 9176fa77355d93d1b520b95a1e1940f1c3e74d57 Author: Steve Dickson Date: Mon Oct 2 10:04:41 2017 -0400 rpc.nfsd: Do not fail when all address families are not support. Commit 2f8a6020 introduce a regression causing rpc.nfsd to fail when IPv6 is not supported. rpc.nfsd should not fail when there is at least one bounded socket. Signed-off-by: Steve Dickson commit 1d7e3a4808e1b8514af6342c1b49aaf08825b08f Author: Matthew Weber Date: Thu Oct 5 10:46:57 2017 -0400 nfs-utils: add missing include of stdint.h Glibc bump to 2.26 exposed this missing header when building with the following combination using an i386 internal toolchain. gcc5.4.0 bin2.28.1 linux4.1.43 Upstream: https://bugzilla.linux-nfs.org/show_bug.cgi?id=312 Reviewed-by: Chuck Lever Signed-off-by: Matthew Weber Signed-off-by: Steve Dickson commit 0994dc1bb7b348b7bec30f8053841e6d22caf633 Author: Manjunath Patil Date: Thu Oct 5 10:43:56 2017 -0400 nfsiostat: avoid parsing "no device mounted ..." line Present nfsiostat includes the "no device mounted ..." line from /proc/self/mountstats as addition description of the preceding mount point. If the preceding mount point is NFS mountpoint, nfsiostat fails to parse this line eventually. This patch avoids parsing this line. Signed-off-by: Manjunath Patil Signed-off-by: Steve Dickson commit 9f9f9122319ceaf6e1311fb3c296d77ca711604e Author: Frank Sorenson Date: Thu Sep 14 12:56:53 2017 -0400 mount: handle EACCES during version negotiation mount() can return EACCES for servers which permit 4.0 but are configured not to allow 4.1 This is currently only handled by the default case, so these mounts fail without retrying a lower minor. Add handling for EACCES to be retried with a lower minor version. Signed-off-by: Frank Sorenson Signed-off-by: Steve Dickson commit 2b3ebec1335eac81e9b90a7c95173f857a4b26b1 Author: Jianhong Yin Date: Thu Sep 14 12:50:56 2017 -0400 nfsman: document minorversion Signed-off-by: Steve Dickson commit 3f46368672ae9e729d012a94db59d04f45cfbc23 Author: Scott Mayhew Date: Wed Aug 23 14:57:12 2017 -0400 idmapd: daemonize earlier daemon_init() calls closeall() to close any "unneeded" file descriptors. This causes the following issue with idmapd on systems that are configured to have SSSD handle local users and groups: 1. During startup, rpc.idmapd calls getpwnam("nobody") and getgrnam("nobody") 2. sss_nss_mc_get{pw,gr}nam from libnss_sss open the cache files for users and groups and store the fd's in a struct sss_cli_mc_ctx. The passwd cache is fd 3 and the group cache is fd 4. 3. idmapd calls daemon_init() which sets fd's 0, 1, and 2 to /dev/null and fd 3 to the write end of the pipe that the child uses to report it's startup status. It then closes all fd's >= 4. 4. idmapd then calls event_init() which leads to epoll_create1() which returns 4 as the epoll fd. 6. An NFSv4 mount request comes in from a client, triggering an nfsdcb callback. 7. idmapd calls getgrgid_r() which leads to a call to sss_nss_check_header() which determines that the cache needs to be reinitialized. sss_nss_mc_destroy_ctx() is called, which closes the ctx->fd which now corresponds to the epoll file rather than the group cache file. 8. event_dispatch() calls epoll_wait() with epfd=4, and -EBADF is returned. idmapd logs the following error and exits with a nonzero status: rpc.idmapd[650]: main: event_dispatch returns errno 9 (Bad file descriptor) Moving the deamon_init() call so that it happens before get{pw,gr}nam() fixes this. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 8aea4a1c1da563437be5a6103ae459045e371f96 Author: Scott Mayhew Date: Wed Aug 23 14:55:20 2017 -0400 idmapd: fix object order in idmapd_LDADD nfs-utils and libnfsidmap have similar configuration parsing routines. They were the same up until nfs-utils commit 7b33590f (config: Remove the conf_path global), where conf_init() was changed to take a path as an argument. With the current idmap_LDADD ordering in Makefile.am, the conf_init() from libnfsidmap is called, resulting in the following error along with the failure to parse idmapd.conf: rpc.idmapd[391]: rpc.idmapd: conf_reinit: open ("(null)", O_RDONLY) failed Placing libnfs.a first in idmap_LDADD ensures that idmapd uses the config parsing routines from nfs-utils instead of libnfsidmap. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit caa59a30b78dedea99a2317da95bb86810360645 Author: Steve Dickson Date: Thu Jul 27 10:35:55 2017 -0400 mountstats: Remove a shebang There might be an issue that the script is executed with unwanted version of . Signed-off-by: Steve Dickson commit e8eb9e14411d9ef95e5eb26065dee7166052448e Author: Scott Mayhew Date: Wed Jul 26 14:03:12 2017 -0400 systemd: add a blurb about masking rpc-gssd to the man page This is helpful for users that have a krb5.keytab but do not want to use secure NFS. Also fixed a typo that appears earlier on the page. Reviewed-by: NeilBrown Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 050153ef6a86ff5ab06ef65be36336824a323779 Author: NeilBrown Date: Wed Jul 26 13:51:51 2017 -0400 mount: Fix problems with parsing minorversion= 1/ minorversion=0 is not recognized, as errors from strtol() are not correctly detected. 2/ when there is an error in the minorversion= value, no message is presented. 3/ Current code recognizes "minorversion" and sets V_SPECIFIC, but then because *cptr == '\0', the v_mode is reset to V_GENERAL. This results in minorversion negotiation, which is not wanted. This patch addresses all of these. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 1e3ca7fe199531a372bb8e1c1033d8973097be50 Author: NeilBrown Date: Wed Jul 26 13:47:42 2017 -0400 mount: move handling of "-t nfs4" into nfs_nfs_version() Current "-t nfs4" causes other mount options to be ignored and an NFSv4 version to be negotiated. This is even true when "-o vers=4.1" is given. To address this, we need to move the handled of "-t nfs4" into nfs_nfs_version, which means passing in the filesystem type. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit b5c2328971cdfd31340ff6190ea5b74b9010c160 Author: NeilBrown Date: Wed Jul 26 13:28:48 2017 -0400 mount: use version string that is supported by old kernels All kernels which support NFSv4.2 understand "vers=4.2". Some kernels which support NFSv4.1 only understand "vers=4,minorversion=1". All later kernels also support this. Some kernels which support NFSv4.0 only understand "vers=4". All later kernels also support this. So use the string that is most appropriate for each version. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 8af595b79b0f9f1a11e15b3dd35082c377fe6ef4 Author: NeilBrown Date: Wed Jul 26 13:23:32 2017 -0400 mount: support compiling with old glibc With glibc older than 2.24, it is always possible to include both linux/in6.h and netinet/in.h. So if the glibc is older, just hard-code the two values we need from linux/in6.h Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit f80c9984339da6f689f330b8a83d5ee503126827 Author: Steve Dickson Date: Wed Jul 19 16:42:39 2017 -0400 nfsdcltrack.c: remove a warning nfsdcltrack.c:581:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Acked-by: Jeff Layton Signed-off-by: Steve Dickson commit 69c56ab39ab88fb6ece79475eac99029b17ae170 Author: Steve Dickson Date: Wed Jul 19 16:40:37 2017 -0400 nfs4mount: removed a warning nfs4mount.c:445:8: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson commit 6b8ee0f663c44452a7568a0f2ffb038ee7ae0972 Author: Steve Dickson Date: Wed Jul 19 16:37:56 2017 -0400 nfsmount: remove a warning nfsmount.c:684:8: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson commit 2aa29fa3aa93507228192eb1954c6638463aac69 Author: Steve Dickson Date: Wed Jul 19 16:35:00 2017 -0400 network.c: removed some warnings network.c:1234:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1382:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1477:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1508:6: warning: this statement may fall through [-Wimplicit-fallthrough=] network.c:1574:6: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson commit b3b59568db7c96a3ed4a683f40e34542d63071cb Author: Steve Dickson Date: Wed Jul 19 16:24:27 2017 -0400 device-discovery.c: removed a warning device-discovery.c:171:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . } else if (dm_is_dm_major(major(dev))) ^~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Steve Dickson commit 65675d17d235874572a18fe2f4656e97dc699fe0 Author: Steve Dickson Date: Wed Jul 19 16:20:01 2017 -0400 bldev_read_serial: removed a couple warnings device-inq.c:216:7: warning: this statement may fall through [-Wimplicit-fallthrough=] device-inq.c:223:7: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson commit 3187c44672b35b16e67f10137c7cc4d30c0eef73 Author: Steve Dickson Date: Wed Jul 19 16:10:09 2017 -0400 nfsd.c: removed a few warnings nfsd.c:187:8: warning: this statement may fall through [-Wimplicit-fallthrough=] nfsd.c:213:8: warning: this statement may fall through [-Wimplicit-fallthrough=]nfsd.c:263:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson commit 8d53eb0690e1aaa2cf05fbc4c9fef42634e0b5f1 Author: Steve Dickson Date: Wed Jul 19 16:04:39 2017 -0400 cache.c: removed a couple warning cache.c:623:13: warning: In the GNU C Library, "major" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "major", include directly. If you did not intend to use a system-defined macro "major", you should undefine it after including . if (parsed->major != major(stb.st_dev) || ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cache.c:624:13: warning: In the GNU C Library, "minor" is defined by . For historical compatibility, it is currently defined by as well, but we plan to remove this soon. To use "minor", include directly. If you did not intend to use a system-defined macro "minor", you should undefine it after including . parsed->minor != minor(stb.st_dev)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Steve Dickson commit 6d3af74740899646d5d9bd1b033056b5357d4429 Author: Steve Dickson Date: Fri Jul 21 10:46:24 2017 -0400 atomicio: removed a warning atomicio.c:43:7: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson commit ed43dd4404369a57babf1b3a80bcbb8edeff1013 Author: Steve Dickson Date: Wed Jul 19 15:53:16 2017 -0400 present_address: Fixed error path When inet_ntop fails do not fall into the AF_INET6 case, instead break out and take the error path out. Signed-off-by: Steve Dickson commit acb6ffcdcae8d7d1b4b591dd772740a555c735b1 Author: Steve Dickson Date: Wed Jul 19 15:48:30 2017 -0400 rpcdebug.c: remove a warning rpcdebug.c:77:4: warning: this statement may fall through [-Wimplicit-fallthrough=] Signed-off-by: Steve Dickson commit ba03a02c2fd912f370e1f55de921a403bf5f9247 Author: Steve Dickson Date: Thu Jun 22 12:56:41 2017 -0400 rpc.c: added include file so UINT16_MAX is defined. Signed-off-by: Steve Dickson commit 90790d3129cf6f5fe095cf01e37d2d0a89d8dbec Author: Steve Dickson Date: Mon Jun 19 11:19:55 2017 -0400 mount.nfs: Use default minor version when -o v4 is specified When v4 is specified on the command line the default minor version needs to be used. Signed-off-by: Steve Dickson commit 62a4d95854e5cda4b772fa132cbd16c4429412c8 Author: Steve Dickson Date: Tue Jun 13 12:00:39 2017 -0400 mount.nfs: Use default minor version when -t nfs4 is specified When the nfs4 filesystem specified, the default major and minor versions should be used. Signed-off-by: Steve Dickson commit 9569237ba50c5857e04bc36c9b3250c570bfbef2 Author: Justin Mitchell Date: Wed Jun 21 12:01:01 2017 -0400 Reimplement include functionality in nfs.conf Re-implement include file functionality as documented. Existing implementation had various issues, one of which was it allowed a subordinate file to inadvertently change which section the subsequent tags back in the master config file got assigned to. Acked-by: NeilBrown Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 34c73d82ed02209bd8933da2f1f4761bb464d1d7 Author: NeilBrown Date: Tue Jun 13 08:39:08 2017 -0400 umount.nfs: assume path name is canonical. /usr/bin/umount will always pass a canonical name to umount.nfs, so it is safe to disable canonicalization. When umounting an NFS filesystem, it is generally safest to not "stat" the mountpoint at all as that can block indefinitely. umount() will not block, but lstat() etc can. By disabling canonicalization in libmount, we discourage it from ever calling 'stat' family operations, and thus reduce the chance of a hang. Note that to be fully effective, this requires changes to util-linux which have not yet been accepted. When both that change and this are in effect, automounters can use "umount -c $PATH" to safely unmount a filesystem without blocking. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 1c2c18806800198bf3f2336939a5b5c348f46b92 Author: Justin Mitchell Date: Thu Jun 1 11:20:36 2017 -0400 nfs.conf: Removed buffer overruns Remove the line length parameter and associated code which led to buffer overruns in the line parsing code. Also drops the undocumented 'include' directive. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit bc89ecb3146539e8a0afbd24ea6529aa8c4df175 Author: Justin Mitchell Date: Fri Jun 2 10:48:24 2017 -0400 nfs.conf: Add function to cleanup and free the loaded config Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 0276228a6f0ac390d3c3ed3502bb0d3ad73d093b Author: Justin Mitchell Date: Thu Jun 1 10:37:57 2017 -0400 nfs.conf: Remove static variables in parsing routines Part of a sequence of attempts to tidy up the nfs.conf code and prepare it for use as part of a configuration API. Remove static vars that prevented memory cleanup and potentially lead to parsing errors if conf_init was called again. Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit db61c1a59b2b29e35a608c798159088a39347dea Author: Steve Dickson Date: Thu Jun 1 13:29:20 2017 -0400 nfsd: added 'u' to argument list. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451568 Signed-off-by: Steve Dickson commit d406648690fa0fdf5333d7d54cf8210dab7f4d9c Author: NeilBrown Date: Thu Jun 1 09:42:16 2017 -0400 mount.nfs: improve version negotiation when vers=4 is specified. If NFSv4, in general, is requested (possibly by -t nfs4 or -o v4 or -o vers=4 etc) then we need to negotiate the best minor version, but must not fallback to v3 or v2. Internally, this state is reflected in v_mode == V_GENERAL. This means that a major version was given, but the minor version still needs to be negotiated. This is handled by nfs_autonegotiate(). It currently does the right thing for EPROTONOSUPPORT and EINVAL, but not for other errors. In particular, ENOENT can cause problems as NFSv4 might export a different namespace than NFSv3 (e.g. by using fsid=0 in the Linux NFS server). Currently a mount request for NFSv4 and a particular path can result if an NFSv3 mount if the path is available with v3 but not v4. So move the special handling of V_GENERAL into the common fall_back: code, and add extra checking in the ENCONNREFUSED case, which does not use fall_back:. Tested-by: Steve Dickson Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 0277815d9509ffc197c27973313f364616245704 Author: Steve Dickson Date: Thu May 4 09:50:49 2017 -0400 mount.nfs: Restore errno after v3 mounts on ECONNREFUSED errors Commit 65ac59cd introduced code that tries v3 mounts when the the v4 mount fails with ECONNREFUSED. This code allows failing back to v3 to work correctly. When the v3 mount fails the original errno value has been over rewritten. In these case the errno value needs to be restored to ECONNREFUSED. Signed-off-by: Steve Dickson commit 7b33590fee9515e49cda460285acc5d347a800b5 Author: Justin Mitchell Date: Fri May 5 11:03:20 2017 -0400 config: Remove the conf_path global Working towards an nfs.conf library and API for system config tools, first step, replace the conf_path global with a parameter to conf_init Signed-off-by: Justin Mitchell Signed-off-by: Steve Dickson commit 06bbb4ee6f5186e8e83d50767ad5b3b41968e5a6 Author: Jeff Layton Date: Wed Apr 26 12:13:50 2017 -0400 nfsdcltrack: silence some expected errors On a new install, we're unable to select from the parameters table, as it doesn't exist yet. The code is set up to log that fact at L_ERROR now, but it's an expected situation. Change it to log that at D_GENERAL instead. Reported-and-Tested-by: ChunYu Wang Signed-off-by: Jeff Layton Signed-off-by: Steve Dickson commit 09e5c6c2a3f8eac91d5353e6d4ff6aee7757ab08 Author: Steve Dickson Date: Mon Apr 24 11:25:39 2017 -0400 systemd: Afters are also needed for the Wants=network-online.target Commit 9d4fc3fb added Wants=network-online.target which is not enough to ensure the network is completely up before the NFS server is started. After=network-online.target is also needed. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1419351 Signed-off-by: Steve Dickson commit 9d4fc3fb5133be2df69fa380f80d1c660827fd1b Author: Steve Dickson Date: Mon Apr 10 07:16:58 2017 -0400 systemd: NFS server services should use network-online There has been an number startup problems where parts of the NFS server fails to start due to DNS and other parts of the network not be up. Reading the systemd.special it seems network.target is a passive unit which does not wait for the entire network to come up and network-online.target is an active unit which does wait. So this adds Wants=network-online.target to all of the NFS server services Signed-off-by: Steve Dickson commit 3892174834ea1a4729348f0ecd3078cc1d5458e4 Author: Scott Mayhew Date: Mon Apr 10 07:10:45 2017 -0400 systemd: add a generator for the rpc_pipefs mountpoint The nfs.conf has config options for the rpc_pipefs mountpoint. Currently, changing these from the default also requires manually overriding the systemd unit files that are hard-coded to mount the filesystem on /var/lib/nfs/rpc_pipefs. This patch adds a generator that creates a mount unit file for the rpc_pipefs when a non-default value is specified in /etc/nfs.conf, as well as a target unit file to override the dependencies for the systemd units using the rpc_pipefs. The blkmapd, idmapd, and gssd service unit files have been modified to define their dependencies on the rpc_pipefs mountpoint indirectly via the rpc_pipefs target unit file. Since both rpc-pipefs-generator.c and nfs-server-generator.c need to convert path names to unit file names, that functionality has been moved to systemd.c. This patch also removes the dependency on the rpc_pipefs from the rpc-svcgssd.service unit file. rpc.svcgssd uses the sunrpc cache mechanism to exchange data with the kernel, not the rpc_pipefs. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit da866d7f6a787045e2c9f4a700e23b58ec71400a Author: Scott Mayhew Date: Sun Apr 9 15:20:31 2017 -0400 blkmapd: allow the rpc_pipefs mountpoint to be overridden Allow the rpc_pipefs mountpoint to be overriden via the pipefs-directory variable in the [general] section of /etc/nfs.conf. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 29c322e391ad377f3e3902df0997d402c55aa0ce Author: Scott Mayhew Date: Sun Apr 9 15:20:06 2017 -0400 gssd: add a deprecation warning for pipefs-directory in gssd section All the daemons should use the same rpc_pipefs, so pipefs-directory should be specified in the [general] section. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit abe0774b0f39bdb32790e6ed20627e6fc43682f3 Author: Scott Mayhew Date: Sun Apr 9 15:19:02 2017 -0400 idmapd: move the pipefs-directory config option to nfs.conf Changed idmapd to read its value for the pipefs-directory from /etc/nfs.conf rather than /etc/idmapd.conf. All other configurations related to id mapping still reside in /etc/idmapd.conf for now. Added a warning to indicate that idmapd's -c option is deprecated. Corrected a misspelling of 'configuration' in nfs.conf. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 53f31f060e94fb0318418485fc2ab7149ab27f18 Author: Steve Dickson Date: Fri Apr 7 10:53:35 2017 -0400 systemd: nfs-server service should use network-online There has been an number startup problem where parts of the NFS server fail to start due to DNS and other parts of the network not be up. Reading the systemd.special it seems network.target is a passive unit which does not wait and network-online.target is an active unit which does not wait so that should be used. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1419351 Signed-off-by: Steve Dickson commit fbd7623dd8d5e418e7cb369d4026d5368f7c46a6 Author: Jeff Layton Date: Wed Apr 5 13:26:49 2017 -0400 nfsd: don't enable a UDP socket by default Most major NFS clients have supported TCP for at least a decade now, and v4-only shops are becoming more prevalent. It seems reasonable that serving over UDP should be something that is "opt-in". I've always hesitated to do this in the past, but now that we have nfs.conf, it seems like the time may be right to disable UDP in default configurations. In particular, it would be good to try this in the more bleeding edge distros (Fedora, Ubuntu, SuSE, etc...) and see how problematic it is. Change the default in rpc.nfsd to just open TCP ports by default. Add new -u and -t options that allow users to explicitly override what's in the config file, and update the usage message and manpage. Signed-off-by: Jeff Layton Signed-off-by: Steve Dickson commit d53fe5fe72d2b8d645ad362840da42021363384d Author: Trond Myklebust Date: Tue Apr 4 17:57:26 2017 -0400 nfsd: Allow the caller to turn off NFSv4.0 without turning off NFSv4.x The new semantic is that '-N4' turns off all NFSv4 minor versions, while '-V4' turns them all on. In order to turn off just minor version x (x >= 0), use -N4.x, and to turn it back on. '-V4.x'. Note that on older kernels, attempting to use -N4.0 and -V4.0 is equivalent to specifying -N4 or -V4. Signed-off-by: Trond Myklebust Signed-off-by: Steve Dickson commit c9eab79f70e80df51829193858304a797621ecdd Author: Scott Mayhew Date: Tue Apr 4 13:53:48 2017 -0400 sm-notify: ending the grace period early should be configurable sm-notify's early ending of the grace period when it has no hosts to notify can cause problems in some high availability configurations, which may be running one sm-notify per floating IP address in the cluster. This commit makes that behavior configurable via the nfs.conf (I don't think having a corresponding command line option would be particularly useful, hence none was added). Acked-by: J. Bruce Fields Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit c7896bec9699473959fc51baf3686149a470a30b Author: Chris Siebenmann Date: Tue Mar 14 10:41:39 2017 -0400 Manual page bug: two inaccuracies in nfsd(7) Here is a patch that deletes the mention of auth.domain and changes the wording around 'flush' files. I'm not attached to the revised wording; it's just the best I could manage in something that felt that it was within the same style and space as the current wording. Acked-by: NeilBrown Signed-off-by: Chris Siebenmann Signed-off-by: Steve Dickson commit 0a4f5e4daccdeba767b9ef36e30efbd7fd9a76d8 Author: Frank Sorenson Date: Wed Feb 15 10:38:53 2017 -0500 gssd: Duplicate the upcall string for error messages strsep() modifies the input string, so error messages may output only part of the upcall string. Make a copy of the upcall string, and use that in any error messages. Signed-off-by: Frank Sorenson Signed-off-by: Steve Dickson commit 5ae8be8b6af1a0fdf2fa26051a05d4c04d028849 Author: Frank Sorenson Date: Wed Feb 15 10:36:47 2017 -0500 gssd: replace non-thread-safe strtok with strsep gssd uses the non-thread-safe strtok() function, which can lead to incorrect program behavior. Replace strtok() with the thread-safe strsep(). Signed-off-by: Frank Sorenson Signed-off-by: Steve Dickson commit 40346e1503c3d52b43ed3fe2bf56742ac5454553 Author: NeilBrown Date: Wed Feb 15 10:33:49 2017 -0500 nfs-server-generator: handle 'noauto' mounts correctly When this code was written, the systemd documentation stated that "RequiresMountsFor" ignored mountpoints marked as "noauto". Unfortunately this is incorrect. Consquently a filesystem marked as noauto that is also NFS exported will currently be mounted when the NFS server is started. This is not what people expect. So add a check for the noauto flag. If any ancestor of a given export point has the noauto flag, no RequiresMountsFor will be generated for that point. Also skip RequiresMountsFor for exports marked 'mountpoint', as their absence is, theoretically, already handled by mountd. URL: https://github.com/systemd/systemd/issues/5249 Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 48cdcf68a9209ae239dfc3d1a0b482089ef2cd2a Author: NeilBrown Date: Wed Feb 15 10:31:28 2017 -0500 mount: call setgroups() before setuid() It is generally wise to call setgroups() (and setgid()) before calling setuid() to ensure no unexpected permission leaks happen. SUSE's build system checks all binaries for conformance with this and generates a warning for mountd. As we are setting the uid to 0, there is no risk that the group list will provide extra permissions, so there is no real risk here. But it is nice to silence warnings, and including a setgroups() call is probably a good practice to encourage. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 2b4b895faff5239774510afaa9948fea54e6967a Author: NeilBrown Date: Wed Feb 15 10:29:36 2017 -0500 conffile: ignore empty environment variables. conf_set() already refuses to set an empty value, so if foo= appears in the config file, it will be ignored. This patch extends the policy to environment variables, so empty environment variables are treated as though they didn't exist. This means that a separate environment file (e.g. /etc/sysconfig/nfs) will be treated the same way whether it is: - included in the [environment] section of /etc/nfs.conf - sourced by the shell before running code - sourced by the systemd EnvironmentFile directive. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 907426b00bdcd69d9a56ac1870990e8ae8c6fe9f Author: Rafael David Tinoco Date: Wed Feb 15 10:26:55 2017 -0500 systemd: Fix nfs-mountd dependency on rpcbind Following commit 91da135f - it replaced "rpcbind.target" by "rpcbind.socket" in some unit files - "rpcbind.socket" should also be added to "nfs-mountd.service" as a dependency to avoid race conditions. Usually "rpcbind.socket" is either started as a "sockets.target" dependency, or as a dependency for "nfs-server.service", when unit files include it in "BindsTo" or "After". Unfortunately there is a possilibility to have "nfs-mountd.service" started when the rpcbind socket is not yet created: systemd[1]: Starting NFS Mount Daemon... systemd[1]: nfs-mountd.service: Control process exited, code=exited status=1 systemd[1]: Failed to start NFS Mount Daemon. systemd[1]: nfs-mountd.service: Unit entered failed state. systemd[1]: nfs-mountd.service: Failed with result 'exit-code'. Nowadays "nfs-mountd.service" uses "BindTo" directive to "nfs-server.service". That, per se, doesn't guarantee ordering for NFS server to start rpcbind and for nfs-mountd to depend on it. https://bugs.launchpad.net/bugs/1590799 Reviewed-by: NeilBrown Signed-off-by: Rafael David Tinoco Signed-off-by: Steve Dickson commit a15bd948606bf4816bf819c0b0c75761f3eb6359 Author: Scott Mayhew Date: Wed Feb 15 10:21:40 2017 -0500 mountd/exportfs: implement the -s/--state-directory-path option Reviewed-by: NeilBrown Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 1789737ec6dd43c9d1436aeb6c07fab52206f412 Author: Scott Mayhew Date: Wed Feb 15 10:16:35 2017 -0500 libnsm.a: refactor nsm_setup_pathnames() and nsm_make_pathname() Move the logic in nsm_setup_pathnames() and nsm_make_pathname() to similar generic functions in libmisc.a so that the exportfs and rpc.mountd programs can make use of them later. Reviewed-by: NeilBrown Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 0712b5507866d6b3c900623eb1f81fffaec80ae2 Author: Jianhong Yin Date: Thu Feb 2 06:21:15 2017 -0500 mount: fix mount fail that caused by uninitialized struct From: "Jianhong.Yin" recent changes of utils/mount cause a regression mount fail: https://bugzilla.redhat.com/show_bug.cgi?id=1415024 can not reproduce it on x86_64(gcc on x86_64 might do struct initialize by default, I'm not sure). but it can be reproduced always on platform ppc64le aarch64. Signed-off-by: Jianhong Yin Signed-off-by: Steve Dickson