commit 8a835cebb149ba2a54b6518722c79019cf8e3da4 Author: Benjamin Coddington Date: Mon Aug 1 13:19:04 2022 -0400 rpc-statd.service: Stop rpcbind and rpc.stat in an exit race When `systemctl stop rpcbind.socket` is run, the dependency means that systemd first sends SIGTERM to rpcbind, then sigterm to rpc.statd. On SIGTERM, rpcbind tears down /var/run/rpcbind.sock. However, rpc-statd on SIGTERM attempts to unregister from rpcbind systemd needs to wait for rpc.statd to exit before sending SIGTERM to rpcbind Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2100395 Signed-off-by: Steve Dickson commit 36ce9a29d34e48e1fb5af80ec5258c342e6557df Author: Steve Dickson Date: Thu Jul 21 15:11:17 2022 -0400 rpc-pipefs-generator: allocate enough space for pipefs-directory buffer Commit 7f8463fe fixed a warning but introduce a regression by not allocating enough space for the pipefs-directory buffer when it is not the default. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2106896 Signed-off-by: Steve Dickson commit 7d76dd2e6f09a141eb6303b7343baa5c4f9c85ad Author: NeilBrown Date: Mon Jun 27 10:31:17 2022 -0400 configure: make modprobe.d directory configurable. Debian seems to prefer /lib/modprobe.d - at lease sometimes. So allow ./configure --with-modprobedir=/lib/modprobe.d to work, but default to /usr/lib/modprobe.d Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 5e60e38aa4ba251ef66610514be5f45c41519e0f Author: NeilBrown Date: Mon Jun 27 10:27:06 2022 -0400 modprobe: protect against sysctl errors If there is an error running sysctl, a modprobe of these modules will fail. We probably don't want that - missing a sysctl is unlikely to be fatal. A real possibility is that /sbin/sysctl might not exist at all, such as in a initramfs. In that case we definitely don't want modprobe to fail. So make the scriptlets safe. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit f541550358f136e9a6d1fd131e83d17e6269dae4 Author: Marcel Ritter Date: Tue Jun 21 09:23:22 2022 -0400 svcgssd: Add (undocumented) config options to man page There seem to be some undocumented options implemented. Why not mention them in the man page? Signed-off-by: Steve Dickson commit 284d249e0fe58443dafc96fa8be51a2cef4541a0 Author: Marcel Ritter Date: Tue Jun 21 09:21:36 2022 -0400 svcgssd: Display principal if set It's a little irritating to only see the template "<...>@<...>" if you set a specific principal name. So let's show it (if set). Signed-off-by: Steve Dickson commit 2eabb25d5a43e48e769a0db29956e9f5dc5b5913 Author: Marcel Ritter Date: Tue Jun 21 09:19:17 2022 -0400 svcgssd: Fix use-after-free bug (config variables) This patch fixes a bug when trying to set "principal" in /etc/nfs.conf. Memory gets freed by conf_cleanup() before being used - moving cleanup code resolves that. Signed-off-by: Steve Dickson commit 09128b9e09b21ea3b4a7e5e19b211fc5f4c8c564 Author: NeilBrown Date: Tue Jun 7 15:59:14 2022 -0400 autoconf: change tirpc to check for a file, not for an include Recent autoconf don't like variables in AC_CHECK_INCLUDE so we get a warning. In libtirpc.m4 we only need to check for the existence of a file, we don't need to extra support for includes, such as defining HAVE_TIRPC_H or whatever. So change from AC_CHECK_INCLUDE to AC_CHECK_FILE. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 1a5870f6b44671f32abf250bc7f60fb7f6a190a8 Author: NeilBrown Date: Tue Jun 7 14:30:57 2022 -0400 Update autoconfig files to work with v2.71 OpenSUSE recently updated autoconf to v2.71, and nfs-utils now doesn't build. This patch fixes it - mostly. This patch is the result of: - running autoupdate on configure.am and aclocal/* - removing any sections add that say they can safely be removed - revertion the change to AC_PREREQ. I haven't confirmed that it still works with v2.59. It does seem to work with 2.69 at least. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit afc7132dfb212ac1f676a5ac36d29a9e06325645 Author: NeilBrown Date: Tue Jun 7 14:22:11 2022 -0400 systemd: Apply all sysctl settings when NFS-related modules are loaded sysctl settings (e.g. /etc/sysctl.conf and others) are normally loaded once at boot. If the module that implements some settings is no yet loaded, those settings don't get applied. Various NFS modules support various sysctl settings. If they are loaded after boot, they miss out. So add commands to modprobe.d/50-nfs.conf to apply the relevant settings when the module is loaded. I have placed this in the "systemd" directory because it seemed the least bad choice. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 6a0a107e1ded470af827e1d416515c77b214a12e Author: Anna Schumaker Date: Thu May 26 13:05:51 2022 -0400 rpcctl: Print a message if the user tries to modify a main xprt 'main' xprts cannot be set offline or removed, so print a helpful error message in this case instead of a cryptic 'invalid argument' message. Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit 1393b549eb80761d5f8c6b2c9ed711fb55b507d1 Author: Anna Schumaker Date: Thu May 26 13:02:42 2022 -0400 rpcctl: Use the correct function for setting xprts offline and online Otherwise the tool will tell us: 'Namespace' object has no attribute 'set_state' Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit 8ca592af5fba8aea8b11ee28bf3543bfab02e4b2 Author: Konstantin Khorenko Date: Thu May 26 12:55:12 2022 -0400 mountd: Check 'nfsd/clients' directory presence instead of kernel version Kernel major version does not always provide 100% certainty about presence or absence of a feature, for example: - some distros backport feature from mainstream kernel to older kernels - if NFS server is run inside a system container the reported kernel version inside the container may be faked So let's determine the feature presence by checking '/proc/fs/nfsd/clients/' directory presence instead of checking the kernel version. Signed-off-by: Konstantin Khorenko Signed-off-by: Steve Dickson commit f347c3c8c605b874733019685b7f8ae84e86b55e Author: Thiago Becker Date: Thu May 26 12:05:08 2022 -0400 nfsrahead: getopt return type is int While compiling for aarch64, the compiler throws the warning below because char is unsigned for aarch64. main.c: In function ?main?: main.c:145:48: warning: comparison is always true due to limited range of data type [-Wtype-limits] 145 | while((opt = getopt(argc, argv, "dF")) != -1) { | This makes nfsrahead to run forever. Fix opt type to the same as getopt type. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2083926 Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit 18ac9c85d49d081dcfac8ba6ca63b4adc07c8ac6 Author: Thiago Becker Date: Fri Apr 29 16:39:07 2022 -0400 nfsrahead: fix and improve logging Logging was not working properly wrt verbosity, it is changed by changing the facilities used. While at logging, add some extra logs when verbose that may be important. Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit 4efb87e745d11570e8536cea1fc835a2cd04c3ee Author: Thiago Becker Date: Fri Apr 29 16:37:16 2022 -0400 nfsrahead: fix oops caused by non-starndard naming schemes brtfs uses a non standard naming scheme for its fs structures, which causes nfsrahead to take a long time scanning all the memory available and then crashes. This causes the udev to take forever to quiesce and delays the system startup. This t=patch refactors the way the device number is obtained to handle this situation. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2078147 Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit e413f212caa65317845bf0ca565d9057ce5ed1f0 Author: Steve Dickson Date: Tue Apr 19 16:36:38 2022 -0400 nfsidmap.man: Fix section number The nfsidmap manual page is supposed to be in section 8, but calls the .TH macro with a section argument of 5. This results in an incorrect header and causes debhelper (in Debian) to install it in the section 5 directory. Fix that. Signed-off-by: Ben Hutchings Signed-off-by: Salvatore Bonaccorso Signed-off-by: Steve Dickson commit 3dd9292aeb65ca75e4e070ce6102a173ef780e1e Author: Steve Dickson Date: Tue Apr 19 15:45:43 2022 -0400 nfsrahead: Add parameters to nfs.conf Signed-off-by: Steve Dickson commit 170394f63f648eb46eca5c5c333ae56c3eb96397 Author: Steve Dickson Date: Tue Apr 19 11:11:20 2022 -0400 nfsrahead: retry getting the device if it fails. Sometimes the mountinfo entry is not available when nfsrahead is called, leading to failure to set the readahead. Retry getting the device before failing. Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit 589b0f898a757b03c4573d65309df8f6e8d6c524 Author: Steve Dickson Date: Tue Apr 19 11:10:27 2022 -0400 nfsrahead: User documentation Add the man page for nfsrahead, and add the new section to nfs.conf. Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit 0cc3a8aac8a69d07eaf44745fc4ee947f718fca8 Author: Steve Dickson Date: Tue Apr 19 11:04:03 2022 -0400 nfsrahead: get the information from the config file. Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit d8a462e2d21e2e28f0c2c38793c352b46fd6abe3 Author: Steve Dickson Date: Tue Apr 19 11:02:04 2022 -0400 nfsrahead: add logging Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit 15ea4f1090e5ac1f41a3fa43c5e30dfa2611085e Author: Steve Dickson Date: Tue Apr 19 10:58:16 2022 -0400 nfsrahead: only set readahead for nfs devices. Limit setting the readahead for nfs devices. Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit 6011418c3e4e37dd433a6d7560f220d442943f84 Author: Steve Dickson Date: Tue Apr 19 10:47:54 2022 -0400 nfsrahead: configure udev Set the udev rule to call the readahead utility. Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit f86c4c9065786bd9f08c923ff6a55621b9803f9c Author: Steve Dickson Date: Tue Apr 19 10:43:30 2022 -0400 Create the nfsrahead command. Kernel commit c128e575514c ("NFS: Optimise the default readahead size") changed the calculation for NFS readahead from a multiple of rsize to the system default, 128 kiB. This setting has been causing read heavy workloads to underperform by at least 30%, as show below. $ cat /sys/class/bdi/0\:55/read_ahead_kb 128 $ for i in {0..3} ; do dd if=/mnt/testfile.bin of=/dev/null bs=1M 2>&1 \ | grep copied ; echo 3 > /proc/sys/vm/drop_caches ; done 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 17.056 s, 252 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 17.1258 s, 251 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 16.5981 s, 259 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 16.5487 s, 260 MB/s $ echo 15360 > /sys/class/bdi/0\:55/read_ahead_kb $ for i in {0..3} ; do dd if=/mnt/testfile.bin of=/dev/null bs=1M 2>&1 \ | grep copied ; echo 3 > /proc/sys/vm/drop_caches ; done 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 12.3855 s, 347 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.2528 s, 382 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.9849 s, 358 MB/s 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 11.2953 s, 380 MB/s This patch and the following create a tool for automatically setting NFS readahead during the mount, nfsrahead. The tool is invoked from udev when the NFS backing device is created in kernel, and sets the readahead using the sysfs interface. Signed-off-by: Thiago Becker Signed-off-by: Steve Dickson commit 9df1dbe1002c732486532a46705e9b07057df69f Author: Steve Dickson Date: Thu Feb 24 14:02:16 2022 -0500 mountd: Fix potential data corrupter Commit 9c99b463 typecast an uint into a int to fix a Coverity warning. Potentially this could cause a very large rogue value to be negative allow the rouge value to index into a table causing corruption. A check has been added to detect this type of situation. Reported-by: Richard Weinberger Signed-off-by: Steve Dickson commit 7f8463fe702174bd613df9d308cc899af25ae02e Author: Steve Dickson Date: Wed Feb 23 15:19:51 2022 -0500 systemd: Fix format-overflow warning rpc-pipefs-generator.c:35:23: error: '%s' directive output between 0 and 2147483653 bytes may exceed minimum required size of 4095 [-Werror=format-overflow=] 35 | sprintf(path, "%s/%s", dirname, pipefs_unit); | ^ Signed-off-by: Steve Dickson commit 475857723dee84a68b675a56ca0ea2e81c2f626e Author: Anna Schumaker Date: Tue Feb 22 12:28:47 2022 -0500 rpcctl: Add installation to the Makefile And create a shell script that launches the python program from the $(libdir) Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit ddc633fd57caf8a66d4714091a7f31da59afa7f2 Author: Anna Schumaker Date: Tue Feb 22 12:26:38 2022 -0500 rpcctl: Add a man page Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit 3fe73d019ae853f6a3a7d9cefbecb98c26b335bd Author: Anna Schumaker Date: Tue Feb 22 12:24:56 2022 -0500 rpcctl: Add a command for changing xprt state We can set it offline or online, or we can remove an xprt. The kernel only supports removing offlined transports, so we make sure to set the state to "offline" before sending the remove command. Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit 557e9c762fd202d586c1a9bb593b9e7934c31431 Author: Anna Schumaker Date: Tue Feb 22 12:22:46 2022 -0500 rpcctl: Add a command for changing xprt switch dstaddrs This is basically the same as for xprts, but it iterates through all xprts attached to the switch to apply the new address. Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit f10682cb86f0e023b27d632a8f62f8c83ad822bd Author: Anna Schumaker Date: Tue Feb 22 12:21:24 2022 -0500 rpcctl: Add a command for changing xprt dstaddr Using the socket module for dns resolution Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit a56055930bf7bd3c57d1810d22352b68cf40d9ec Author: Anna Schumaker Date: Tue Feb 22 12:16:13 2022 -0500 rpcctl: Add a command for printing rpc client information It's mostly the same information as with xprt-switches, except with rpc-client id prepended to the first line. Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit 4dead766416980066821bda8ff3fc336caaf3f11 Author: Anna Schumaker Date: Tue Feb 22 12:14:43 2022 -0500 rpcctl: Add a command for printing individual xprts This shows more detailed information than what is presented with xprt switches. I take the chance to add a main-export indicator to the small_str() used when printing out xprt-switches. Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit 4c59cc65a4f2dbcb0f5c436fadf7b2b1e63d4783 Author: Anna Schumaker Date: Tue Feb 22 12:13:38 2022 -0500 rpcctl: Add a command for printing xprt switch From: Anna Schumaker This combines the information found in xprt_switch_info with a subset of the information found in each xprt subdirectory Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit f857fbca48ecf9fa5aac797df7393d096e71bb2a Author: Anna Schumaker Date: Tue Feb 22 12:12:15 2022 -0500 rpcctl: Add a rpcctl.py tool This will be used to print and manipulate the sunrpc sysfs directory files. Running without arguments prints both usage information and the location of the sunrpc sysfs directory. Signed-off-by: Anna Schumaker Signed-off-by: Steve Dickson commit 9abd3b4b57155dfdfd6895e6086ef550ee56fc49 Author: Wenchao Hao Date: Tue Feb 22 16:06:51 2022 -0500 idmapd: Fix error status when nfs-idmapd exits nfs-idmapd.service would report following error when stopped: Starting NFSv4 ID-name mapping service... rpc.idmapd[1198]: Setting log level to 0 Started NFSv4 ID-name mapping service. rpc.idmapd[1198]: exiting on signal 15 Stopping NFSv4 ID-name mapping service... nfs-idmapd.service: Main process exited, code=exited, status=1/FAILURE nfs-idmapd.service: Failed with result 'exit-code'. Stopped NFSv4 ID-name mapping service. commit 93e8f092(idmapd: Add graceful exit and resource cleanup) redirected SIGTERM, so when executing "systemctl stop nfs-idmapd", the main() of idmapd would running to tail to return, while it returned 1 which considered as error by systemd. So here just return 0 in main(). Signed-off-by: Wenchao Hao Signed-off-by: Steve Dickson commit 8a8b127d29e38200f244a8b5ad0c7c7769c40402 Author: Richard Weinberger Date: Tue Feb 22 15:59:46 2022 -0500 mount.nfs: Fix Typo auto negotiating code. Commit 14258541 add a check that had a '||' instead of a '&&' which is the typo. The intention of commit 14258541 was to show EBUSY errors but this error is not shown when the mount point does exists (commit afda50fc). In the end, EBUSY are now interrupted correctly in this corner case. Signed-off-by: Steve Dickson Signed-off-by: Steve Dickson commit c547ad481dca5bc0b0a2e365ebcff3439848f664 Author: Rohan Sable Date: Mon Feb 14 11:15:22 2022 -0500 mount.nfs Fix error reporting for already mounted shares When mount is triggered for an already mounted share (using auto negotiation), it displays "mount.nfs: Protocol not supported" or "mount.nfs: access denied by server while mounting" instead of EBUSY. This easily causes confusion if the mount was not tried verbose : Signed-off-by: Rohan Sable Signed-off-by: Yongcheng Yang Signed-off-by: Steve Dickson commit c9c6369451ba032ba7b4044ac0625a77a4e03c17 Author: Ben Hutchings Date: Mon Jan 31 11:49:30 2022 -0500 nfs-utils: tests: Skip test if /dev/log is missing Some build environments don't have a /dev/log, without which the daemons will fail to run. * Add a check_dev_log function to skip a test if it's missing * Call it in t0001-statd-basic-mon-unmon.sh Signed-off-by: Ben Hutchings Signed-off-by: Salvatore Bonaccorso Signed-off-by: Steve Dickson commit f083d3baf27896e895c6936cd0290d363458e501 Author: Ben Hutchings Date: Mon Jan 31 11:47:23 2022 -0500 Manpages: Fix man page syntax errors In idmapd.conf.5, there is a line of what should be literal text beginning with ".", which makes it an (invalid) command. It can be escaped, but then there will be a space before it. Instead, Move it to the previous line and use the .BR macro so there's no space. In idmapd.man, the .I (italic) macro is used. However, this manual page uses the mdoc macro package that does not include it. Use the .Em (emphasis) macro instead. In nfsmount.conf.man, the first line should be a comment but it is actually an invalid command. Fix it to be a comment. Signed-off-by: Ben Hutchings Signed-off-by: Salvatore Bonaccorso Signed-off-by: Steve Dickson commit c8381a0efe17e890ebd892d573f1c3d287526245 Author: Petr Vorel Date: Sat Jan 22 15:02:27 2022 -0500 exportfs: Fix left debug info Patch for 497ffdf8 ('manpage: remove the no longer supported value "vers2"') [1] didn't contain printf in exportfs.c (looks like debugging info) and errno handling in stropts.c (maybe work on other patch) which were applied. Thus removing it. [1] https://lore.kernel.org/linux-nfs/20220117031356.13361-1-yoyang@redhat.com/raw Signed-off-by: Petr Vorel Signed-off-by: Steve Dickson commit 497ffdf8c332f7be9be13b231d328690589272ca Author: Yongcheng Yang Date: Thu Jan 20 11:16:32 2022 -0500 manpage: remove the no longer supported value "vers2" Signed-off-by: Yongcheng Yang Signed-off-by: Steve Dickson