summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix a comment that got missed by r221973 which changedrmacklem2011-05-161-1/+1
| | | | the sysctl naming for the old NFS client to vfs.oldnfs.
* Do not synchronously start the nfsiod threads at all. The r212506kib2010-10-181-1/+1
| | | | | | | | | | | | | | | | | | | fixed the issues with file descriptor locks, but the same problems are present for vnode lock/user map lock. If the nfs_asyncio() cannot find the free nfsiod, schedule task to create new nfsiod and return error. This causes fall back to the synchronous i/o for nfs_strategy(), or does not start read at all in the case of readahead. The caller that holds vnode and potentially user map lock does not wait for kproc_create() to finish, preventing the LORs. The change effectively reverts r203072, because we never hand off the request to newly created nfsiod thread anymore. Reviewed by: jhb Tested by: jhb, pluknet MFC after: 3 weeks
* Do not fork nfsiod directly from the vop methods. This causes LORs betweenkib2010-09-121-0/+2
| | | | | | | | | | | | | vnode lock and several locks needed during fork, like fd lock. Instead, schedule the task to be executed in the taskqueue context. We still waiting for the fork to finish, but the context of the thread executing the task does not make real LORs with our vnode lock. Submitted by: pluknet at gmail com Reviewed by: jhb Tested by: pho MFC after: 3 weeks
* Fix a race that can occur when nfs nfsiod threads are being created.rmacklem2010-01-271-1/+1
| | | | | | | | | | | | | | | Without this patch it was possible for a different thread that calls nfs_asyncio() to snitch a newly created nfsiod thread that was intended for another caller of nfs_asyncio(), because the nfs_iod_mtx mutex was unlocked while the new nfsiod thread was created. This patch labels the newly created nfsiod, so that it is not taken by another caller of nfs_asyncio(). This is believed to fix the problem reported on the freebsd-stable email list under the subject: FreeBSD NFS client/Linux NFS server issue. Tested by: to DOT my DOT trociny AT gmail DOT com Reviewed by: jhb MFC after: 2 weeks
* Adjust the internal NFS KPI to avoid the last traces of NFS_LEGACYRPC.dfr2009-06-301-7/+2
| | | | Approved by: re
* Remove the old kernel RPC implementation and the NFS_LEGACYRPC option.dfr2009-06-301-61/+0
| | | | Approved by: re
* Remove the unmaintained University of Michigan NFSv4 client from 8.xrwatson2009-05-221-12/+0
| | | | | | | prior to 8.0-RELEASE. Rick Macklem's new and more feature-rich NFSv234 client and server are replacing it. Discussed with: rmacklem
* Remove the thread argument from the FSD (File-System Dependent) parts ofattilio2009-05-111-1/+1
| | | | | | | | | | | | | | | | | the VFS. Now all the VFS_* functions and relating parts don't want the context as long as it always refers to curthread. In some points, in particular when dealing with VOPs and functions living in the same namespace (eg. vflush) which still need to be converted, pass curthread explicitly in order to retain the old behaviour. Such loose ends will be fixed ASAP. While here fix a bug: now, UFS_EXTATTR can be compiled alone without the UFS_EXTATTR_AUTOSTART option. VFS KPI is heavilly changed by this commit so thirdy parts modules needs to be recompiled. Bump __FreeBSD_version in order to signal such situation.
* When a stale file handle is encountered, purge all cached information aboutjhb2009-04-061-0/+1
| | | | | | | | | | | an NFS node including the access and attribute caches. Previously the NFS client only purged any name cache entries associated with the file. PR: kern/123755 Submitted by: Jaakko Heinonen jh of saunalahti fi Reported by: Timo Sirainen tss of iki fi Reviewed by: rwatson, rmacklem MFC after: 1 month
* Change the default timeout for caching attributes of a directory in the NFSjhb2009-04-061-1/+1
| | | | | | | | | | | client from 30 seconds to 3 seconds. After the recent changes to add caching of negative name cache lookups, a negative name cache hit will persist until the client notices the parent directory has changed. The higher the attribute cache timeout on directories, the longer that can take, so lower the default timeout for directories to match that of regular files. Suggested by: bde, mohans MFC after: 1 month
* Expand the per-node access cache to cache permissions for multiple users.jhb2009-03-201-0/+3
| | | | | | | | | | | | The number of entries in the cache defaults to 8 but is easily changed in nfsclient/nfs.h. When the cache is filled, the oldest cache entry is evicted when space is needed. I mirrored the changes to the NFSv[23] client in the NFSv4 client to fix compile breakage. However, the NFSv4 client doesn't actually use the access cache currently. Submitted by: rmacklem
* Switch the default rpc implementation for NFS back to the new code. I believedfr2008-11-141-4/+0
| | | | | | I have fixed the reported problems - if you still have trouble with it, please contact me with as much detail as possible so that I can track down any other issues as quickly as possible.
* Temporarily switch NFS back to the old RPC code while I try to diagnose anddfr2008-11-131-0/+4
| | | | | | fix the problems a few people have noticed with the new code. People who want to continue testing the new code or who need RPCSEC_GSS support should use the new option NFS_NEWRPC to select it.
* Implement support for RPCSEC_GSS authentication to both the NFS clientdfr2008-11-031-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and server. This replaces the RPC implementation of the NFS client and server with the newer RPC implementation originally developed (actually ported from the userland sunrpc code) to support the NFS Lock Manager. I have tested this code extensively and I believe it is stable and that performance is at least equal to the legacy RPC implementation. The NFS code currently contains support for both the new RPC implementation and the older legacy implementation inherited from the original NFS codebase. The default is to use the new implementation - add the NFS_LEGACYRPC option to fall back to the old code. When I merge this support back to RELENG_7, I will probably change this so that users have to 'opt in' to get the new code. To use RPCSEC_GSS on either client or server, you must build a kernel which includes the KGSSAPI option and the crypto device. On the userland side, you must build at least a new libc, mountd, mount_nfs and gssd. You must install new versions of /etc/rc.d/gssd and /etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf. As long as gssd is running, you should be able to mount an NFS filesystem from a server that requires RPCSEC_GSS authentication. The mount itself can happen without any kerberos credentials but all access to the filesystem will be denied unless the accessing user has a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There is currently no support for situations where the ticket file is in a different place, such as when the user logged in via SSH and has delegated credentials from that login. This restriction is also present in Solaris and Linux. In theory, we could improve this in future, possibly using Brooks Davis' implementation of variant symlinks. Supporting RPCSEC_GSS on a server is nearly as simple. You must create service creds for the server in the form 'nfs/<fqdn>@<REALM>' and install them in /etc/krb5.keytab. The standard heimdal utility ktutil makes this fairly easy. After the service creds have been created, you can add a '-sec=krb5' option to /etc/exports and restart both mountd and nfsd. The only other difference an administrator should notice is that nfsd doesn't fork to create service threads any more. In normal operation, there will be two nfsd processes, one in userland waiting for TCP connections and one in the kernel handling requests. The latter process will create as many kthreads as required - these should be visible via 'top -H'. The code has some support for varying the number of service threads according to load but initially at least, nfsd uses a fixed number of threads according to the value supplied to its '-n' option. Sponsored by: Isilon Systems MFC after: 1 month
* Re-implement the client side of rpc.lockd in the kernel. This implementationdfr2008-06-261-0/+1
| | | | | | | | | | | | provides the correct semantics for flock(2) style locks which are used by the lockf(1) command line tool and the pidfile(3) library. It also implements recovery from server restarts and ensures that dirty cache blocks are written to the server before obtaining locks (allowing multiple clients to use file locking to safely share data). Sponsored by: Isilon Systems PR: 94256 MFC after: 2 weeks
* NFS MP scaling changes.mohans2007-10-121-2/+2
| | | | | | | | | | | | | | - Eliminate the hideous nfs_sndlock that serialized NFS/TCP request senders thru the sndlock. - Institute a new nfs_connectlock that serializes NFS/TCP reconnects. Add logic to wait for pending request senders to finish sending before reconnecting. Dial down the sb_timeo for NFS/TCP sockets to 1 sec. - Break out the nfs xid manipulation under a new nfs xid lock, rather than over loading the nfs request lock for this purpose. - Fix some of the locking in nfs_request. Many thanks to Kris Kennaway for his help with this and for initiating the MP scaling analysis and work. Kris also tested this patch thorougly. Approved by: re@ (Ken Smith)
* Unstaticize nfs_iosize() in nfsclient and use it in nfs4client insteadbde2007-01-251-0/+1
| | | | | | | | | | | of duplicating it except for larger style bugs in the copy. Fix some nearby style bugs (including a harmless type mismatch) in and near the remaining copy. This is part of fixing collisions of the 2 nfs*client's names. Even static names should have a unique prefixes so that they can be debugged easily.
* 1) Fix up locking in nfs_up() and nfs_down.mohans2006-11-201-1/+1
| | | | | | | | | | | | | | | 2) Reduce the acquisitions of the Giant lock in the nfs_socket.c paths significantly. - We don't need to acquire Giant before tsleeping on lbolt anymore, since jhb specialcased lbolt handling in msleep. - nfs_up() needs to acquire Giant only if printing the "server up" message. - nfs_timer() held Giant for the duration of the NFS timer processing, just because the printing of the message in nfs_down() needed it (and we acquire other locks in nfs_timer()). The acquisition of Giant is moved down into nfs_down() now, reducing the time Giant is held in that path. Reported by: Kris Kennaway
* Fixed some style bugs (especially ones involving long lines and usebde2006-10-171-17/+19
| | | | of __P(())). There are many more.
* Since NFSv4 is not SMP safe, nfsiod needs to acquire Giant for NFSv4 mountsmohans2006-05-241-0/+1
| | | | | | before doing the read/write. Reported by: Chuck Lever.
* NFS over TCP retransmit behavior should default to a 60 second time out,cel2006-05-231-1/+2
| | | | | | | | | | | | mimicing the NFS reference implementation. NFS over TCP does not need fast retransmit timeouts, since network loss and congestion are managed by the transport (TCP), unlike with NFS over UDP. A long timeout prevents the unnecessary retransmission of non- idempotent NFS requests. Reviewed by: mohans, silby, rees? Sponsored by: Network Appliance, Incorporated
* Refactor the NFS over UDP retransmit timeout estimation logic to allowcel2006-05-231-0/+25
| | | | | | | | | | | | | the estimator to be more easily tuned and maintained. There should be no functional change except there is now a lower limit on the retransmit timeout to prevent the client from retransmitting faster than the server's disks can fill requests, and an upper limit to prevent the estimator from taking to long to retransmit during a server outage. Reviewed by: mohan, kris, silby Sponsored by: Network Appliance, Incorporated
* Changes to make the NFS client MP safe.mohans2006-05-191-2/+2
| | | | Thanks to Kris Kennaway for testing and sending lots of bugs my way.
* Make nfs_timer() MPSAFE. With this change, the bottom half of the NFSps2005-07-191-0/+1
| | | | | | | client (the interface with the protocol stack and callouts) is Giant-free. Submitted by: Mohan Srinivasan.
* Remove unused cred arg from nfs_vinvalbuf() and many bogus argumentsphk2005-01-241-2/+1
| | | | passed for it.
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* First cut of NFS direct IO support.ps2004-12-151-0/+2
| | | | | | | | | | | | | | - NFS direct IO completely bypasses the buffer and page caches. If a file is open for direct IO all caching is disabled. - Direct IO for Directories will be addressed later. - 2 new NFS directio related sysctls are added. One is a knob to disable NFS direct IO completely (direct IO is enabled by default). The other is to disallow mmaped IO on a file that has at least one O_DIRECT open (see the comment in nfs_vnops.c for more details). The default is to allow mmaps on a file that has O_DIRECT opens. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* Rewrite of the NFS client's reply handling. We now have NFS socketps2004-12-061-15/+7
| | | | | | | | upcalls which do RPC header parsing and match up the reply with the request. NFS calls now sleep on the nfsreq structure. This enables us to eliminate the NFS recvlock. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Correct a typo in a comment.rwatson2004-12-061-1/+1
|
* For reasons unknown, the nfs locking code used a fifo to send requests tophk2004-12-061-4/+0
| | | | | | | | | | | | | userland and a dedicated system call to get replies. The vnode-bypass of fifos broke this into a panic. Ditch all the magic and create a device /dev/nfslock instead, and use that for both directions apart from the shorter path, this is also faster because the device driver runs Giant free using the vnode bypass. Noticed by: marcel
* style consistency.phk2004-09-271-1/+1
|
* Explicitly pass vnode to nfs_doio() and mountpoint to nfs_asyncio().phk2004-09-071-2/+2
|
* NFS mobility PHASE I, II & III (phase VI, and V pending):alfred2004-07-061-2/+13
| | | | | | | | | | | | | | | Rebind the client socket when we experience a timeout. This fixes the case where our IP changes for some reason. Signal a VFS event when NFS transitions from up to down and vice versa. Add a placeholder vfs_sysctl where we will put status reporting shortly. Also: Make down NFS mounts return EIO instead of EINTR when there is a soft timeout or force unmount in progress.
* Clean up properly when unloading NFS client module.peadar2004-04-111-0/+2
| | | | | | | | | This includes a modified form of some code from Thomas Moestl (tmm@) to properly clean up the UMA zone and the "nfsnodehashtbl" hash table. Reviewed By: iedowse PR: 16299
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* only do nfs rpc callouts if there is work to do.rees2004-03-251-1/+1
| | | | | Submitted by: kan Approved by: alfred
* Calculate NFS timeouts in units of 10ms, not 5ms. This matches the defaultpeter2004-03-141-1/+1
| | | | | | clock precision on i386. This is a NOP change on i386. But this stops the mount_nfs units from suddenly changing to units of 1/20 of a second (vs the normal 1/10 of a second) if HZ is increased.
* NFSv4 fixes from Connectathon 2004:rees2004-02-271-2/+0
| | | | | | | | | | | | remove unused pid field of file context struct map nfs4 error codes to errnos eliminate redundant code from nfs4_request use zero stateid on setattr that doesn't set file size use same clientid on all mounts until reboot invalidate dirty bufs in nfs4_close, to play it safe open file for writing if truncating and it's not already open Approved by: alfred
* Use function pointers to remove the depenancy cross dependancy on nfs4alfred2003-11-221-0/+14
| | | | | | | | and the nfs3 client. Also fix some bugs that happen to be causing crashes in both v3 and v4 introduced by the v4 import. Submitted by: Jim Rees <rees@umich.edu> Approved by: re
* Move the declaration for "struct nfs4_fctx" out from under #ifdef KERNELalfred2003-11-151-14/+14
| | | | for fstat(1).
* University of Michigan's Citi NFSv4 kernel client code.alfred2003-11-141-0/+19
| | | | Submitted by: Jim Rees <rees@umich.edu>
* Remove extern declarations of stuff which is static in nfs_node.cphk2002-10-201-6/+0
| | | | | | Move related macro to nfs_node.c Spotted by: FlexeLint
* Use `struct uma_zone *' instead of uma_zone_t, so that <sys/uma.h> isn'tbde2002-09-051-1/+1
| | | | a prerequisite.
* Introduce typedefs for the member functions of struct vfsops and employphk2002-08-131-2/+2
| | | | | | | these in the main filesystems. This does not change the resulting code but makes the source a little bit more grepable. Sponsored by: DARPA and NAI Labs.
* In namei(), we use a NULL thread for uio_td when doing a VOP_READLINK().jhb2002-06-281-1/+1
| | | | | | | | | | | | nfs_readlink() calls nfs_bioread() which passes in uio_td as the thread argument to nfs_getcacheblk(). In nfs_getcacheblk() we dereference the thread pointer to get a process pointer to pass to nfs_sigintr(). This obviously results in a panic. :) Rather than change nfs_getcacheblk() to check if the thread pointer is NULL when calling nfs_sigintr() like other callers do, change nfs_sigintr() to take a thread as the last argument instead of a process so none of the callers have to care if the thread is NULL or not.
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-201-3/+1
|
* Revise the nfsiod auto tuning code. Now both the upper and lower limitspeter2002-01-151-1/+1
| | | | | | are specifyable by sysctl and are respected. Submitted by: Maxime Henrion <mux@sneakerz.org>
* Implement vfs.nfs.iodmin (minimum number of nfsiod's) andpeter2002-01-141-0/+1
| | | | | | | | | vfs.nfs.iodmaxidle (idle time before nfsiod's exit). Make it adaptive so that we create nfsiod's on demand and they go away after not being used for a while. The upper limit is NFS_MAXASYNCDAEMON (currently 20). More will be done here, but this is a useful checkpoint. Submitted by: Maxime Henrion <mux@qualys.com>
* Permit NFS filesystems to be forcibly unmounted when the server isiedowse2002-01-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | down, even if there are hung processes and the mount is non- interruptible. This works by having nfs_unmount call a new function nfs_nmcancelreqs() in the FORCECLOSE case. It scans the list of outstanding requests and marks as interrupted any requests belonging to the specified mount. Then it waits up to 30 seconds for all requests to terminate. A few other changes are necessary to support this: - Unconditionally set a socket timeout so that even hard mounts are guaranteed to occasionally check the R_SOFTTERM flag on requests. For hard mounts this flag can only be set by nfs_nmcancelreqs(). - Reject requests on a mount that is currently being unmounted. - Never grant the receive lock to a request that has been cancelled. This should also avoid an old problem where a forced NFS unmount could cause a crash; it occurred when a VOP on an unlocked vnode (usually VOP_GETATTR) was in progress at the time of the forced unmount.
* o Pass td into nfs_mountroot() to eliminate an XXX'd curthread use.rwatson2001-12-311-1/+1
| | | | | | | Since it's in the parent function anyway, might as well pass it another layer down. Obtained from: TrustedBSD Project
OpenPOWER on IntegriCloud