commit 075fd77e57397f6d147f79a9f56938f331e29459 Author: Steve Dickson Date: Wed Nov 13 12:06:40 2019 -0500 mount.nfs: removed extraneous printf from the mount path Signed-off-by: Steve Dickson commit efefa7845601f551820fa17cb0808dbb3c3cc3dd Author: Steve Dickson Date: Wed Nov 13 09:32:00 2019 -0500 junction: Fixed debug statement to compile with -Werror=format=2 flag Signed-off-by: Steve Dickson commit 5a004c161ff6c671f73a92d818a502264367a896 Author: Scott Mayhew Date: Thu Oct 24 14:02:30 2019 -0400 gssd: daemonize earlier daemon_init() calls closeall() which closes all fd's >= 4. This causes rpc.gssd to fail when it's configured to use the gssproxy interposer plugin (via "use-gss-proxy=1" in nfs.conf or GSS_USE_PROXY="yes" in the environment) *and* libtirpc debugging is enabled (i.e. at least one "-r" on the command line): 1. During startup if rpc debugging is enabled then libtirpc_set_debug() is called, which calls openlog() which consumes fd 3. 2. If the gssproxy interposer plugin is enabled then when gssd_check_mechs() is called, a socket is created (fd 4) and connected to /var/lib/gssproxy/default.sock. The fd is stored internally in a struct gpm_ctx. 3. daemon_init() runs and closes all fd's >= 4. 4. event_init() runs which calls epoll_create() which returns an epoll fd of 4. 5. Later when handling an upcall, gssd calls gssd_acquire_krb5_cred() which winds up closing the gpm_ctx->fd which was 4. 6. event_dispatch() calls epoll_wait() with epfd=4, and -EBADF is returned. gssd logs the message ""ERROR: event_dispatch() returned!" and exits. The solution is to call daemon_init() earlier. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit e6d7e9239bd408e7292ec2406314aca77f82cf3d Author: Marcos Paulo de Souza Date: Mon Oct 14 14:18:02 2019 -0400 statd.man: Clarify the --name argument usage From: Marcos Paulo de Souza The man page does not clarifies that the --name argument is only used by the sm-notify command, and statd itself listen to all interfaces. This change makes clear that the --name argument is only passed to sm-notify. Signed-off-by: Marcos Paulo de Souza Signed-off-by: Steve Dickson commit fee2cc29e888f2ced6a76990923aef19d326dc0e Author: NeilBrown Date: Mon Oct 14 14:12:49 2019 -0400 statd: take user-id from /var/lib/nfs/sm Having /var/lib/nfs writeable by statd is not ideal as there are files in there that statd doesn't need to access. After dropping privs, statd and sm-notify only need to access files in the directories sm and sm.bak. So take the uid for these deamons from 'sm'. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit c6fdcbe0a5cfacb84e3b071925f4d0b61df830a4 Author: NeilBrown Date: Mon Oct 14 14:08:27 2019 -0400 conffile: allow optional include files If nfs.conf contains, for example include = /etc/nfs.conf.local and /etc/nfs.conf.local doesn't exist, then a warning is given. Sometimes it is useful to have an optional include file which is included if present, but for which an absence doesn't give a warning. Systemd has a convention that a hyphen at the start of an include file name marks it as optional, so add this convention to nfs-utils. So include = -/etc/nfs.conf.local will not give a warning if the file doesn't exist. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 7fc4d064f9519f13ba6bc778af7cd904ee2dfce7 Author: NeilBrown Date: Mon Oct 14 14:06:03 2019 -0400 mountd: Initialize logging early. Reading the config file can generate log messages, so we should initialize logging before reading the config file. If any log message are generated, syslog will leave a file descriptor open (a socket), so calling closeall(3) after this can cause problem. Before this we initialize login we don't know if Foreground (-F) has been selected, so closeall() cannot be conditional on that. closeall() isn't needed - daemon are almost always run from a management daemon like systemd, and they are given a clean environment. It is really best if they just take what they are given. So remove the closeall() call. Signed-off-by: NeilBrown Signed-off-by: Steve Dickson commit 2159ddfc8d954e220f6b198e322d4193958f8269 Author: Scott Mayhew Date: Fri Sep 20 10:17:47 2019 -0400 nfsdcld: update nfsdcld.man Added some historical information to the notes section, along with some information regarding upgrading and downgrading nfsdcld. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit debd88f27f684887fdce23889a3b2a8dc69b73b2 Author: Scott Mayhew Date: Fri Sep 20 10:16:16 2019 -0400 Add a tool for manipulating the nfsdcld sqlite database schema. The "clddb-tool" is mainly for downgrading the nfsdcld sqlite database schema in the event that an admin wants to downgrade nfsdcld. It also provides options for fixing corrupt table names (note newer versions of nfsdcld take care of this automatically) and for printing the contents of the database. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 51721baf18f95ef150590c01ee5347e173d85748 Author: Scott Mayhew Date: Fri Sep 20 10:11:52 2019 -0400 nfsdcld: add support for upcall version 2 Version 2 upcalls will allow the nfsd to include a hash of the kerberos principal string in the Cld_Create upcall. If present, the hash will be stored along with the client id string in the database, and will be included in the Cld_GraceStart downcall whenever nfsd restarts. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit 6ed3e374bda002f6ed378dc89735093ad2db9c1e Author: Scott Mayhew Date: Fri Sep 20 10:09:38 2019 -0400 nfsdcld: add a "GetVersion" upcall Add a "GetVersion" upcall to allow the kernel to determine the maximum upcall version that nfsdcld supports. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit c5b5374dcf521d9b5e958d1ac45fa275a6066436 Author: Joshua Watt Date: Fri Sep 20 10:04:08 2019 -0400 Add printf format checking Adds a configure time check for __attribute__((format)) and then uses it to enforce checking the format of several printf-like functions. Several invalid uses of format codes that were discovered have now been fixed. V2: Fix use of "%jd" format code on an argument that wasn't intmax_t Signed-off-by: Joshua Watt Signed-off-by: Steve Dickson commit 996e254a9df0446ee441dd713357c448010a3168 Author: Patrick Steinhardt Date: Thu Sep 5 08:02:11 2019 -0400 mountd: Use unsigned for filesystem type magic constants The filesystem type magic constants are all unsigned integers, but we declare them as signed ones. This may cause a compiler warning when comparing our own signed magic constants with the unsigned ones return by statfs64(3). Fix the issue by uniformly usign unsigned types. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit f99c532de679febb9d31d0ecb63ba2c0004eb538 Author: Patrick Steinhardt Date: Thu Sep 5 07:54:50 2019 -0400 nfsd_path: Include missing header for `struct stat` The header "nfsd_path.h" uses `struct stat` in its function signatures, but doesn't include the header. This may cause compiler warnings if a compilation unit includes "nfsd_path.h" while not transitively including . Fix the potential warning by including in the header. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit 38364230aebedd0b6721eda75dff0a170e3ee4b0 Author: Patrick Steinhardt Date: Thu Sep 5 07:53:27 2019 -0400 configure.ac: Add header when checking sizeof(socklen_t) We're checking for various sizes in configure.ac, among them the size of the socklen_t type. If socklen_t's size is not found and thus reported to be zero, we will typedef our own socklen_t as "unsigned int". The check for socklen_t is insufficient, though. While the type is declared via , we only search AC_INCLUDES_DEFAULT for its declaration, which doesn't include . On musl libc, this causes us to not find the declaration and redeclare it with an incompatible type. Fix the issue by searching both the default includes as well as . Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit efc8449f9d3eec62a66568d3b4911fdc042efc48 Author: Patrick Steinhardt Date: Thu Sep 5 07:50:56 2019 -0400 Use header instead of The POSIX standard specifies that poll(3P) should be declared in the header instead of . While there is one location where we use the correct header, two others do not, causing warnings on musl libc systems. Fix the warning by switching from to . As we're already using the latter one already, this change should not cause any problems for other platforms. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit af4d3dd78a4d3393cfec88ac91851af4a9a350b2 Author: Patrick Steinhardt Date: Thu Sep 5 07:48:14 2019 -0400 Use header instead of While most source files already use the standard header instead of , some do not, causing warnings on musl libc systems. Fix the remaining ones to use . As we already use the header unconditionally in a lot of places, this change should not cause any problems for other platforms. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit d0cd0c468146c0b5284bc895a8a9ef4096e5dfee Author: Patrick Steinhardt Date: Thu Sep 5 07:45:10 2019 -0400 Annotate unused fields with UNUSED There are some parameters that may be potentially unused. Add the UNUSED macro to avoid any warnings. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit 0240df0e8ccf7be2706a6a10a2a620f8eda55275 Author: Yongcheng Yang Date: Thu Sep 5 07:36:26 2019 -0400 nfsd: Adjust nfs.conf setting/parsing of rdma port The rpc.nfsd program can use option "--rdma" to enable RDMA on the standard port (nfsrdma/20049) or "--rdma=port" for an alternate port. But now in /etc/nfs.conf, we need to specify the port number (e.g. rdma=nfsrdma) to enable it, which is not convenient. The default setting "rdma=n" may cause more confusion. Update to enable RDMA on standard port when setting boolean YES to "rdma=". And using "rdma-port=" for an alternate port if necessary. Also let previous config (e.g. rdma=nfsrdma) work as well. Signed-off-by: Yongcheng Yang Signed-off-by: Steve Dickson commit d7c5fb33687f5c7418390ecc4135230220e2799e Author: Patrick Steinhardt Date: Mon Aug 26 14:01:13 2019 -0400 tests: add missing include for strerror(3P) The function strerror(3P) is declared in , but it is not included in "statdb_dump.c". Include it to fix compile errors. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit 12700029e246d294bfbd81e6a2193cca317d097d Author: Patrick Steinhardt Date: Mon Aug 26 13:59:33 2019 -0400 nfsdcld: add missing include for PATH_MAX While glibc transitively includes and thus has PATH_MAX available, other libc implementations may not have the transitive include and thus miss the definition. Add an explicit include of to fix compilation with musl libc. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit d55099422a36cb57680618730ac6ea255c9dd8f6 Author: Patrick Steinhardt Date: Mon Aug 26 13:58:03 2019 -0400 mount: fix compilation if __GLIBC__ is not defined As glibc versions before v2.24 couldn't safely include , commit 8af595b7 (mount: support compiling with old glibc, 2017-07-26) introduced some preprocessor checks to special-case such old versions. While there is a check whether __GLIBC__ is defined at all, it only applies to the first comparison `__GLIBC__ < 2`, but doesn't apply to the second check due to operator precedence. Thus the preprocessor may use an undefined value and thus generate an error if __GLIBC__ is not defined. Fix the issue by wrapping the version check in braces. Signed-off-by: Patrick Steinhardt Signed-off-by: Steve Dickson commit 2dcce8eca948487c5306bd43f312e3a5594c8f43 Author: Steve Dickson Date: Mon Aug 26 10:31:25 2019 -0400 nfs-utils: Removed a number of Coverity Scan USE_AFTER_FREE errors Signed-off-by: Steve Dickson commit 9a94f8bb8f1eec22a8ce4deb92c7ce42b5730b66 Author: Steve Dickson Date: Thu Aug 22 09:37:55 2019 -0400 nfs-utils: Removed a number of Coverity Scan RESOURCE_LEAK errors Signed-off-by: Steve Dickson commit 52db5259fe78c2b948df279b697412f99e12f229 Author: Yongcheng Yang Date: Fri Aug 23 14:06:42 2019 -0400 gssd: add configure options verbosity to man page rpc.gssd(8) Signed-off-by: Pierguido Lambri Signed-off-by: Yongcheng Yang Signed-off-by: Steve Dickson commit 018fec63260c4a578356de8ad995362f7e7b4c11 Author: Matt Turner Date: Mon Aug 12 13:32:43 2019 -0400 gssd: Look in lib32 for gss libs aswell. Akin to commit da999b81b058 ("Look in lib64 for gss libs aswell.") mips/n32 systems have libraries in lib32 (but not lib or lib64). Without checking lib32, configure fails with checking for Kerberos v5... configure: error: Kerberos v5 with GSS support not found: consider --disable-gss or --with-krb5= Signed-off-by: Matt Turner Signed-off-by: Steve Dickson commit 2fbc62e2a13fc22b6ae4910e295a2c10fb790486 Author: Zoltan Karcagi Date: Mon Aug 12 13:27:16 2019 -0400 Fix include order between config.h and stat.h At least on Arch linux ARM, the definition of struct stat in stat.h depends on __USE_FILE_OFFSET64. This symbol comes from config.h when defined, therefore config.h must always be included before stat.h. Fix all occurrences where the order is wrong by moving config.h to the top. This fixes the client side error "Stale file handle" when mounting from a server running Arch Linux ARM. Signed-off-by: Zoltan Karcagi Signed-off-by: Steve Dickson commit 8d69d0abcfe31de27c081d243aca8dcaf421ba37 Author: Alice J Mitchell Date: Thu Aug 1 12:18:38 2019 -0400 nfs-server-generator: Fix memory leak on error in nfs-server-generator Fix the trivial memory leak in the error handling of nfs-server-generator Signed-off-by: Alice J Mitchell Signed-off-by: Steve Dickson commit c917e4ba433594b2a80fc90bfcb449e6a32043a9 Author: Dave Wysochanski Date: Thu Aug 1 12:10:29 2019 -0400 mountstats: Fix nfsstat command to handle RPC iostats version >= 1.1 Later kernels with RPC iostats version >= 1.1 have an additional errors count for each op. Lengthen the array of values created inside DeviceData and then in __parse_rpc_line just zero this value out for prior kernels where this count is not present. The count is not used for nfsstat, but this keeps DeviceData consistent with the new count as well as proper functioning of accumulate_iostats. Before this patch, nfsstat will backtrace on a kernel with RPC iostats version >= 1.1 due to the fixed array inside DeviceData. This patch fixes this backtrace and also allows nfsstat to work with these new kernels. Signed-off-by: Dave Wysochanski Signed-off-by: Steve Dickson commit 1af88ff6b4ca272dff6f6b2ee4ba231405dc33d2 Author: Dave Wysochanski Date: Thu Aug 1 12:08:53 2019 -0400 mountstats: Add per-op error counts to iostat command when RPC iostats version >= 1.1 With RPC iostats 1.1 there is a new metric which counts the RPCs completing with errors (tk_status < 0). Add these to the output at the end of the line. This increases the length of an output line to 136 columns from 120, but keeps consistent format and spacing: read: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) avg queue (ms) errors 0.000 0.106 512.316 0 (0.0%) 17.500 17.500 0.000 0 (0.0%) write: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) avg queue (ms) errors 0.001 0.476 512.398 0 (0.0%) 1.667 5.778 3.889 1 (11.1%) Signed-off-by: Dave Wysochanski Signed-off-by: Steve Dickson commit cfa65efa572c6dfc5d174d08a4454ede01acb5a0 Author: Dave Wysochanski Date: Thu Aug 1 12:07:24 2019 -0400 nfsiostat: Add error counts to output when RPC iostats version >= 1.1 With RPC iostats 1.1 there is a new metric which counts the RPCs completing with errors (tk_status < 0). Add these to the output at the end of the line. This increases the length of an output line to 136 columns from 120, but keeps consistent format and spacing: read: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) avg queue (ms) errors 0.000 0.106 512.316 0 (0.0%) 17.500 17.500 0.000 0 (0.0%) write: ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms) avg queue (ms) errors 0.001 0.476 512.398 0 (0.0%) 1.667 5.778 3.889 1 (11.1%) Signed-off-by: Dave Wysochanski Signed-off-by: Steve Dickson commit 2b78802c4eda6f74b77330832c54fd6b59991adf Author: Josef Radinger Date: Wed Jul 24 10:59:51 2019 -0400 nfs.man: Fixed small typo in man page Fixes: https://bugzilla.linux-nfs.org/show_bug.cgi?id=337 Signed-off-by: Steve Dickson commit d72847819569eabe45f2f958b8c09a75156b525f Author: Scott Mayhew Date: Mon Jul 22 08:38:58 2019 -0400 sqlite.c: Add a simple database health check Commit a8133e1fd1742 removed the zero-padding from the table names and broke grace period handling. Add a simple health check for the database to try to detect and fix these. Other checks could be added in the future if the database schema changes. Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson commit f6b956975db32e1c42c031b6891d1802f50c1660 Author: Scott Mayhew Date: Mon Jul 22 08:32:43 2019 -0400 sqlite.c: restore zero-padding to the recovery table names Commit a8133e1fd1742 removed the zero-padding from the table names and broke grace period handling. Running nfsdcld with verbose logging shows messages similar to the following: nfsdcld: cld_gracestart: sending client records to the kernel nfsdcld: sqlite_iterate_recovery: select statement prepare failed: no such table: rec-1b nfsdcld: Doing downcall with status -121 nfsdcld: cld_inotify_cb: called for EV_READ nfsdcld: cld_pipe_open: opening upcall pipe /var/lib/nfs/rpc_pipefs/nfsd/cld nfsdcld: cld_gracedone: grace done. nfsdcld: Unable to drop table for recovery epoch: no such table: rec-1b nfsdcld: Doing downcall with status -121 Fixes: a8133e1fd1742 ("sqlite.c: Use PRIx64 macro to print 64-bit integers") Signed-off-by: Scott Mayhew Signed-off-by: Steve Dickson