summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* nfs-utils: fix default value for --enable-tirpcJeff Layton2010-11-011-1/+1
| | | | | | | | | | | | | We need $enable_tirpc to be a tristate. 'yes' means that someone explicitly requested building with tirpc. 'no' means that it was explicitly disabled. Anything else means that no one specified a value. Fix it by setting the value to a blank string so that the default is properly undefined. Reported-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Updated rpc.mountd man pageSteve Dickson2010-10-201-3/+3
| | | | | | | | Updated the rpc.mountd man page to no longer reference v3 as the "newer" version and also mentioned v4 as a supported version. Signed-off-by: Steve Dickson <steved@redhat.com>
* Cleared up the sync option in exportfs man pageSteve Dickson2010-10-201-1/+3
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Removed duplicate entries in export man pageSteve Dickson2010-10-151-14/+0
| | | | | | | The man page's paragraphs about "refer=" and "replicas=" each appear twice. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Clear mountd registrations at start upChuck Lever2010-10-141-6/+4
| | | | | | | | Clear stale MNT registrations before mountd tries to create fresh listeners, to ensure that mountd starts. This is also what statd does. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* behavior as file systems that use the monolithic /sbin/mount command.Chuck Lever2010-10-142-2/+6
| | | | | | | | | | | | | | | | | See the MS_NOMTAB macro in utils-linux-ng/mount/mount.c. Note that mount(8) has MS_USERS and MS_USER in the "nomtab" category as well, but mount.nfs needs to record those values so that unmounting a user-mounted NFS file system can work. While we're here, fix some white space damage in fix_opts_string(). This is a partial fix for: https://bugzilla.linux-nfs.org/show_bug.cgi?id=188 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* umount.nfs: Distinguish between nfs4 and nfs mountsChuck Lever2010-10-141-7/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Neil Brown reports that umount.nfs is still confused by "-t nfs -o vers=4" mounts. /etc/mtab can be confused. /proc/mounts is authoritative on the fstype of a mount. Have umount.nfs consult it to determine which mechanism to use for unmounting. The code to read /proc/mounts was lifted from the nfsstat command. The code introduced by this patch may look like belt-n-suspenders, but we have two use cases to consider: 1. Old kernels don't support the "vers=4" mount option, so umount.nfs must look for the "nfs4" fstype 2. Upcoming kernels may eliminate support the "nfs4" fstype, so umount.nfs must look for the "vers=4" mount option Thus this logic checks for "nfs4" first then looks for the NFS version setting. Note that we could handle unmounting entirely in the kernel, but that won't help older kernels that have this issue. See: https://bugzilla.linux-nfs.org/show_bug.cgi?id=189 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: mountproto does not support RDMAChuck Lever2010-10-141-1/+5
| | | | | | | | | | | Clean up. Our client does not support the MNT protocol on RDMA. nfs_mount_protocol() isn't invoked for RDMA mounts (they are shunted off before nfs_options2pmap() is invoked). But in case it ever is, it should return the expected response. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gcc complained:NeilBrown2010-10-141-0/+1
| | | | | | | | | | | | | | | | | client.c: In function 'init_netmask6': client.c:181:1: warning: no return statement in function returning non-void and Suse' build system complained I: Program returns random data in a function E: nfs-utils no-return-in-nonvoid-function client.c:181 when I built without --enable-ipv6 Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warnings in utils/mount/network.cChuck Lever2010-10-141-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up. network.c: In function get_socket: network.c:431: warning: dereferencing type-punned pointer might break strict-aliasing rules network.c: In function probe_bothports: network.c:759: warning: dereferencing type-punned pointer might break strict-aliasing rules network.c:762: warning: dereferencing type-punned pointer might break strict-aliasing rules network.c: In function nfs_probe_statd: network.c:775: warning: dereferencing type-punned pointer might break strict-aliasing rules network.c: In function nfs_call_umount: network.c:904: warning: dereferencing type-punned pointer might break strict-aliasing rules network.c: In function nfs_ca_sockname: network.c:1106: warning: dereferencing type-punned pointer might break strict-aliasing rules network.c:1112: warning: dereferencing type-punned pointer might break strict-aliasing rules Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warning in utils/mount/parse_opt.cChuck Lever2010-10-141-1/+1
| | | | | | | | | | | | parse_opt.c: In function po_rightmost: parse_opt.c:517: warning: conversion to int from unsigned int may change the sign of the result "i" contains the function's result value, so it should be defined as the same type as the function's return type. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warning in utils/mount/nfsumount.cChuck Lever2010-10-141-4/+4
| | | | | | | | | | | | Clean up. nfsumount.c:374: warning: ISO C forbids omitting the middle term of a ?: expression This is also probably harmless, but let's make the code unambiguous. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warning in utils/mount/nfsumount.cChuck Lever2010-10-141-0/+1
| | | | | | | | | | | | Clean up. nfsumount.c:265: warning: no previous prototype for nfsumount It's also a good idea if the compiler can ensure that the prototype in nfsmount.h matches the actual function defined in nfsumount.c. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warnings in utils/mount/mount.cChuck Lever2010-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Clean up. mount.c: In function parse_opt: mount.c:354: warning: conversion to size_t from int may change the sign of the result mount.c:354: warning: conversion to int from size_t may change the sign of the result mount.c:359: warning: conversion to size_t from int may change the sign of the result mount.c:359: warning: conversion to int from size_t may change the sign of the result mount.c: In function parse_opts: mount.c:374: warning: conversion to int from size_t may change the sign of the result mount.c:377: warning: conversion to size_t from int may change the sign of the result Character string lengths are usually size_t anyway. We can easily avoid the implicit type cast here. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warning in utils/mount/mount.cChuck Lever2010-10-141-1/+1
| | | | | | | | | | | | | Clean up. mount.c: At top level: mount.c:324: warning: no previous prototype for ?mount_usage? mount_usage() has no callers outside of utils/mount/mount.c and no prototype is provided in a header file. Make it static. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warnings in utils/mount/version.hChuck Lever2010-10-141-3/+3
| | | | | | | | | | | | | | | | Clean up. In file included from mount.c:50: version.h: In function linux_version_code: version.h:48: warning: conversion to unsigned int from int may change the sign of the result version.h:48: warning: conversion to unsigned int from int may change the sign of the result version.h:48: warning: conversion to unsigned int from int may change the sign of the result Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warning in utils/mount/mount.cChuck Lever2010-10-141-10/+11
| | | | | | | | | | | | | | | | Clean up. In file included from mount.c:41: mount_config.h:35: warning: no previous prototype for mount_config_opts Functions defined in include files are usually declared as "static inline," eliminating the need for a forward declaration. While I was there, I also fixed the macro that prevents including mount_config.h multiple times, and fixed some white space damage. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: Eliminate compiler warningsChuck Lever2010-10-141-13/+16
| | | | | | | | | | | | | | | | | | | | Clean up. fstab.c: In function ?lock_mtab?: fstab.c:385: warning: declaration of ?errsv? shadows a previous local fstab.c:367: warning: shadowed declaration is here fstab.c:407: warning: declaration of ?errsv? shadows a previous local fstab.c:367: warning: shadowed declaration is here fstab.c:417: warning: declaration of ?tries? shadows a previous local fstab.c:325: warning: shadowed declaration is here fstab.c:422: warning: declaration of ?errsv? shadows a previous local fstab.c:367: warning: shadowed declaration is here These are probably harmless. Reusing a variable name, however, is a little confusing to follow when reading the code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* export: Ensure that we free struct exportent->e_uuidTrond Myklebust2010-10-142-0/+3
| | | | | | | | | | | | | | | | | | Currently, the exportent->e_uuid is initialised in support/nfs/exports.c:parseopts(), but it is never freed. Also ensure that exportent->e_uuid is duplicated correctly in dupexportent(). Adjusted to account for the new export_free() helper. Also, e_uuid points to memory that is always allocated with strdup(3), not with xstrdup(). Thus it must be freed via free(3) and not via xfree(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libnfs.a: Allow multiple RPC listeners to share listener port numberChuck Lever2010-10-141-6/+246
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, when "-p" is not specified on the mountd command line, the TI-RPC library chooses random port numbers for each listener. If a port number _is_ specified on the command line, all the listeners will get the same port number, so SO_REUSEADDR needs to be set on each socket. Thus we can't let TI-RPC create the listener sockets for us in this case; we must create them ourselves and then set SO_REUSEADDR (and other socket options) by hand. Different versions of the same RPC program have to share the same listener and SVCXPRT, so we have to cache xprts we create, and re-use them when additional requests for registration come from the application. Though it doesn't look like it, this fix was "copied" from the legacy rpc_init() function. It's more complicated for TI-RPC, of course, since a TI-RPC application can set up listeners with a nearly arbitrary number of address families and socket types, not just the two listeners that legacy RPC applications can set up (one for AF_INET UDP and one for AF_INET TCP). See: https://bugzilla.linux-nfs.org/show_bug.cgi?id=190 Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Fixed typo in NFS man pageSteve Dickson2010-10-131-1/+1
| | | | | | | | Chuck pointed out there was a grammar typo in addition to the spelling typo. Here is a revised version of the patch. Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix style nits in atomicio.cSteve Dickson2010-10-131-16/+6
| | | | | Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Move common code into supportSteve Dickson2010-10-137-9/+7
| | | | | | | | | | There are several source files and headers present in the ./utils/idmapd directory which are also usable in a doimapd daemon. Because of this we move that support into the support directory such that it can be shared by both daemons. Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* The kernel 2.6.37 has a add new mount option: local_lock.Suresh Jayaraman2010-09-291-0/+44
| | | | | | | Document the new option in the nfs(5) man page. Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Revert "nfs-iostat.py: don't wait for an extra interval when given a count"Steve Dickson2010-09-281-2/+1
| | | | This reverts commit 837796686ad8f9178c7b6855ada728a53ae511e3.
* Release 1.2.3Steve Dickson2010-09-282-3006/+1745
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added the -p <principal> flag to the svcgssd manpageEberhard Kuemmerle2010-09-281-2/+4
| | | | | Signed-off-by: Eberhard Kuemmerle <E.Kuemmerle@fz-juelich.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* svcgssd: Adding a <-p principal> flagEberhard Kuemmerle2010-09-284-12/+23
| | | | | | | | | Allow the principal that is used to get the machines creds definable on the command like with the new '-p <principal>'. This is useful in cluster environments. Signed-off-by: Eberhard Kuemmerle <E.Kuemmerle@fz-juelich.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-iostat.py: don't wait for an extra interval when given a countDavid Lecorfe2010-09-271-1/+2
| | | | | | | | | | | | If I invoke the tool with an interval of 10 and a count of 2, it will: - show the summary - sleep 10s - show the stats for the last 10s - sleep 10s - exit Signed-off-by: David Lecorfe <dlecorfec@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: Enable IPv6 support in rpc.nfsd again.Chuck Lever2010-09-272-18/+0
| | | | | | | | Revert commit b2a3cd59 so that rpc.nfsd can create IPv6 listener sockets for the kernel. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Update mountd/exportfs man pages to reflect IPv6 changesChuck Lever2010-09-273-261/+354
| | | | | | | | | | | | Document IPv6 support in rpc.mountd and exportfs, and clarify existing language in the man page. Clean up: Use bold consistently for program names, and italics consistently for file names. Use "rpc.mountd" consistently as the name of the mountd daemon. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Use MNT status values instead of NFSERRChuck Lever2010-09-271-11/+11
| | | | | | | | | Clean up: The MNT protocol has its own enum type defining error status values. While the values can be the same as the NFSERR enum type on some systems, it's not guaranteed to be true everywhere. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Fix up version and usage messagesChuck Lever2010-09-271-16/+22
| | | | | | | | | Clean up: rpc.mountd is no longer known as kmountd. Use the program's basename rather than the full pathname for the usage message. Display a version message at start up similar to statd's. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Unregister mountd if my_svc_run() returnsChuck Lever2010-09-271-1/+2
| | | | | | | | | | | Fix a long standing bug: when my_svc_run() returns, mountd should unregister itself with the local rpcbind so that it can subsequently start cleanly. Log a more helpful error message in this case. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Support TI-RPC mountd listenerChuck Lever2010-09-271-9/+17
| | | | | | | | | | | If TI-RPC is available, use it to create mountd's svc listener. If not, use the old function, rpc_init(), to create mountd's listener. IPv6 can be supported if TI-RPC is available. In this case, /etc/netconfig is searched to determine which transports to advertise. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Make NFS version checks more strictChuck Lever2010-09-271-8/+39
| | | | | | | | Ensure users and programmers specify NFS version numbers correctly. This also makes the next patch more clean. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Fix source code character encodingChuck Lever2010-09-274-4/+4
| | | | | | | | | | | | | Minor clean up. Most modern Linux distributions set UTF-8 locales. Standardize the character encoding of source files on UTF-8, to squelch vim com- plaints. I probably missed a few spots. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libnfs.a: Remove support/nfs/fstab.cSteve Dickson2010-09-271-554/+0
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* rpc.nfsd: mount up nfsdfs is it doesn't appear to be mounted yetJeff Layton2010-09-163-3/+53
| | | | | | | | | | | | | | | | | | | | | | | | | There's a bit of a chicken and egg problem when nfsd is run the first time. On Fedora/RHEL at least, /proc/fs/nfsd is mounted up whenever nfsd is plugged in via a modprobe.conf "install" directive. If someone runs rpc.nfsd without plugging in nfsd.ko first, /proc/fs/nfsd won't be mounted and rpc.nfsd will end up using the legacy nfsctl interface. After that, nfsd will be plugged in and subsequent rpc.nfsd invocations will use that instead. This is a problem as some nfsd command-line options are ignored when the legacy interface is used. It'll also be a problem for people who want IPv6 enabled servers. The upshot is that we really don't want to use the legacy interface unless there is no other option. To avoid this situation, have rpc.nfsd check to see if the "threads" file is already present. If it's not, then make an attempt to mount /proc/fs/nfsd. This is a "best-effort" sort of thing, however so we just ignore the return code from the mount attempt and fall back to using nfsctl() if it fails. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* libexport.a: Enable IPv6 support in hostname.cChuck Lever2010-09-161-16/+15
| | | | | | | | | | | | If --enable-ipv6 is specified when building nfs-utils, libexport's host_foo() helpers can now return both IPv4 and IPv6 addresses. This means IPv6 presentation addresses and IPv6 DNS resolution results are handled properly in the mountd cache and /etc/exports, but does not yet enable IPv6 mountd listeners. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Ensure cache downcall can handle IPv6 addressesChuck Lever2010-09-161-1/+1
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Handle IPv6 addresses in kernel auth_unix_ip upcallsChuck Lever2010-09-161-3/+3
| | | | | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: clean up cache APIChuck Lever2010-09-163-14/+43
| | | | | | | | | | | | | | | | | | | | | | | Clean up: Squelch compiler warnings and document public parts of cache API. cache.c: At top level: cache.c:67: warning: no previous prototype for auth_unix_ip cache.c:123: warning: no previous prototype for auth_unix_gid cache.c:217: warning: no previous prototype for get_uuid cache.c:247: warning: no previous prototype for uuid_by_path cache.c:326: warning: no previous prototype for nfsd_fh cache.c:745: warning: no previous prototype for nfsd_export cache.c:820: warning: no previous prototype for cache_open cache.c:832: warning: no previous prototype for cache_set_fd cache.c:841: warning: no previous prototype for cache_process_req cache.c:921: warning: no previous prototype for cache_export cache.c:953: warning: no previous prototype for cache_get_filehandle Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Enable IPv6 support in matchhostname()Chuck Lever2010-09-161-21/+2
| | | | | | | | | | | | To gain IPv6 support in matchhostname(), simply replace the socket address comparison helpers with the generic versions that can handle IPv4 and IPv6. host_addrinfo() (called by matchhostname()) returns IPv6 addresses only if IPv6 support is enabled. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Support IPv6 in mountlist_list()Chuck Lever2010-09-161-7/+9
| | | | | | | | | | | Replace inet_aton(3) and gethostbyaddr(3) calls in mountlist_list() with calls to the new host_foo() DNS helpers. The new functions will support IPv6 without additional changes, once IPv6 is enabled in the generic hostname helpers. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Handle memory exhaustion in mountlist_list()Chuck Lever2010-09-161-8/+24
| | | | | | | | | | | | I'm about to replace inet_aton(3)/gethostbyaddr(3) with host_pton()/host_canonname() in mountlist_list(). Since host_canonname() returns a string allocated with strdup(3) instead of xstrdup(), mountlist_list() must now deal with memory exhaustion properly. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Add mountlist_freeall()Chuck Lever2010-09-161-6/+13
| | | | | | | | I'm about to add a second bit of logic that needs to free all mountlist records, so introduce a helper for freeing them. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: support IPv6 in mountlist_del_all()Chuck Lever2010-09-163-9/+7
| | | | | | | | Replace IPv4-specific code in the mountlist_del_all() path with code that is address family agnostic. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Support IPv6 in mountd's svc routinesChuck Lever2010-09-161-20/+59
| | | | | | | | | | | | | | Replace IPv4-specific code with use of our generic hostname helpers in the routines that handle incoming MNT RPC requests. These functions will support IPv6 without additional changes, once IPv6 is enabled in the generic hostname helpers. As part of this update, I've modified all of mountd's _svc routines to use a debug message format that is consistent with statd. It may be overkill for some of these; if so we can pull them out later. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: add IPv6 support in auth_authenticate()Chuck Lever2010-09-164-35/+39
| | | | | | | Make the entire auth_authenticate() code path address-family agnostic. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>