aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* Fix a long line touched in previous commit (but not caused by previousPeter Wemm2002-02-071-1/+2
| | | | | | | commit) Notes: svn path=/head/; revision=90373
* Pre-KSE/M3 commit.Julian Elischer2002-02-071-2/+2
| | | | | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice, Notes: svn path=/head/; revision=90361
* Revise the nfsiod auto tuning code. Now both the upper and lower limitsPeter Wemm2002-01-153-22/+87
| | | | | | | | | are specifyable by sysctl and are respected. Submitted by: Maxime Henrion <mux@sneakerz.org> Notes: svn path=/head/; revision=89407
* Implement vfs.nfs.iodmin (minimum number of nfsiod's) andPeter Wemm2002-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> Notes: svn path=/head/; revision=89324
* Terminate requests in nfs_sigintr() if the filesystem is in theIan Dowse2002-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. Notes: svn path=/head/; revision=89174
* Permit NFS filesystems to be forcibly unmounted when the server isIan Dowse2002-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. Notes: svn path=/head/; revision=88796
* o Remove an errant ';' introduced in the last revision.Alan Cox2002-01-011-2/+1
| | | | | | | o Remove an unused variable. Notes: svn path=/head/; revision=88777
* o Remove premature use of nmp->nm_cred, it hasn't been initialized yet.Robert Watson2002-01-011-1/+1
| | | | Notes: svn path=/head/; revision=88770
* o Pass td into nfs_mountroot() to eliminate an XXX'd curthread use.Robert Watson2001-12-312-4/+3
| | | | | | | | | | Since it's in the parent function anyway, might as well pass it another layer down. Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=88746
* o Remove premature leakage of use of td_ucred from base source tree:Robert Watson2001-12-311-3/+3
| | | | | | | instead, use td->td_proc->p_ucred. Notes: svn path=/head/; revision=88745
* o Add missing #include's of sys/proc.h, missed in merge, required toRobert Watson2001-12-312-0/+2
| | | | | | | dereference td->td_proc->p_ucred. Notes: svn path=/head/; revision=88743
* o Make the credential used by socreate() an explicit argument toRobert Watson2001-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 Notes: svn path=/head/; revision=88739
* Add a #define for the size of the nfs_backoff[] array, and use thisIan Dowse2001-12-301-3/+4
| | | | | | | instead of magic constants in the code. Notes: svn path=/head/; revision=88712
* Increase the buffer size to hold a bootp/DHCP reply from 256 bytes toDoug Ambrisko2001-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 Notes: svn path=/head/; revision=88680
* nfs_nget() does no locking whatsoever when looking up a vnode. If theMatthew Dillon2001-12-271-1/+4
| | | | | | | | | | vget() sleeps we have to retry the operation to avoid racing against a deletion. MFC maybe: submitted to re's Notes: svn path=/head/; revision=88541
* Avoid passing the variable `tl' to functions that just use it forIan Dowse2001-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 Notes: svn path=/head/; revision=88091
* This fixes a large number of bugs in our NFS client side code. A recentMatthew Dillon2001-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 Notes: svn path=/head/; revision=87834
* o Modify nfslockdans() to accept a thread reference instead of a procRobert Watson2001-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 Notes: svn path=/head/; revision=86363
* Allow users to use the 'nolockd' or -L options with mount_nfs in orderAlfred Perlstein2001-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. Notes: svn path=/head/; revision=86284
* turn vn_open() into a wrapper around vn_open_cred() which allowsAlfred Perlstein2001-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. Notes: svn path=/head/; revision=86278
* Implement IO_NOWDRAIN and B_NOWDRAIN - prevents the buffer cache from blockingMatthew Dillon2001-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 Notes: svn path=/head/; revision=86089
* o Note an additional potential problem here: LOCKD_MSG directly exportsRobert Watson2001-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. Notes: svn path=/head/; revision=85398
* o Add two comments identifying problems with the current nfs_lock.cRobert Watson2001-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. Notes: svn path=/head/; revision=85370
* Change the vnode list under the mount point from a LIST to a TAILQMatthew Dillon2001-10-232-4/+4
| | | | | | | | | in preparation for an implementation of limiting code for kern.maxvnodes. MFC after: 3 days Notes: svn path=/head/; revision=85339
* Change the kernel's ucred API as follows:John Baldwin2001-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. Notes: svn path=/head/; revision=84827
* Use crhold() instead of crdup() since we aren't modifying the cred butJohn Baldwin2001-10-091-1/+2
| | | | | | | just need to ensure it remains immutable. Notes: svn path=/head/; revision=84726
* Make this compile after last commit. It should be:Peter Wemm2001-10-091-1/+1
| | | | | | | "td ? td->td_proc : NULL", not "td ? td->td_proc, NULL" Notes: svn path=/head/; revision=84700
* Don't dereference td if it's NULL.Julian Elischer2001-10-081-1/+2
| | | | | | | Submitted by: Alexander N. Kabaev <ak03@gte.com> Notes: svn path=/head/; revision=84690
* Unwind some more macros. NFSMADV() was kinda silly since it was rightPeter Wemm2001-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). Notes: svn path=/head/; revision=84079
* Make nfsm_dissect() have an obvious return value.Peter Wemm2001-09-274-50/+52
| | | | Notes: svn path=/head/; revision=84057
* Tidy up nfsm_build usage. This is only partially finished.Peter Wemm2001-09-272-38/+38
| | | | Notes: svn path=/head/; revision=84002
* Add a missing dereference level. This caused nfsm_postop_attr_xx()Ian Dowse2001-09-251-1/+1
| | | | | | | | | | to try and extract node attributes from an RPC reply even if none were present. Reviewed by: peter Notes: svn path=/head/; revision=83914
* Add the magic marker so that loader and kldload(2) can find this inPeter Wemm2001-09-201-0/+4
| | | | | | | module form automagically. Notes: svn path=/head/; revision=83697
* Oops. Fix a missing indirection level. gcc didn't complain about it onPeter Wemm2001-09-201-1/+1
| | | | | | | | x86, but did complain about it on alpha (since int and pointer are different sizes) Notes: svn path=/head/; revision=83694
* Sigh, Last minute pre-merge typo. (missing quotes)Peter Wemm2001-09-181-1/+1
| | | | Notes: svn path=/head/; revision=83654
* Cleanup and split of nfs client and server code.Peter Wemm2001-09-1820-7282/+1497
| | | | | | | This builds on the top of several repo-copies. Notes: svn path=/head/; revision=83651
* nfs_strategy calls nfs_asyncio with td as NULL. So add a bandaid thatWarner Losh2001-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 Notes: svn path=/head/; revision=83629
* Sync some differences that were different between the copies of the filesPeter Wemm2001-09-153-9/+9
| | | | | | | that were in nfs/nfs.h and nfsserver/nfs.h in the p4 tree. Notes: svn path=/head/; revision=83493
* KSE Milestone 2Julian Elischer2001-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 Notes: svn path=/head/; revision=83366
* Fix some signed/unsigned integer confusion, and add bounds checking ofKris Kennaway2001-09-103-12/+12
| | | | | | | | | | | arguments to some functions. Obtained from: NetBSD Reviewed by: peter MFC after: 2 weeks Notes: svn path=/head/; revision=83291
* Pushdown Giant for nfs syscalls (nfssvc())Matthew Dillon2001-08-311-12/+23
| | | | Notes: svn path=/head/; revision=82702
* Stupid error from my side in prev. commit: || -> &&Andrey A. Chernov2001-08-231-1/+1
| | | | Notes: svn path=/head/; revision=82213
* Implement l_len<0 per POSIX check.Andrey A. Chernov2001-08-231-4/+6
| | | | | | | Check for valid l_whence too. Notes: svn path=/head/; revision=82204
* Even better move: suppose that server is able to handle SEEK_END,Andrey A. Chernov2001-08-231-6/+6
| | | | | | | | so check arguments for all but not SEEK_END case, leaving SEEK_END handling for server Notes: svn path=/head/; revision=82194
* Apparently SEEK_END locking not supported by NFS. Previous variantAndrey A. Chernov2001-08-231-1/+5
| | | | | | | returns EINVAL in that case, change it to EOPNOTSUPP. Notes: svn path=/head/; revision=82193
* Move <machine/*> after <sys/*>Andrey A. Chernov2001-08-231-1/+2
| | | | | | | Pointed by: bde Notes: svn path=/head/; revision=82190
* adv. lock:Andrey A. Chernov2001-08-231-5/+5
| | | | | | | | detect off_t overflow _before_ it occurse and return EOVERFLOW instead of EINVAL Notes: svn path=/head/; revision=82174
* Fix a client-side memory leak in nfs_flush(). The code allocatesIan Dowse2001-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 Notes: svn path=/head/; revision=80891
* Check the filehandle size when mounting.Peter Wemm2001-07-301-0/+2
| | | | | | | Obtained from: Constantine Sapuntzakis <csapuntz@openbsd.org> Notes: svn path=/head/; revision=80672
* - Sort includes.John Baldwin2001-07-041-5/+10
| | | | | | | - Update vmmeter statistics for vnode pagein/pageouts in getpages/putpages. Notes: svn path=/head/; revision=79247