summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* Revise the nfsiod auto tuning code. Now both the upper and lower limitspeter2002-01-153-22/+87
| | | | | | 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-143-60/+92
| | | | | | | | | 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>
* Terminate requests in nfs_sigintr() if the filesystem is in theiedowse2002-01-101-1/+4
| | | | | | | | | | | | process of being unmounted. This allows forced NFS unmounts to complete even if there are processes stuck holding the mnt_lock while the server is down. The mechanism is not ideal in that there is a small chance we might accidentally cancel requests during a failed non-forced unmount attempt on that filesystem, but this is not really a big problem. Also, move the tsleep() in nfs_nmcancelreqs() so that we do not sleep in the case where there are no requests to be cancelled.
* Permit NFS filesystems to be forcibly unmounted when the server isiedowse2002-01-023-7/+52
| | | | | | | | | | | | | | | | | | | | | | 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 Remove an errant ';' introduced in the last revision.alc2002-01-011-2/+1
| | | | o Remove an unused variable.
* o Remove premature use of nmp->nm_cred, it hasn't been initialized yet.rwatson2002-01-011-1/+1
|
* o Pass td into nfs_mountroot() to eliminate an XXX'd curthread use.rwatson2001-12-312-4/+3
| | | | | | | Since it's in the parent function anyway, might as well pass it another layer down. Obtained from: TrustedBSD Project
* o Remove premature leakage of use of td_ucred from base source tree:rwatson2001-12-311-3/+3
| | | | instead, use td->td_proc->p_ucred.
* o Add missing #include's of sys/proc.h, missed in merge, required torwatson2001-12-312-0/+2
| | | | dereference td->td_proc->p_ucred.
* o Make the credential used by socreate() an explicit argument torwatson2001-12-315-9/+20
| | | | | | | | | | | | | | socreate(), rather than getting it implicitly from the thread argument. o Make NFS cache the credential provided at mount-time, and use the cached credential (nfsmount->nm_cred) when making calls to socreate() on initially connecting, or reconnecting the socket. This fixes bugs involving NFS over TCP and ipfw uid/gid rules, as well as bugs involving NFS and mandatory access control implementations. Reviewed by: freebsd-arch
* Add a #define for the size of the nfs_backoff[] array, and use thisiedowse2001-12-301-3/+4
| | | | instead of magic constants in the code.
* Increase the buffer size to hold a bootp/DHCP reply from 256 bytes toambrisko2001-12-301-1/+1
| | | | | | | | | | | 1222 bytes (derived as the maximum that isc-dhcpd uses). This solves the problem if a bootp/DHCP reply is over 256 bytes in which the end of the bootp/DHCP reply will not be found and then the reply will be ignored. This happens when swap and root paths are longish or many parameters are set. Reviewed by: imp Approved by: imp
* nfs_nget() does no locking whatsoever when looking up a vnode. If thedillon2001-12-271-1/+4
| | | | | | | vget() sleeps we have to retry the operation to avoid racing against a deletion. MFC maybe: submitted to re's
* Avoid passing the variable `tl' to functions that just use it foriedowse2001-12-184-113/+105
| | | | | | | | | | | | | temporary storage. In the old NFS code it wasn't at all clear if the value of `tl' was used across or after macro calls, but I'm fairly confident that the convention was to keep its use local. Each ex-macro function now uses a local version of this variable, so all of the double-indirection goes away. The only exception to the `local use' rule for `tl' is nfsm_clget(), which is left unchanged by this commit. Reviewed by: peter
* This fixes a large number of bugs in our NFS client side code. A recentdillon2001-12-143-9/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit by Kirk also fixed a softupdates bug that could easily be triggered by server side NFS. * An edge case with shared R+W mmap()'s and truncate whereby the system would inappropriately clear the dirty bits on still-dirty data. (applicable to all filesystems) THIS FIX TEMPORARILY DISABLED PENDING FURTHER TESTING. see vm/vm_page.c line 1641 * The straddle case for VM pages and buffer cache buffers when truncating. (applicable to NFS client side) * Possible SMP database corruption due to vm_pager_unmap_page() not clearing the TLB for the other cpu's. (applicable to NFS client side but could effect all filesystems). Note: not considered serious since the corruption occurs beyond the file EOF. * When flusing a dirty buffer due to B_CACHE getting cleared, we were accidently setting B_CACHE again (that is, bwrite() sets B_CACHE), when we really want it to stay clear after the write is complete. This resulted in a corrupt buffer. (applicable to all filesystems but probably only triggered by NFS) * We have to call vtruncbuf() when ftruncate()ing to remove any buffer cache buffers. This is still tentitive, I may be able to remove it due to the second bug fix. (applicable to NFS client side) * vnode_pager_setsize() race against nfs_vinvalbuf()... we have to set n_size before calling nfs_vinvalbuf or the NFS code may recursively vnode_pager_setsize() to the original value before the truncate. This is what was causing the user mmap bus faults in the nfs tester program. (applicable to NFS client side) * Fix to softupdates (see ufs/ffs/ffs_inode.c 1.73, commit made by Kirk). Testing program written by: Avadis Tevanian, Jr. Testing program supplied by: jkh / Apple (see Dec2001 posting to freebsd-hackers with Subject 'NFS: How to make FreeBS fall on its face in one easy step') MFC after: 1 week
* o Modify nfslockdans() to accept a thread reference instead of a procrwatson2001-11-143-14/+16
| | | | | | | | | | | reference: with td->td_ucred, it will be desirable to authorize based on td->td_ucred, rather than p->p_ucred. o Since the same variable 'p' was later used with pfind() on the target process for the wakeup, introduce a new local variable 'targetp' to use instead. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs
* Allow users to use the 'nolockd' or -L options with mount_nfs in orderalfred2001-11-123-3/+9
| | | | | | to avoid the need for rpc.lockd to perform client locks. Using this option a user can revert back to using local locks for NFS mounts like we did before we had rpc.lockd.
* turn vn_open() into a wrapper around vn_open_cred() which allowsalfred2001-11-111-15/+1
| | | | | | | | one to perform a vn_open using temporary/other/fake credentials. Modify the nfs client side locking code to use vn_open_cred() passing proc0's ucred instead of the old way which was to temporary raise privs while running vn_open(). This should close the race hopefully.
* Implement IO_NOWDRAIN and B_NOWDRAIN - prevents the buffer cache from blockingdillon2001-11-051-0/+6
| | | | | | | | | | | | | in wdrain during a write. This flag needs to be used in devices whos strategy routines turn-around and issue another high level I/O, such as when MD turns around and issues a VOP_WRITE to vnode backing store, in order to avoid deadlocking the dirty buffer draining code. Remove a vprintf() warning from MD when the backing vnode is found to be in-use. The syncer of buf_daemon could be flushing the backing vnode at the time of an MD operation so the warning is not correct. MFC after: 1 week
* o Note an additional potential problem here: LOCKD_MSG directly exportsrwatson2001-10-241-0/+4
| | | | | | struct ucred to userland. In 5.0-CURRENT, it is desirable to instead export struct xucred, as ucred contains mutexes, pointers, and other kernel evil. I'll add it to my work queue.
* o Add two comments identifying problems with the current nfs_lock.crwatson2001-10-231-0/+7
| | | | | | | | | implementation, so that the information doesn't get lost. (1) /var/run/lock is looked up relative to the current thread's root directory, but it's not clear that's desirable. (2) A race condition associated with live credential modification on a shared credential is present when privilege is granted for the purposes of talking to /var/run/lock.
* Change the vnode list under the mount point from a LIST to a TAILQdillon2001-10-232-4/+4
| | | | | | in preparation for an implementation of limiting code for kern.maxvnodes. MFC after: 3 days
* Change the kernel's ucred API as follows:jhb2001-10-112-14/+7
| | | | | | | | - crhold() returns a reference to the ucred whose refcount it bumps. - crcopy() now simply copies the credentials from one credential to another and has no return value. - a new crshared() primitive is added which returns true if a ucred's refcount is > 1 and false (0) otherwise.
* Use crhold() instead of crdup() since we aren't modifying the cred butjhb2001-10-091-1/+2
| | | | just need to ensure it remains immutable.
* Make this compile after last commit. It should be:peter2001-10-091-1/+1
| | | | "td ? td->td_proc : NULL", not "td ? td->td_proc, NULL"
* Don't dereference td if it's NULL.julian2001-10-081-1/+2
| | | | Submitted by: Alexander N. Kabaev <ak03@gte.com>
* Unwind some more macros. NFSMADV() was kinda silly since it was rightpeter2001-09-281-77/+63
| | | | | | | | | | next to equivalent m_len adjustments. Move the nfsm_subs.h macros into groups depending on which phase they are used in, since that affects the error recovery requirements. Collect some of the common error checking into a single macro as preparation for unwinding some more. Have nfs_rephead return a value instead of secretly modifying args. Remove some unused function arguments that were being passed around. Clarify nfsm_reply()'s error handling (I hope).
* Make nfsm_dissect() have an obvious return value.peter2001-09-274-50/+52
|
* Tidy up nfsm_build usage. This is only partially finished.peter2001-09-272-38/+38
|
* Add a missing dereference level. This caused nfsm_postop_attr_xx()iedowse2001-09-251-1/+1
| | | | | | | to try and extract node attributes from an RPC reply even if none were present. Reviewed by: peter
* Add the magic marker so that loader and kldload(2) can find this inpeter2001-09-201-0/+4
| | | | module form automagically.
* Oops. Fix a missing indirection level. gcc didn't complain about it onpeter2001-09-201-1/+1
| | | | | x86, but did complain about it on alpha (since int and pointer are different sizes)
* Sigh, Last minute pre-merge typo. (missing quotes)peter2001-09-181-1/+1
|
* Cleanup and split of nfs client and server code.peter2001-09-1820-7282/+1497
| | | | This builds on the top of several repo-copies.
* nfs_strategy calls nfs_asyncio with td as NULL. So add a bandaid thatimp2001-09-181-1/+1
| | | | | | | | | | will pass NULL as the struct proc when td is NULL. This has stopped crashing on my machine. Note: The passing of NULL may be bogus, but I'll let others fix that problem. Reviewed by: jhb
* Sync some differences that were different between the copies of the filespeter2001-09-153-9/+9
| | | | that were in nfs/nfs.h and nfsserver/nfs.h in the p4 tree.
* KSE Milestone 2julian2001-09-1215-481/+490
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Fix some signed/unsigned integer confusion, and add bounds checking ofkris2001-09-103-12/+12
| | | | | | | | arguments to some functions. Obtained from: NetBSD Reviewed by: peter MFC after: 2 weeks
* Pushdown Giant for nfs syscalls (nfssvc())dillon2001-08-311-12/+23
|
* Stupid error from my side in prev. commit: || -> &&ache2001-08-231-1/+1
|
* Implement l_len<0 per POSIX check.ache2001-08-231-4/+6
| | | | Check for valid l_whence too.
* Even better move: suppose that server is able to handle SEEK_END,ache2001-08-231-6/+6
| | | | | so check arguments for all but not SEEK_END case, leaving SEEK_END handling for server
* Apparently SEEK_END locking not supported by NFS. Previous variantache2001-08-231-1/+5
| | | | returns EINVAL in that case, change it to EOPNOTSUPP.
* Move <machine/*> after <sys/*>ache2001-08-231-1/+2
| | | | Pointed by: bde
* adv. lock:ache2001-08-231-5/+5
| | | | | detect off_t overflow _before_ it occurse and return EOVERFLOW instead of EINVAL
* Fix a client-side memory leak in nfs_flush(). The code allocatesiedowse2001-08-011-2/+2
| | | | | | | | | | | | | a temporary array to store struct buf pointers if the list doesn't fit in a local array. Usually it frees the array when finished, but if it jumps to the 'again' label and the new list does fit in the local array then it can forget to free a previously malloc'd M_TEMP memory. Move the free() up a line so that it frees any previously allocated memory whether or not it needs to malloc a new array. Reviewed by: dillon
* Check the filehandle size when mounting.peter2001-07-301-0/+2
| | | | Obtained from: Constantine Sapuntzakis <csapuntz@openbsd.org>
* - Sort includes.jhb2001-07-041-5/+10
| | | | - Update vmmeter statistics for vnode pagein/pageouts in getpages/putpages.
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-042-16/+10
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* - Protect the mnt_vnode list with the mntvnode lock.jhb2001-06-282-7/+20
| | | | - Use queue(9) macros.
OpenPOWER on IntegriCloud