summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* systemd: tidy up DefaultDependenciesNeilBrown2014-03-247-4/+7
| | | | | | | | | | | | | | | DefaultDependencies should be "yes" (the default) for things needed only be the NFS server, as that is a service that doesn't need to start early. DefaultDependencies should be "no" for things needed to mount an NFS filesystem, and filesystems are mounted before basic.target. To ensure these services are shut down in a timely fashion, they must Conflict with systemd.umount so they are shutdown when everything is unmounted. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* systemd: add nfs-utils.service which can be used to restart everything.NeilBrown2014-03-249-0/+40
| | | | | | | | | | With this patch, systemctl restart nfs-utils will restart any nfs-utils daemons that are currently running, whether there were started via nfs-server.service, nfs-client.target, or directly by systemctl. Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>
* start-statd: converted to use systemdNeilBrown2014-03-241-2/+5
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/var-lib-nfs-rpc_pipefs.mountNeilBrown2014-03-241-0/+8
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/rpc-svcgssd.serviceNeilBrown2014-03-241-0/+15
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/rpc-statd.serviceNeilBrown2014-03-241-0/+12
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/rpc-statd-notify.serviceNeilBrown2014-03-241-0/+17
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/rpc-gssd.serviceNeilBrown2014-03-241-0/+14
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/proc-fs-nfsd.mountNeilBrown2014-03-241-0/+8
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-server.targetNeilBrown2014-03-241-0/+8
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-server.serviceNeilBrown2014-03-241-0/+24
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-secure.targetNeilBrown2014-03-241-0/+8
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-mountd.serviceNeilBrown2014-03-241-0/+13
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-idmapd.serviceNeilBrown2014-03-241-0/+9
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-client.targetNeilBrown2014-03-241-0/+13
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-blkmap.targetNeilBrown2014-03-241-0/+8
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/nfs-blkmap.serviceNeilBrown2014-03-241-0/+11
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* Added systemd/READMENeilBrown2014-03-241-0/+50
| | | | Signed-off-by: Steve Dickson <steved@redhat.com>
* mount: chk_mountpoint should only check for execute perms for unpriveleged usersScott Mayhew2014-03-221-1/+1
| | | | | | | | Otherwise 'mount -o remount' fails on mounts that have root squashing enabled and world execute perms disabled. Signed-off-by: Scott Mayhew <smayhew@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Support raw IPv6 addresses with "client:/path"Chuck Lever2014-03-172-2/+78
| | | | | | | | | | | Wrap IPv6 presentation addresses in square brackets. This echoes the same syntax used when specifying IPv6 server addresses with the mount.nfs command. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=817557 Tested-by: Steve Dickson <steved@redaht.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* exportfs: Refactor exportfs() and unexportfs()Chuck Lever2014-03-171-23/+51
| | | | | | | | | | Separate parsing the "client:/path" argument from the actual processing. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=817557 Tested-by: Steve Dickson <steved@redaht.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfs(5): intr/nointr are ignored nowJim Rees2014-03-131-47/+4
| | | | | Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
* [PATCH - v3] mount.nfs: Fix fallback from tcp to udpNeilBrown2014-03-133-18/+50
| | | | | | | | | | | | | | | | | | | | | | | | | Protocol negotiation in mount.nfs does not correctly negotiate with a server which only supports NFSv3 and UDP. When mount.nfs attempts an NFSv4 mount and fails with ECONNREFUSED it does not fall back to NFSv3, as this is not recognised as a "does not support NFSv4" error. However ECONNREFUSED is a clear indication that the server doesn't support TCP, and ipso facto does not support NFSv4. So ECONNREFUSED should trigger a fallback from v4 to v2/3. However ECONNREFUSED may simply indicate that NFSv4 isn't supported *yet*. i.e. the server is still booting and isn't responding to NFS requests yet. So if we subsequently find that NFSv3 is supported, we need to check with the server to confirm that NFSv4 really isn't supported. If server reports that v4 is not supported after reporting that v3 is, we can safely use v4. If it reports that v4 is supported, we need to retry v4. Signed-off-by: Steve Dickson <steved@redhat.com> Reported-by: Carsten Ziepke <kieltux@gmail.com>
* mountd: use SONAME fir libnfsjunct when loading with dlopenNeilBrown2014-03-111-2/+7
| | | | | | | | | | | | | | | | | | | | | | | The standard for loading shared libraries is to identify them by their "soname" (Which "objdump -x $BINARY | grep SONAME" will report). However mountd currently loads using the "linker name" which should only be used when building new code. Future releases of fedfs-utils will define the soname in the include file, so if that is defined, use it. If not, use the soname of the first version: "libnfsjunct.so.0". This is a slight behavioural change. However all distros known to package fedfs-utils will install "libnfsjunct.so.0" whenever they install the old name of "libnfsjunct.so", and "make install" will install both. So it should not be a noticeable change. Also only test the JP_API_VERSION if it is defined. As the version is embedded in the soname, a secondary test is not needed. Cc: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Steve Dickson <steved@redhat.com>