summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* exportfs: fix test of NULL pointer in host_pton()Natanael Copa2014-09-151-5/+7
| | | | | | | | This fixes the problem reported in: https://bugzilla.redhat.com/show_bug.cgi?id=1083018 Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Include libgen.h for basenameNatanael Copa2014-09-155-0/+5
| | | | | | | | | | According POSIX basename(3) should have an #include <libgen.h> There are a different GNU implementation too, that can be used with _GNU_SOURCE, but the POSIX version is good enough and more portable. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: Only work around glibc bugs on glibcNatanael Copa2014-09-151-1/+1
| | | | | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Allow usage of getrpcbynumber() when getrpcbynumber_r() is unavailableNatanael Copa2014-09-152-8/+13
| | | | | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsstat: replace the legacy SA_ONESHOT with standard SA_RESETHANDNatanael Copa2014-09-151-1/+1
| | | | | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: use standard dev_t instead of glibc internalsNatanael Copa2014-09-151-1/+1
| | | | | | | | The __dev_t is a GNU libc internal. Use the standard dev_t instead, which is specified in POSIX. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* replace __attribute_malloc__ with the more portable __attribute__((__malloc__))Natanael Copa2014-09-156-21/+21
| | | | | Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* configure.ac: enable GNU_SOURCE for stat64/statfs64Natanael Copa2014-09-151-0/+1
| | | | | | | | | | Use AC_USE_SYSTEM_EXTENSIONS to enable GNU_SOURCE, which is needed for: - stat64 in utils/exportfs/exportfs.c - statfs64 in utils/mountd/cache.c Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix header include for definition of NULLNatanael Copa2014-09-151-0/+1
| | | | | | | NULL is defined in stdlib.h so we need to include that. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* conffile: use standard uint*_t and unsigned charNatanael Copa2014-09-152-8/+9
| | | | | | | Use the standard integer types. This fixes compiling errors with musl libc. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: taught exportfs -v about the nordirplus optionSteve Dickson2014-08-241-0/+2
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-utils: Allow turning off nfsv3 readdir_plusRajesh Ghanekar2014-08-203-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | One of our customer's application only needs file names, not file attributes. With directories having 10K+ inodes (assuming buffer cache has directory blocks cached having file names, but inode cache is limited and hence need eviction of older cached inodes), older inodes are evicted periodically. So if they keep on doing readdir(2) from NSF client on multiple directories, some directory's files are periodically removed from inode cache and hence new readdir(2) on same directory requires disk access to bring back inodes again to inode cache. As READDIRPLUS request fetches attributes also, doing getattr on each file on server, it causes unnecessary disk accesses. If READDIRPLUS on NFS client is returned with -ENOTSUPP, NFS client uses READDIR request which just gets the names of the files in a directory, not attributes, hence avoiding disk accesses on server. There's already a corresponding client-side mount option, but an export option reduces the need for configuration across multiple clients. This flag affects NFSv3 only. If it turns out it's needed for NFSv4 as well then we may have to figure out how to extend the behavior to NFSv4, but it's not currently obvious how to do that. Signed-off-by: Rajesh Ghanekar <rajesh_ghanekar@symantec.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* start-statd: clean up output when systemd is not installedMike Frysinger2014-08-191-5/+9
| | | | | | | | | | | | If you don't have systemd, then this script dumps: /usr/sbin/start-statd: line 8: systemctl: command not found This isn't terribly useful since we ultimately fall back to running the daemon ourselves, so probe for systemd's existence before we try to use it. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: select non-conventional principalJurjen Bokma2014-08-181-6/+19
| | | | | | | | | | | | | | | | This enable kerberized NFS mounts to succeed even if the principal is not <HOSTNAME>$. It works by reading another principal name from the [appdefaults] section of krb5.conf: [appdefaults] nfs = { ad_principal_name = 129.125.39.115$ } Signed-off-by: Jurjen Bokma <j.bokma@rug.nl> Signed-off-by: Steve Dickson <steved@redhat.com>
* blkmapd: dump useful device information to syslogChristoph Hellwig2014-08-133-1/+11
| | | | | | | | Dump some information about used devices to syslog so that an admin can troubleshoot failing blocklayout mounts. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* blkmapd: fix broken multipath handlingChristoph Hellwig2014-08-131-23/+4
| | | | | | | | | | | | | | | | | We do want to use the dm-multipath device if it exists, which the code is generally prepared for, except that this check excludes them early. In addition this will also add the passive path to the device list, which is harmless if an active one exists as that or the multipath device will be preferred, and at least allows us to work if it doesn't. Also fix up the check if an path needs to be updated to remove the silly partition check - pNFS block offset are relative to the device so partion should never match it instead of the full device. On the other hand the simplistic check easily creates false positives, e.g. dm-10 is considered a partition of dm-1. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* Fix Python 3 compatibility of mountstats and nfs-iostatSlavek Kabrda2014-07-252-2/+3
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: configurable connection timeout for the rpcgssd serviceRinku Kothiya2014-07-254-2/+19
| | | | | | | | | | | | | | | | | | | When using rpc.gssd to secure NFSv3 FS using krb5, the following errors can happen as a result of network congestion. "rpc.gssd WARNING: can't create tcp rpc_clnt to server ... : RPC: Remote system error - Connection timed out" we had a successful reproducer of the problem which we tested using this patch by starting rpc.gssd with "-T 60" as the option which solved the problem. reproducer steps were to throttle the network using tc command and then in a never ending loop mount the share, then write some data in the file on the share and unmount it. keep a delay of 5 sec between the iteration of each loop. CC: Christian Horn <chorn@redhat.com> Signed-off-by: Rinku Kothiya <rkothiya@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Fixed errno typo in get_servername()Steve Dickson2014-07-251-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Error out when rpc_pipefs directory is emptySteve Dickson2014-07-091-3/+8
| | | | | | | | | | | When there is no kernel modules loaded the rpc_pipefs directory is empty, which cause rpc.gssd to silently exit. This patch adds a check to see if the topdirs_list is empty. If so error out without dropping a core. Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd.man: Added missing arguments in man pageJianhong Yin2014-06-171-6/+6
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: add support for case-insensitive file namesSteve Dickson2014-06-172-3/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Case insensitive filesystems support textually distinct names for the same directory. i.e. you can access it with a name other than the canonical name. For example if you mkdir /mnt/export then add /mnt/EXPORT to /etc/exports, and on a client mount server:/mnt/EXPORT /import then the mount will work, but if the kernel on the server needs to refresh the export information, it will ask about "/mnt/export", which is not listed in /etc/exports and so will fail. To fix this we need mountd to perform case-insensitive name comparisons, but only when the filesystem would, and in exactly the same way that the filesystem would. So, when comparing paths for equality first try some simple heuristics which will not be fooled by case and then ask the kernel if they are the same. By preference we use name_to_handle_at() as it reports the mntid which can distinguish between bind mounts. If that is not available, use lstat() and compare rdev and ino. Acked-by: J. Bruce Fields <bfields@fieldses.org> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: fixed the --with-statdpath= flagSteve Dickson2014-06-171-5/+5
| | | | | | | | Create the given path set with --with-statdpath Signed-off-by: chendt.fnst@cn.fujitsu.com Reported-by: yaoxp@cn.fujitsu.com Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsiostat: Document the output columns in the manpageJan Chaloupka2014-06-171-0/+55
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: Fix allocated buffer size for the scraped acceptor name in do_downcallVeli-Matti Lintu2014-06-011-1/+1
| | | | | | | | | | In commit 51fda07a "gssd: scrape the acceptor name out of the context" the allocated buffer size is not large enough to hold the actual data that is written to the buffer. This fixes the allocated buffer size. Reviewed-by: Jeff Layton <jlayton@poochiereds.net> Signed-off-by: Veli-Matti Lintu <veli-matti.lintu@opinsys.fi> Signed-off-by: Steve Dickson <steved@redhat.com>
* statd: Adding callback on sm_notifyRong Zeng2014-06-012-9/+25
| | | | | | | | | | | | | | | | | This patch adds a callback for incoming sm_notify to better handle stale lock issue in client crash recovery in HA-NFS environment 1. "sm-notify" - callout name 2. monitored client name as in the SM_NOTIFY request 3. IP of the sender of the SM_NOITFY request. 4. state value in the SM_NOTIFY request This new interface can be used by different HA-NFS product in its specific configuration and environment to recover from the client crash and stale lock scenarios. Signed-off-by: Rong Zeng <rongzeng@us.ibm.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mount.nfs: print more useful error messageKinglong Mee2014-06-011-2/+6
| | | | | | | | | | | | | | | | When mounting spec of a regular file, mount.nfs print error message as, mount.nfs: mount point /mnt is not a directory mount.nfs: mount point /mnt/testfile is not a directory This patch lets mount.nfs print more useful message, mount.nfs: mount spec 127.0.0.1:/root/testfile or point /mnt is not a directory mount.nfs: mount point /mnt/testfile is not a directory Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* mountd: fix segfault in add_name with newer gcc compilersJeff Layton2014-05-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I hit a segfault in add_name with a mountd built with gcc-4.9.0. Some NULL pointer checks got reordered such that a pointer was dereferenced before checking to see whether it was NULL. The problem was due to nfs-utils relying on undefined behavior, which tricked gcc into assuming that the pointer would never be NULL. At first I assumed that this was a compiler bug, but Jakub Jelinek and Jeff Law pointed out: "If old is NULL, then: strncpy(new, old, cp-old); is undefined behavior (even when cp == old == NULL in that case), therefore gcc assumes that old is never NULL, as otherwise it would be invalid. Just guard strncpy(new, old, cp-old); new[cp-old] = 0; with if (old) { ... }." This patch does that. If old is NULL though, then we still need to ensure that new is NULL terminated, lest the subsequent strcats walk off the end of it. Cc: Jeff Law <law@redhat.com> Cc: Jakub Jelinek <jakub@redhat.com> Signed-off-by: Jeff Layton <jlayton@poochiereds.net> Signed-off-by: Steve Dickson <steved@redhat.com>
* start-statd: rpc.statd's systemd unit changed names.Steve Dickson2014-05-011-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdctltrack: ensure binary is installed in /sbinNeilBrown2014-04-301-0/+4
| | | | | | | | | The kernel "knows" this lives in /sbin, so just like mount.nfs and osd_login, it must unconditionally be installed there. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsd: Remove some warnings nfsd.cSteve Dickson2014-04-301-1/+1
| | | | | | | | | nfsd.c:347:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] nfsd.c:385:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: scrape the acceptor name out of the contextJeff Layton2014-04-301-10/+27
| | | | | | | | | | ...and pass it to the kernel in the downcall. Legacy kernels will just ignore the extra data, but with a proposed kernel patch the kernel will grab this info and use it to verify requests on the v4.0 callback channel. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: explicitly set lifetime_rec to 0 when gss_inquire_context failsJeff Layton2014-04-301-3/+4
| | | | | | | | | | Contrary to the comment here, the lifetime_rec is not necessarily set to zero on failure. That's only guaranteed to be the case if the context has expired. Cc: Andy Adamson <androsadamson@gmail.com> Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: add new routine for generating a hostbased principal in a gss_buffer_tJeff Layton2014-04-302-0/+17
| | | | | | | We'll need a gss_buffer_t to pass to the downcall marshalling code. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: move hostbased name routines into separate fileJeff Layton2014-04-304-65/+160
| | | | | | | | In a later patch, we'll need gssd to call into this code as well as svcgssd. Move it into a common file that both can link in. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: make do_downcall a void returnJeff Layton2014-04-301-3/+3
| | | | | | | ...since its return code is ignored anyway. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* gssd: handle malloc failure appropriately in do_downcallJeff Layton2014-04-301-2/+5
| | | | | | | ...and get rid of some pointless NULL ptr checks. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-iostat: Fix attribute cache statisticsChuck Lever2014-04-301-20/+8
| | | | | | | | "nfs-iostat.py --attr" was displaying nonsense (like negative counts and percentages). Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs-iostat: Fix columnarization of RPC statisticsChuck Lever2014-04-301-12/+19
| | | | | | Note: format() is new with Python 2.6 Signed-off-by: Steve Dickson <steved@redhat.com>
* Added more (commented out) options to nfsmount.confSteve Dickson2014-04-291-0/+9
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: add PATH for finding systemctlKinglong Mee2014-04-251-1/+1
| | | | | | | | | | | | The 1.3.0 release adds a call to systemctl fails for it's in /usr/bin. [root@localhost nfs-utils]# start-statd /usr/sbin/start-statd: line 9: systemctl: command not found Statd service already running! Reported-by: Allan Duncan <amd1234@fastmail.com.au> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* Release 1.3.0Steve Dickson2014-03-251-1/+1
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsidmap: Keys need to be invalidated instead of revokedSteve Dickson2014-03-251-6/+6
| | | | | | | | With some recent kernel changes to the key ring for a key to be removed they need to be invalidated instead of revoked. Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: add PIDFile directives where appropriate.NeilBrown2014-03-242-0/+2
| | | | | | | Only two of our daemons write out pid files. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: nfs-client needs rpc-svcgssd too.NeilBrown2014-03-241-2/+3
| | | | | | | | For NFSv4.0 callbacks, the server needs the client code and the client needs the server code. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: remove @localstatedir@ marking.NeilBrown2014-03-241-1/+1
| | | | | | | | | This isn't used so currently is inconvenient. Once we decide how to handle this sort of thing we can apply the change uniformly. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd units: create nfs-config.service as single location to process config.NeilBrown2014-03-249-14/+29
| | | | | | | | | Instead of processing the config information into command lines every time it might be needed, do it once in a separate service that other services can Want. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd units: remove reference to nfs-server.target from nfs-server.service.NeilBrown2014-03-241-1/+0
| | | | | | | | This line was somehow missed in a recent patch. nfs-server.target doesn't exists, so nothing can be part of it. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: convert secure services to start without explicitNeilBrown2014-03-244-17/+17
| | | | | | | | | | | | | | | | | | | configuration. This patch removes nfs-secure.target. Instead, rpc.gssd and rpc.svcgssd start started if they appear to be needed. For rpc.gssd, this means if the file /etc/krb5.keytab exists. As the only security mechanism supported is krb5, that file must exist for rpc.gssd to be useful. Conversely, if it does exist, it seems very likely that krb5 is configured on the system an may be used for NFS. For rpc.svcgssd, it also means checking if gss-proxy might be performing the equivalent task instead. So we check if it is running, and if the kernel is able to talk to it. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd units: merge nfs-server.service and nfs-server.targetNeilBrown2014-03-243-9/+11
| | | | | | | | | | | | | | | | | | | With systemd, a 'service' should run a single server while a 'target' can be used to group services. As nfs service is really a group of services a 'target' makes more sense. However that means that we need commands like systemctl start nfs-server.target rather than the more simple systemctl start nfs-server As the target/service separate doesn't bring any gain except a minor aesthetic, and does bring a practical inconvenience, this patch merges nfs-server.target into nfs-server.service. Reported-by: Steve Dickson <SteveD@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>