summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* mount.nfs: configurable minor version defaultsBenjamin Coddington2015-01-231-43/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update nfsmount.conf to allow minor version specification, and rearrange the autonegotiation logic to agreed upon best behavior. Depending upon the combination of values specified within nfsmount.conf and given to mount.nfs, the retry behavior of mount.nfs varies according to the general rule of defaulting to the most specific setting, with some exceptions. A general guide to the expected behavior follows: ------------------ | nfsmount.conf |----------------------------------- | Defaultvers= | arg option | attempts: | |---------------------------------------------------| | 4.2 | not set | v4.2 v4.1 v4.0 v3 | | 4.2 | v4 | v4.2 v4.1 v4.0 | | 4.1 | not set | v4.1 v4.0 v3 | | 4.1 | v4 | v4.1 v4.0 | | 4 | not set | v4.0 v3 | | 4 | v4 | v4.0 | | 3 | not set | v3 | | any set | v4.2 | v4.2 | | any set | v4.1 | v4.1 | | any set | v4 | v4.0 | | any set | v3 | v3 | | not set | not set | v4.2 v4.1 v4.0 v3 | ----------------------------------------------------- If built with --enable-mountconfig=no, then the behavior is the same as if nfsmount.conf did not set Defaultvers. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsmount.conf: Always parse versionsBenjamin Coddington2015-01-231-34/+0
| | | | | | | | | | | In order to make decisions about which default version to use when only the major version is specified, the nfsmount.conf Defaultvers options should always be parsed, even when a version has already been specified. Remove the check and bypass for parsing the Defaultvers options from nfsmount.conf. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Add struct nfs_version and generalize version parsingBenjamin Coddington2015-01-235-77/+88
| | | | | | | | | | | | | | | | | | The nfs_version needs to carry major, minor, and basic mode information to allow decisions to be made to override, discard, or negotiate various versions. Update nfs_nfs_version() to work against this struct and set the various modes. This change also makes nfs_nfs_version() parse properly for future version number additions. The general rules for version.v_mode are - not set V_DEFAULT - single digit => 4 V_GENERAL - single digit < 4 V_SPECIFIC - decimal included V_SPECIFIC - miss all others V_PARSE_ERR Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: parse options - add helper po_contains_prefixBenjamin Coddington2015-01-232-0/+26
| | | | | | | | | | The version options (v3,v4,v4.2) may increase in the future, but they have a predictable prefix. Add a parse option helper to locate and return these options by prefix so that a future increment of version does not require the addition of strings to a search table. Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: fix a comment typo in parse optionsBenjamin Coddington2015-01-231-1/+1
| | | | | Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: default enable mount config file (nfsmount.conf)Benjamin Coddington2015-01-231-5/+5
| | | | | Signed-off-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: Ensure RPC pipefs is mounted before rpc.idmapd startsChris Mayo2015-01-231-0/+2
| | | | | | | | | rpc.idmapd aborts on start-up if RPC pipefs is not present. Needed if GSS services are not used. Signed-off-by: Chris Mayo <aklhfex@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.idmapd: Add a reference to nfsidmap(8) on the man pageScott Mayhew2015-01-231-1/+12
| | | | | | | | Even though the 'new' idmapper used by the client has been around for several years, a lot of users seem to be unaware of its existence. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* configure: restore checking for authgss_free_private_data in libtirpcYann E. MORIN2015-01-231-0/+6
| | | | | | | | | | | | | Since commit 8534063 (configure: use pkg-config to find libtirpc), we are missing the check for authgss_free_private_data in libtirpc. Restore this check, and adapt so that it works in both the pkg-config case and in the "old code" case. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Chuck Lever <check.lever@oracle.com> Cc: Steve Dickson <SteveD@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* configure:restore the old way of checking for libtirpcYann E. MORIN2015-01-231-2/+34
| | | | | | | | | | | | | | | | | | | | | | Since 8534063 (configure: use pkg-config to find libtirpc), we use pkg-config to check for libtirpc (he!). As reported on the list, some user do not have the libtirpc registered with pkg-config (even though it has been since at least 0.1.8). So, partially restore the old checking code, as it was before 8534063, but adapted to work with the pkg-config check, and also adapted to only use proper macros (AS_IF) instead of shell constructs. Re-introduce that old code in a separate function, so it is easy to get rid of when we only want to support pkg-config in the future (i.e. when virtually all libtirpc versions in the wild have been properly installed). Reported-by: Chuck Lever <check.lever@oracle.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Steve Dickson <SteveD@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* configure: be more laxist on the required libtirpc versionYann E. MORIN2015-01-231-1/+1
| | | | | | | | | | | | | | | Currently, we check for libtirpc >= 0.2.4 with pkg-config, because that is the one version I had to test against. As reported on the list, however, older versions are also supported. Relax the check to not require a version at all, and accept any version of libtirpc. Reported-by: Chuck Lever <check.lever@oracle.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Steve Dickson <SteveD@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.idmap: Use event_initialized() to check if event is initializedSteve Dickson2015-01-231-1/+1
| | | | | | | | Using EVLIST_INIT directly is bound to break. This seems to be a leftover from legacy code. Reported-by: Holger Hoffstatte <holger.hoffstaette@googlemail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* sm-notify: Notify hosts in backgroundSteve Dickson2015-01-151-3/+2
| | | | | | | sm-notify needs to notify hosts in background so the boot will not hang when the notified hosts do not answer. Signed-off-by: Steve Dickson <steved@redhat.com>
* start-statd: Use the canonical to check if systemd is running.Steve Dickson2015-01-151-1/+1
| | | | | | | | | Use the approved way, define in http://www.freedesktop.org/software/systemd/man/sd_booted.html to check if systemd is installed and running Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: Bind the nfs-mountd service to the nfs-server serviceSteve Dickson2015-01-151-2/+1
| | | | | | | | | | | | | | | Use BindsTo, instead of PartOf, to bind the rpc-mountd service to the nfs-server service. Its a much tighter bind than PartOf. The Partof=nfs-utils.service was not needed. One side effect of this tighter bond is when rpc.mountd is stop, that will also bring the nfs server down as well, due to the Requires=nfs-mountd.service in the nfs-server service Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: Bind rpc.idmapd to the nfs-server serviceSteve Dickson2015-01-151-1/+1
| | | | | | | | | Since rpc.idmapd is only used by the nfs server, to do its id mapping, bind the rpc-idmapd service to the nfs-server service so rpc.idmapd will started and stopped with the server. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Updated the mountstats(8) man page.Scott Mayhew2014-12-131-14/+128
| | | | | | | | Added documentation for the iostat and nfsstat sub-commands. Added documentation for all of the options that have recently been added. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Implement the nfsstat sub-commandScott Mayhew2014-12-131-3/+153
| | | | | | | Displays nfssstat-like statistics (client statistics only). Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -R/--raw to mountstats_commandScott Mayhew2014-12-131-4/+43
| | | | | | | | | This option displays the mountstats in raw format (i.e. in the same format as /proc/self/mountstats). It's intended to be used mainly with the -S/--since option. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Allow mountstats_command to take a variable number of mountpointsScott Mayhew2014-12-131-14/+34
| | | | | | | | | Allow the mountstats command to take a variable number of mountpoints (including none, in which case it will print stats for all NFS mountpoints it finds). Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix IndexError in __parse_nfs_lineScott Mayhew2014-12-131-2/+2
| | | | | | | | If __parse_nfs_line is is called on a line that has 'fstype nfsd', it'll raise an IndexError trying to parse a nonexistent statvers entry. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -S/--sinceScott Mayhew2014-12-131-13/+38
| | | | | | | | | | Add support for -S/--since to display the delta between a previous copy of /proc/self/mountstats and the current /proc/self/mountstats file. Can be combined with the -f option to show the statistics between two different points in time. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add support for -f/--fileScott Mayhew2014-12-131-10/+21
| | | | | | | | Add support for the -f/--file option to allow parsing of data from an arbitrary file instead of /proc/self/mountstats. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make print_iostat_summary handle newly appearing mountsScott Mayhew2014-12-131-1/+1
| | | | | Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Make the iostat sub-command output match that of nfs-iostat.pyScott Mayhew2014-12-131-43/+61
| | | | | | | Changes mostly lifted straight from nfs-iostat.py. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Convert existing option parsing to use the argparse moduleScott Mayhew2014-12-131-144/+110
| | | | | | | | | | | | | | Made mountstats, nfsstat, and iostat all subcommands (note that the nfsstat function is still unimplemented here). If no sub-command is given, then the mountstats sub-command will run by default (so any scripts that run older versions of the mountstats command will still work). Also removed the --start and --end options since all they do is throw exceptions. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Refactor compare_iostatsScott Mayhew2014-12-131-6/+19
| | | | | | | | | | Iterate over the newly added counters instead of using repeated assignment statements. Also compute the difference of every counter where it makes sense -- this will allow support for -S/--since to be implemented in the future. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Refactor __parse_nfs_line and __parse_rpc_lineScott Mayhew2014-12-131-69/+23
| | | | | | | | Iterate over the newly added counter lists instead of having a ton of assignment statements. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Add lists of various countersScott Mayhew2014-12-131-0/+168
| | | | | | | | | | The NfsEventCounters and NfsByteCounters were lifted straight from nfs-iostat.py. Also added counters for the xprt line (for udp, tcp, and rdma) as well as for v3 and v4 NFS ops. These will allow for more compact code in a couple of places. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix up NFS event countersScott Mayhew2014-12-131-15/+18
| | | | | | | | | The event counters in the mountstats program aren't in sync with the event counters in the kernel. Removed syncinodes and added vfsupdatepage, vfssetattr, congestionwait, pnfsreads, and pnfswrites. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* configure: use pkg-config to find libtirpcYann E. MORIN2014-12-131-55/+12
| | | | | | | | | | | | | | | | | | | | | | | | Currently, we use a custom function to find libtirpc's headers and libraries. This works fine for shared linking. But for static linking, this forgets to link with -lpthread, which is required by libtirpc. A recent patch was sent to libtirpc to add that missing -lpthread in its Libs.private section of its .pc file. Thus, pkg-config will soon be able to return the appropriate libraries. So, use pkg-config to find libtirpc. And for older libtirpc versions, there is no change in behaviour: we're still missing the -lpthread. But once libtirpc has been fixed, we'll automatically get that missing library for free! Remove the --with-libirpc flag as it is no longer needed: pkg-config will provide us with the -I and -L flags, now. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: added the $BLKMAPDARGS var to the nfs-blkmap serviceSteve Dickson2014-12-131-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* rpcgen: change internal rpcgen to support separate builddirDavid Hardeman2014-12-081-3/+4
| | | | | | | | rpcgen uses absolute paths (based on the input) when generating the output files, thus breaking builds using a separate build directory. Signed-off-by: David Hardeman <david@hardeman.nu> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: fix gssd build flagsDavid Hardeman2014-12-081-2/+2
| | | | | | | | | The tirpc variable is another library to add, not additional flags. I'm guessing the reason this hasn't caused problems is that it only shows up with static libraries. Signed-off-by: David Hardeman <david@hardeman.nu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Include systemd unit files in "dist" and "install".NeilBrown2014-12-073-1/+44
| | | | | | | | | | | | New configure option "--with-systemd" will causes systemd unit files to be installed in /usr/lib/systemd/system. Alternalte a path can be given: --with-systemd=/lib/systemd/system Also, systemd files get included in "make dist" now. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix up issue with "make dist"NeilBrown2014-12-0713-39/+22
| | | | | | | | | | | | | Add mention of new files, remove mention of old files, and cause "make dist" to create something very similar to the current distributions. systemd files are not currently included in "make dist" and some files generated by "rpcgen" are (though they aren't in official distribution). Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfslib: remove now unused FILE helpersTimo Teräs2014-12-072-117/+0
| | | | | | | All access to kernel is now done using file descriptors. Signed-off-by: Timo Ter?s <timo.teras@iki.fi> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsexport: talk to kernel using file descriptors instead of FILETimo Teräs2014-12-071-33/+44
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: talk to kernel using file descriptors instead of FILETimo Teräs2014-12-074-33/+38
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: talk to kernel using file descriptors instead of FILETimo Teräs2014-12-071-160/+183
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Add string.h to source files that need itTimo Teräs2014-12-075-0/+5
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Sort RPC statistics by operation countChuck Lever2014-12-061-11/+14
| | | | | | | | | Sort the RPC statistics in descending order by operation count, so that the most frequently executed operation appears at the top of the listing (a la `top`). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: warn when really nothing is exportedPavel Raiskup2014-12-033-23/+21
| | | | | | | | | | | | Throw 'No file systems exported!' iff no volume is exported rather then if some exports file is empty. Typically this can happen if the default /etc/exports file is empty and admin installed configuration into /etc/exports.d directory. This is follow-up for e725def62c73b4 commit. Signed-off-by: Pavel Raiskup <praiskup@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcltrack: use sqlite3_errmsg instead of sqlite3_errstrJeff Layton2014-11-171-6/+6
| | | | | | | | | sqlite3_errstr was only added in v3.7.15 of libsqlite3, which makes it difficult to build against earlier releases. Switch the code over to use sqlite3_errmsg instead. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcltrack: use sqlite3_close instead of sqlite3_close_v2Jeff Layton2014-11-171-1/+1
| | | | | | | | | | | | | | sqlite3_close_v2 wasn't added until v3.7.14 of libsqlite3 so this causes the build to fail vs. very old sqlite3 libs. Also, Chuck points out that the documentation says that sqlite3_close_v2 is intended for use with host languages that are garbage collected, and C isn't. In practice, we shouldn't ever see sqlite3_close return SQLITE_BUSY here anyway since the program is single-threaded, so sqlite3_close should be fine. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Do not fail on empty exports file.Steve Dickson2014-11-173-9/+16
| | | | | | | | | | Commit 076dd80 introduced a regression that causes exportfs to fail when there is an empty /etc/exports file. A empty /etc/exports file is valid and should not cause exportfs to fail. Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountstats: Fix spurious I/O errorsChuck Lever2014-11-171-0/+4
| | | | | | | | | | | | | | | | | When running mountstats under "watch," occassionally the output shows "close failed in file object desctructor: sys.excepthook is missing" and the data display is messed up. This seems to be a common problem when Python script output is piped to another program. Ensure stdout/stderr is completely flushed before mountstats exits, and add an IOError exception handler to catch these exceptions gracefully. Solution suggested by: http://bugs.python.org/issue11380 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.mountd: set libtirpc nonblocking mode to avoid DOSBodo Stroesser2014-11-121-0/+17
| | | | | | | | | | | | | | | This patch is experimental. In works fine in that it removes the vulnerability against a DOS attack. rpc.mountd can be blocked by a bad client, that sends many RPC requests but never reads the responses. This might happen intentionally or caused by a wrong network config (MTU). The patch switches on the nonblocking mode of libtirpc. In that mode writes can block for a max of 2 seconds. Attackers are forced to send requests slower, as libtirpc will close a connection if it finds two requests to read at the same time. Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.mountd: set nonblocking mode with libtirpcBodo Stroesser2014-11-121-0/+7
| | | | | | | | | | | | If mountd is built with libtirpc the tcp listeners and the sockets waiting for UDP messages are not in non-blocking mode. Thus if running with multiple threads (-t XX), all threads will wake up from select on a connection request or a UDP message, but only one thread will succeed. All others will wait on accept() or read() for the next event. Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.mountd: set nonblocking mode if no libtirpcBodo Stroesser2014-11-123-33/+36
| | | | | | | | | | | | | If mountd is built without libtirpc and it is started using "-p XXX" option, the tcp listeners and the sockets waiting for UDP messages are not in non-blocking mode. Thus if running with multiple threads (-t XX), all threads will wake up from select on a connection request or a UDP message, but only one thread will succeed. All others will wait on accept() or read() for the next event. Reviewed-by: NeilBrown <neilb@suse.de> Signed-off-by: Bodo Stroesser <bstroesser@ts.fujitsu.com> Signed-off-by: Steve Dickson <steved@redhat.com>