summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.tanimura2002-05-312-22/+6
| | | | Requested by: hsu
* Don't tsleep() with an sb_mtx held.dd2002-05-271-2/+2
|
* Fix warning; deprecated use of label at end of compound statementpeter2002-05-241-0/+1
|
* Lock down a socket, milestone 1.tanimura2002-05-202-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
* Add TAG_VENDOR_INDENTIFIER (option 60) to our DHCP request done by theambrisko2002-05-171-0/+12
| | | | | | | | | | kernel BOOTP option. The format will be: FreeBSD:<MACHINE>:<osrelease> this way people can tune their DHCP server to server up root file systems via the OS, machine type and version. Obtained from: NetBSD MFC after: 3 weeks
* More s/file system/filesystem/gtrhodes2002-05-161-2/+2
|
* We don't need the arp kludge any more.phk2002-04-282-13/+0
|
* Remove the nfs_{lock,unlock,islocked} functions and the associatediedowse2002-04-272-88/+0
| | | | | definitions; they have been unused and #if 0'd out since the Lite/2 merge and we are unlikely to want them in the future.
* The recent NFS forced unmount improvements introduced a side-effectiedowse2002-04-171-4/+4
| | | | | | | | | | | | | | | | | where some client operations might be unexpectedly cancelled during an unsuccessful non-forced unmount attempt. This causes problems for amd(8), because it periodically attempts a non-forced unmount to check if the filesystem is still in use. Fix this by adding a new mountpoint flag MNTK_UNMOUNTF that is set only during the operation of a forced unmount. Use this instead of MNTK_UNMOUNT to trigger the cancellation of hung NFS operations. Also correct a problem where dounmount() might inadvertently clear the MNTK_UNMOUNT flag. Reported by: simokawa MFC after: 1 week
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* Remove references to vm_zone.h and switch over to the new uma API.jeff2002-03-204-17/+17
|
* Add a readonly sysctl variable of type string, kern.bootp_cookie,luigi2002-03-131-0/+15
| | | | | | | | | | | | | | | | | | | which is initialized with whatever string a dhcp/bootp server passes as vendor tag 134. There is no standard tag that I know with this information, and no vendor-defined tag that applies to FreeBSD that I could find doing the same thing. The intended use is to pass information to userland for run-time configuration of a diskless client without having to run a bootp/dhcp client for the third time (after the one in pxeboot/etherboot, and the one in the kernel bootp), also because these clients generally screwup the interface configuration, which is not exactly what you want when you have your disks nfs-mounted. Manpage update to follow soon. MFC-after: 3 days
* vhold() our vnode while checking the remote side.phk2002-03-081-0/+3
| | | | | | | | | This is belived to be the only place where a soft reference to a vnode is held with no sort of hard reference, consequently this change should allow us to free(9) vnodes from the freelist after properly cleaning them up. Reviewed by: dillon
* Fix warnings.. bootpc_init() and related.peter2002-02-282-2/+1
|
* Use thread0.td_ucred instead of proc0.p_ucred. This change is cosmeticjhb2002-02-271-4/+4
| | | | | | and isn't strictly required. However, it lowers the number of false positives found when grep'ing the kernel sources for p_ucred to ensure proper locking.
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-275-16/+13
| | | | reference.
* Fix a long line touched in previous commit (but not caused by previouspeter2002-02-071-1/+2
| | | | commit)
* Pre-KSE/M3 commit.julian2002-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,
* 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)
OpenPOWER on IntegriCloud