aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* Enable use of DHCP extensions.Tor Egge2001-02-021-33/+240
| | | | | | | Reviewed by: Per Kristian Hove <Per.Hove@math.ntnu.no> Notes: svn path=/head/; revision=71915
* NFS O_EXCL file create semantics temporarily uses file attributes to storeMatthew Dillon2001-01-041-1/+14
| | | | | | | | | | | | the file verifier. The NFS client is supposed to do a SETATTR after a successful O_EXCL open/create to clean up the attributes. FreeBSD's client code was generating a SETATTR rpc but was not generating an access or modification time update within that rpc, leaving the file with a broken access time that solaris chokes on (and it doesn't look very nice when you ls -lua under FreeBSD either!). Fixed. Notes: svn path=/head/; revision=70674
* * Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.Bosko Milekic2000-12-216-33/+33
| | | | | | | | | | | | | | | | | | | | | This is because calls with M_WAIT (now M_TRYWAIT) may not wait forever when nothing is available for allocation, and may end up returning NULL. Hopefully we now communicate more of the right thing to developers and make it very clear that it's necessary to check whether calls with M_(TRY)WAIT also resulted in a failed allocation. M_TRYWAIT basically means "try harder, block if necessary, but don't necessarily wait forever." The time spent blocking is tunable with the kern.ipc.mbuf_wait sysctl. M_WAIT is now deprecated but still defined for the next little while. * Fix a typo in a comment in mbuf.h * Fix some code that was actually passing the mbuf subsystem's M_WAIT to malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the value of the M_WAIT flag, this could have became a big problem. Notes: svn path=/head/; revision=70254
* Convert more malloc+bzero to malloc+M_ZERO.David Malone2000-12-081-8/+5
| | | | | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net> Notes: svn path=/head/; revision=69781
* Simplify the tprintf() API.Poul-Henning Kamp2000-11-261-8/+1
| | | | | | | Loose the special <sys/tprintf.h> #include file. Notes: svn path=/head/; revision=69214
* This patchset fixes a large number of file descriptor race conditions.Matthew Dillon2000-11-181-2/+5
| | | | | | | | | | | | | | | Pre-rfork code assumed inherent locking of a process's file descriptor array. However, with the advent of rfork() the file descriptor table could be shared between processes. This patch closes over a dozen serious race conditions related to one thread manipulating the table (e.g. closing or dup()ing a descriptor) while another is blocked in an open(), close(), fcntl(), read(), write(), etc... PR: kern/11629 Discussed with: Alexander Viro <viro@math.psu.edu> Notes: svn path=/head/; revision=68883
* In preparation for deprecating CIRCLEQ macros in favor of TAILQKirk McKusick2000-11-145-6/+6
| | | | | | | | macros which provide the same functionality and are a bit more efficient, convert use of CIRCLEQ's in NFS to TAILQ's. Notes: svn path=/head/; revision=68711
* Give vop_mmap an untimely death. The opportunity to give it a timelyEivind Eklund2000-11-011-21/+0
| | | | | | | death timed out in 1996. Notes: svn path=/head/; revision=68186
* Remove unneeded #include <sys/proc.h> lines.Poul-Henning Kamp2000-10-292-2/+0
| | | | Notes: svn path=/head/; revision=67882
* Reduce kernel stack usage by not having large packets on the stack.Tor Egge2000-10-291-516/+1024
| | | | | | | | | Supply correct size parameter to dhcpd. Replace some magic numbers with macro names. Handle more than one interface. Notes: svn path=/head/; revision=67834
* Eliminate some bitrot (nonexisting member variable names).Tor Egge2000-10-241-5/+5
| | | | | | | Don't use curproc when a proc pointer is available. Notes: svn path=/head/; revision=67534
* Style fixes.Tor Egge2000-10-241-783/+842
| | | | Notes: svn path=/head/; revision=67531
* Make RPC timeout message more readable.Tor Egge2000-10-241-4/+10
| | | | | | | Supply proc pointer to sosend. Notes: svn path=/head/; revision=67529
* Problem to avoid processes getting stuck in "vmopar". From Ian'sDavid Malone2000-10-245-8/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mail: The problem seems to originate with NFS's postop_attr information that is returned with a read or write RPC. Within a vm_fault context, the code cannot deal with vnode_pager_setsize() shrinking a vnode. The workaround in the patch below stops the nfsm_postop_attr() macro from ever shrinking a vnode. If the new size in the postop_attr information is smaller, then it just sets the nfsnode n_attrstamp to 0 to stop the wrong size getting used in the future. This change only affects postop_attr attributes; the nfsm_loadattr() macro works as normal. The change is implemented by adding a new argument to nfs_loadattrcache() called 'dontshrink'. When this is non-zero, nfs_loadattrcache() will never reduce the vnode/nfsnode size; instead it zeros n_attrstamp. There remain other was processes can get stuck in vmopar. Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Reviewed by: dillon Tested by: Vadim Belman <voland@lflat.org> Notes: svn path=/head/; revision=67486
* Make nfs PDIRUNLOCK aware. Now it is possible to use nullfs mounts on topBoris Popov2000-10-151-11/+31
| | | | | | | | of nfs mounts, but there can be side effects because nfs uses shared locks for vnodes. Notes: svn path=/head/; revision=67152
* Add missed vop_stdunlock() for fifo's vnops (this affects only v2 mounts).Boris Popov2000-10-152-0/+3
| | | | | | | Give nfs's node lock its own name. Notes: svn path=/head/; revision=67151
* Convert lockmgr locks from using simple locks to using mutexes.Jason Evans2000-10-041-0/+2
| | | | | | | | | Add lockdestroy() and appropriate invocations, which corresponds to lockinit() and must be called to clean up after a lockmgr lock is no longer needed. Notes: svn path=/head/; revision=66615
* Add a lock structure to vnode structure. Previously it was either allocatedBoris Popov2000-09-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | separately (nfs, cd9660 etc) or keept as a first element of structure referenced by v_data pointer(ffs). Such organization leads to known problems with stacked filesystems. From this point vop_no*lock*() functions maintain only interlock lock. vop_std*lock*() functions maintain built-in v_lock structure using lockmgr(). vop_sharedlock() is compatible with vop_stdunlock(), but maintains a shared lock on vnode. If filesystem wishes to export lockmgr compatible lock, it can put an address of this lock to v_vnlock field. This indicates that the upper filesystem can take advantage of it and use single lock structure for entire (or part) of stack of vnodes. This field shouldn't be examined or modified by VFS code except for initialization purposes. Reviewed in general by: mckusick Notes: svn path=/head/; revision=66355
* Don't scan for the "right" network interface by shooting in the dark.Mike Smith2000-09-051-0/+3
| | | | | | | | Assume that the nfs_diskless structure is correctly set up; the provider ought to be getting it right. Notes: svn path=/head/; revision=65497
* This patch corrects the first round of panics and hangs reportedKirk McKusick2000-07-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with the new snapshot code. Update addaliasu to correctly implement the semantics of the old checkalias function. When a device vnode first comes into existence, check to see if an anonymous vnode for the same device was created at boot time by bdevvp(). If so, adopt the bdevvp vnode rather than creating a new vnode for the device. This corrects a problem which caused the kernel to panic when taking a snapshot of the root filesystem. Change the calling convention of vn_write_suspend_wait() to be the same as vn_start_write(). Split out softdep_flushworklist() from softdep_flushfiles() so that it can be used to clear the work queue when suspending filesystem operations. Access to buffers becomes recursive so that snapshots can recursively traverse their indirect blocks using ffs_copyonwrite() when checking for the need for copy on write when flushing one of their own indirect blocks. This eliminates a deadlock between the syncer daemon and a process taking a snapshot. Ensure that softdep_process_worklist() can never block because of a snapshot being taken. This eliminates a problem with buffer starvation. Cleanup change in ffs_sync() which did not synchronously wait when MNT_WAIT was specified. The result was an unclean filesystem panic when doing forcible unmount with heavy filesystem I/O in progress. Return a zero'ed block when reading a block that was not in use at the time that a snapshot was taken. Normally, these blocks should never be read. However, the readahead code will occationally read them which can cause unexpected behavior. Clean up the debugging code that ensures that no blocks be written on a filesystem while it is suspended. Snapshots must explicitly label the blocks that they are writing during the suspension so that they do not cause a `write on suspended filesystem' panic. Reorganize ffs_copyonwrite() to eliminate a deadlock and also to prevent a race condition that would permit the same block to be copied twice. This change eliminates an unexpected soft updates inconsistency in fsck caused by the double allocation. Use bqrelse rather than brelse for buffers that will be needed soon again by the snapshot code. This improves snapshot performance. Notes: svn path=/head/; revision=63788
* Correctly set the Maximum DHCP Message Size. bootpd now worksPaul Saab2000-06-131-1/+1
| | | | | | | again as well as ISC dhcpd. Notes: svn path=/head/; revision=61619
* Back out the previous change to the queue(3) interface.Jake Burkholder2000-05-267-62/+62
| | | | | | | | | It was not discussed and should probably not happen. Requested by: msmith and others Notes: svn path=/head/; revision=60938
* Change the way that the queue(3) structures are declared; don't assume thatJake Burkholder2000-05-237-62/+62
| | | | | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd Notes: svn path=/head/; revision=60833
* Include a RFC 1533 "Maximum DHCP Message Size" option in our request.Poul-Henning Kamp2000-05-071-5/+17
| | | | | | | | | ISC DHCP will limit the reply length to 64 bytes for bootp replies unless we explicitly tell it we can do more. We tell it that we can do 1200 bytes. Notes: svn path=/head/; revision=60141
* Separate the struct bio related stuff out of <sys/buf.h> intoPoul-Henning Kamp2000-05-054-0/+4
| | | | | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter Notes: svn path=/head/; revision=60041
* Remove unneeded #include <vm/vm_zone.h>Poul-Henning Kamp2000-04-302-2/+0
| | | | | | | Generated by: src/tools/tools/kerninclude Notes: svn path=/head/; revision=59794
* s/biowait/bufwait/gPoul-Henning Kamp2000-04-291-1/+1
| | | | | | | Prodded by: several. Notes: svn path=/head/; revision=59762
* Remove ~25 unneeded #include <sys/conf.h>Poul-Henning Kamp2000-04-192-2/+0
| | | | | | | Remove ~60 unneeded #include <sys/malloc.h> Notes: svn path=/head/; revision=59391
* Complete the bio/buf divorce for all code below devfs::strategyPoul-Henning Kamp2000-04-152-4/+4
| | | | | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS Notes: svn path=/head/; revision=59249
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.Poul-Henning Kamp2000-04-022-14/+20
| | | | | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde. Notes: svn path=/head/; revision=58934
* Add a sysctl to specify the amount of UDP receive space NFS shouldMatthew Dillon2000-03-271-8/+22
| | | | | | | | | | | | | | reserve, in maximal NFS packets. Originally only 2 packets worth of space was reserved. The default is now 4, which appears to greatly improve performance for slow to mid-speed machines on gigabit networks. Add documentation and correct some prior documentation. Problem Researched by: Andrew Gallatin <gallatin@cs.duke.edu> Approved by: jkh Notes: svn path=/head/; revision=58710
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()Poul-Henning Kamp2000-03-202-4/+4
| | | | | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts. Notes: svn path=/head/; revision=58349
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newPoul-Henning Kamp2000-03-203-15/+18
| | | | | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful. Notes: svn path=/head/; revision=58345
* Clean up some loose ends in the network code, including the X.25 and ISOPeter Wemm2000-02-132-30/+0
| | | | | | | | | | #ifdefs. Clean out unused netisr's and leftover netisr linker set gunk. Tested on x86 and alpha, including world. Approved by: jkh Notes: svn path=/head/; revision=57178
* The alpha build cuases the 'nfsuid bloated' warning to occur. Well,Matthew Dillon2000-01-134-47/+0
| | | | | | | | | | | there is nothing we can do about it. In fact, after further review there simply are not very many instances of the two structures NFS checks for 'bloat' so I've decided to simply rip the checks out entirely. Submitted by: Andrew Gallatin <gallatin@cs.duke.edu> Notes: svn path=/head/; revision=55934
* tcp updates to support IPv6.Yoshinobu Inoue2000-01-091-1/+1
| | | | | | | | | | also a small patch to sys/nfs/nfs_socket.c, as max_hdr size change. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=55679
* Enhance reassignbuf(). When a buffer cannot be time-optimally insertedMatthew Dillon2000-01-054-19/+81
| | | | | | | | | | | | | | | | | | | | | | into vnode dirtyblkhd we append it to the list instead of prepend it to the list in order to maintain a 'forward' locality of reference, which is arguably better then 'reverse'. The original algorithm did things this way to but at a huge time cost. Enhance the append interlock for NFS writes to handle intr/soft mounts better. Fix the hysteresis for NFS async daemon I/O requests to reduce the number of unnecessary context switches. Modify handling of NFS mount options. Any given user option that is too high now defaults to the kernel maximum for that option rather then the kernel default for that option. Reviewed by: Alfred Perlstein <bright@wintelcom.net> Notes: svn path=/head/; revision=55431
* Fix at least one source of the continued 'NFS append race'. close()Matthew Dillon2000-01-051-3/+21
| | | | | | | | | | | | | | | | | | was calling nfs_flush() and then clearing the NMODIFIED bit. This is not legal since there might still be dirty buffers after the nfs_flush (for example, pending commits). The clearing of this bit in turn prevented a necessary vinvalbuf() from occuring leaving left over dirty buffers even after truncating the file in a new operation. The fix is to simply not clear NMODIFIED. Also added a sysctl vfs.nfs.nfsv3_commit_on_close which, if set to 1, will cause close() to do a stage 1 write AND a stage 2 commit synchronously. By default only the stage 1 write is done synchronously. Reviewed by: Alfred Perlstein <bright@wintelcom.net> Notes: svn path=/head/; revision=55423
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-295-17/+17
| | | | | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come. Notes: svn path=/head/; revision=55206
* make getfh a standard syscall instead of dependant on havingAlfred Perlstein1999-12-211-14/+0
| | | | | | | | | | | NFSSERVER defined, useful for userland fileservers that want to use a filehandle type interface to the filesystem. Submitted by: Assar Westerlund assar@stacken.kth.se PR: kern/15452 Notes: svn path=/head/; revision=54970
* Second pass commit to introduce new ACL and Extended Attribute systemRobert Watson1999-12-191-0/+1
| | | | | | | | | | calls, vnops, vfsops, both in /kern, and to individual file systems that require a vfsop_ array entry. Reviewed by: eivind Notes: svn path=/head/; revision=54803
* M_PREPEND-related cleanups (unregisterifying struct mbuf *s).Brian Feldman1999-12-192-4/+3
| | | | Notes: svn path=/head/; revision=54799
* Introduce NDFREE (and remove VOP_ABORTOP)Eivind Eklund1999-12-154-40/+2
| | | | Notes: svn path=/head/; revision=54655
* Fix two problems: First, fix the append seek position race that canMatthew Dillon1999-12-143-46/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | occur due to np->n_size potentially changing if nfs_getcacheblk() blocks in nfs_write(). Second, under -current we must supply the proper bufsize when obtaining buffers that straddle the EOF, but due to the fact that np->n_size can change out from under us it is possible that we may specify the wrong buffer size and wind up truncating dirty data written by another process. Both problems are solved by implementing nfs_rslock(), which allows us to lock around sensitive buffer cache operations such as those that occur when appending to a file. It is believed that this race is responsible for causing dirtyoff/dirtyend and (in stable) validoff/validend to exceed the buffer size. Therefore we have now added a warning printf for the dirtyoff/end case in current. However, we have introduced a new problem which we need to fix at some point, and that is that soft or intr NFS mounts may become uninterruptable from the point of view of process A which is stuck waiting on rslock while process B is stuck doing the rpc. To unstick process A, process B would have to be interrupted first. Reviewed by: Alfred Perlstein <bright@wintelcom.net> Notes: svn path=/head/; revision=54605
* Fix a timeout deadlock that can occur when the process holding theMatthew Dillon1999-12-131-4/+24
| | | | | | | | | | receive lock hasn't yet managed to send its own request. PR: kern/15055 Submitted by: Ian Dowse iedowse@maths.tcd.ie Notes: svn path=/head/; revision=54536
* Fix a number of server-side issues related to aborting badly formedMatthew Dillon1999-12-121-0/+3
| | | | | | | | | | | NFS packets, mainly initializing structure pointers to NULL which are conditionally freed prior to return. PR: kern/15249 Submitted by: Ian Dowse <iedowse@maths.tcd.ie> Notes: svn path=/head/; revision=54485
* Synopsis of problem being fixed: Dan Nelson originally reported thatMatthew Dillon1999-12-123-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blocks of zeros could wind up in a file written to over NFS by a client. The problem only occurs a few times per several gigabytes of data. This problem turned out to be bug #3 below. bug #1: B_CLUSTEROK must be cleared when an NFS buffer is reverted from stage 2 (ready for commit rpc) to stage 1 (ready for write). Reversions can occur when a dirty NFS buffer is redirtied with new data. Otherwise the VFS/BIO system may end up thinking that a stage 1 NFS buffer is clusterable. Stage 1 NFS buffers are not clusterable. bug #2: B_CLUSTEROK was inappropriately set for a 'short' NFS buffer (short buffers only occur near the EOF of the file). Change to only set when the buffer is a full biosize (usually 8K). This bug has no effect but should be fixed in -current anyway. It need not be backported. bug #3: B_NEEDCOMMIT was inappropriately set in nfs_flush() (which is typically only called by the update daemon). nfs_flush() does a multi-pass loop but due to the lack of vnode locking it is possible for new buffers to be added to the dirtyblkhd list while a flush operation is going on. This may result in nfs_flush() setting B_NEEDCOMMIT on a buffer which has *NOT* yet gone through its stage 1 write, causing only the commit rpc to be made and thus causing the contents of the buffer to be thrown away (never sent to the server). The patch also contains some cleanup, which only applies to the commit into -current. Reviewed by: dg, julian Originally Reported by: Dan Nelson <dnelson@emsphone.com> Notes: svn path=/head/; revision=54480
* Lock reporting and assertion changes.Eivind Eklund1999-12-112-1/+2
| | | | | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter Notes: svn path=/head/; revision=54444
* The symlink implementation could improperly return a NULL vp along withMatthew Dillon1999-11-301-3/+33
| | | | | | | | | | | | | | | | | | | | | | | a 0 error code. The problem occured with NFSv2 mounts and also with any NFSv3 mount returning an EEXIST error (which is translated to 0 prior to return). The reply to the rpc only contains the file handle for the no-error case under NFSv3. The error case under NFSv3 and all cases under NFSv2 do *not* return the file handle. The fix is to do a secondary lookup to obtain the file handle and thus be able to generate a return vnode for the situations where the rpc reply does not contain the required information. The bug was originally introduced when VOP_SYMLINK semantics were changed for -CURRENT. The NFS symlink implementation was not properly modified to go along with the change despite the fact that three people reviewed the code. It took four attempts to get the current fix correct with five people. Is NFS obfuscated? Ha! Reviewed by: Alfred Perlstein <bright@wintelcom.net> Testing and Discussion: "Viren R.Shah" <viren@rstcorp.com>, Eivind Eklund <eivind@FreeBSD.ORG>, Ian Dowse <iedowse@maths.tcd.ie> Notes: svn path=/head/; revision=53937
* Remap the error EEXISTS => 0 *before* using error to determine if we shouldEivind Eklund1999-11-271-7/+9
| | | | | | | return a vp. Notes: svn path=/head/; revision=53776