summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* Remove the 'waslocked' parameter to vfs_object_create().eivind1999-01-051-2/+2
|
* Silence -Wtrigraph.hoek1998-12-301-4/+4
| | | | Submitted by: Bradley Dunn <bradley@dunn.org> (pr: kern/8817)
* Fix for creating files on a Solaris 7 server with NFSv3 (the request wasdfr1998-12-252-90/+77
| | | | | | slightly garbled but older servers seemed to understand it). Reviewed by: David O'Brien <obrien@nuxi.ucdavis.edu>
* Added 3 new errno values, requred by various standards: EOVERFLOW,dt1998-12-141-2/+3
| | | | | | | ECANCELED, EILSEQ. Fixed ibcs2 and especially linux EIDRM and ENOMSG errno mapping. Reviewed by: Dan Nelson <dnelson@emsphone.com>
* (Hopefully) fix support for "large" files. Mostly cast block numbers to off_tdt1998-12-141-13/+13
| | | | before they multiplied to block sizes.
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-075-14/+6
| | | | and local variables, goto labels, and functions declared but not defined.
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-042-6/+7
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* Make bootp error message slightly more verbosedillon1998-12-031-2/+2
|
* Reimplement the NFS ACCESS RPC cache as an "accelerator" rather than a truemsmith1998-11-152-44/+14
| | | | | | | | | | | | | | | | | | | | cache. If the cached result lets us say "yes", then go with that. If we're not sure, or we think the answer might be "no", go to the wire to be certain. This avoids all of the possible false veto cases, and allows us to key the cached value with just the UID for which the cached value holds, reducing the bloat of the nfsnode structure from 104 bytes to just 12 bytes. Since the "yes" case is by far the most common, this should still provide a substantial performance improvement. Also default the cache to on, with a conservative timeout (2 seconds). This improves performance if NFS is loaded as a KLD module, as there's not (yet) code to parse an option out of the module arguments to set it, and sysctl doesn't work (yet) for OIDs in modules. The 'accelerator' mode was suggested by Bjoern Groenvall (bg@sics.se) Feedback on this would be appreciated as testing has been necessarily limited by Comdex, and it would be valuable to have this in 2.2.8.
* Avoid a null pointer reference if the target of an NFS rename has beenmsmith1998-11-131-7/+10
| | | | | | sillrenamed, or if the source vnode doesn't have an associated nfsnode. Bug report from Andrew Gallatin <gallatin@cs.duke.edu>
* Fix a panic in nfsrv_dorec() where a NULL pointer could be passed todfr1998-11-131-2/+4
| | | | | | free() sometimes. Reviewed by: Eric Haug <ejh@eas.slu.edu>
* Implement NFS ACCESS RPC result caching.msmith1998-11-132-24/+98
| | | | | | | | | | | | | | | | | | This yields startling performance increases for NFS clients for many access profiles, due to the fact that ACCESS results are persistently cached in the namecache in many cases. Note that the code is somewhat conservative in that it requires an exact credential match for a cache hit. This bloats the nfsnode structure by sizeof(struct ucred) (96 bytes). Any less conservative approach opens the possibility for a false veto in eg. setuid applications. Alternative suggestions would be welcomed. The cache is normally disabled, to activate set the sysctl variable vfs.nfs.access_cache_timeout to a nonzero value. This is the time in seconds that a cached entry will be considered valid; useful values appear to be 2-10 seconds. Performance of the cache can be monitored with the vfs.nfs.access_cache_hits and vfs.nfs.access_cache_hits variables.
* Remove [apparently] bogus casts to u_long for the vnode_pager_setsize()peter1998-11-093-9/+9
| | | | | | | second argument. np_size is a 64 bit int, so is the second arg. This might have caused needless 2G/4G file size problems. I believe it was Bruce who queried this.
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagspeter1998-10-313-13/+13
| | | | rather than abusing the list next pointer with a magic number.
* In nfs_link(), check for a cross-device mount *before* lookingmckusick1998-09-291-2/+3
| | | | | in the v_data field. Obtained from: Charles Hannum, via Frank van der Linden <frank@wins.uva.nl>
* Missing vput when cross-device link error is detected in nfs_link.mckusick1998-09-291-0/+1
|
* During truncation, have to notify the VM about the new sizemckusick1998-09-291-3/+5
| | | | | of the NFS file *before* doing the nfs_vinvalbuf operation. Otherwise some invalid data may show up in an mmap.
* Frank sez: 'It fixes a problem with servers that return 0 valuesmckusick1998-09-291-7/+10
| | | | | | | | for some of the fsinfo RPC fields. It is strictly speaking not wrong to do this, as the spec says that "it is expected that a server will make a best effort at supporting all the attributes", but pretty unusual. You guessed it, it's NT servers that do it.' Obtained from: Frank van der Linden <frank@wins.uva.nl>
* Do not need (or want) to take a reference on an NFS file thatmckusick1998-09-291-6/+12
| | | | | | | | | is being deleted due to an forcible unmount. The problem is that vgone calls vclean() which then calls calls nfs_inactive() with VXLOCK set on the vnode. Nfs_inactive() was calling vget() to get a reference on the vnode, which in turn hung on VXLOCK. Nfs_inactive() now checks v_usecount to make sure that the vnode is not coming from vclean() before it does a vget().
* The code checks each fragment mark to see if it's valid; if the fragmentmckusick1998-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | is less than NFS_MINPACKET or greater than NFS_MAXPACKET in size, it barfs and, I think, drops the connection. However, there's no guarantee that in a multi-fragment RPC, all the fragments will be at least as large as NFS_MINPACKET. In fact, with the version of "tclnfs" we have here, which supports NFS over TCP, at least when built under SunOS 4.1.3 (i.e., with 4.1.3's user-mode ONC RPC library), I can *repeatably* cause "tclnfs" to send a request with more than one fragment, one of which is only 8 bytes long. I just do a 3877-byte write to a file, at an offset of 0. The check that "slp->ns_reclen" is greater than or equal to NFS_MINPACKET serves no useful purpose - if the NFS server code can't handle packets < NFS_MINPACKET bytes, it can't handle them over *any* protocol, so the check has to be done above the RPC-over-TCP layer - and should be removed. Obtained from: Fix from Guy Harris, forwarded by Rick Macklem.
* Mark directory buffers that have no valid data with B_INVALmckusick1998-09-291-1/+6
| | | | so that they are not put in the cache.
* When adding data to a buffer, we need to clear the B_NEEDCOMMIT flagmckusick1998-09-291-1/+2
| | | | which says that the data is on server but not committed.
* Removed statically configured mount type numbers (MOUNT_*) and allbde1998-09-071-4/+4
| | | | | | | | | references to them. The change a couple of days ago to ignore these numbers in statically configured vfsconf structs was slightly premature because the cd9660, cfs, devfs, ext2fs, nfs vfs's still used MOUNT_* instead of the number in their vfsconf struct.
* Made unloading of the nfs LKM sort of work. This is mainly to testbde1998-09-076-10/+53
| | | | | | detachment of vfs sysctls. Unloading of vfs LKMs doesn't actually work for any vfs, since it leaves garbage pointers to memory allocation control structures.
* Ignore the statically configured vfs type numbers and assign vfsbde1998-09-051-2/+4
| | | | | | | | | | | type numbers in vfs attach order (modulo incomplete reuse of old numbers after vfs LKMs are unloaded). This requires reinitializing the sysctl tree (or at least the vfs subtree) for vfs's that support sysctls (currently only nfs). sysctl_order() already handled reinitialization reasonably except it checked for annulled self references in the wrong place. Fixed sysctls for vfs LKMs.
* Instantiate `nfs_mount_type' in a standard file so that it is presentbde1998-09-051-2/+1
| | | | | | | | when nfs is an LKM. Declare it in a header file. Don't forget to use it in non-Lite2 code. Initialize it to -1 instead of to 0, since 0 will soon be the mount type number for the first vfs loaded. NetBSD uses strcmp() to avoid this ugly global.
* Cosmetic changes to the PAGE_XXX macros to make them consistent withdfr1998-09-041-2/+2
| | | | the other objects in vm.
* Check for NULL pointer before freeing a struct sockaddr. m_freem() can handleluoqi1998-09-011-2/+3
| | | | NULL, buf free() can't.
* Yow! Completely change the way socket options are handled, eliminatingwollman1998-08-237-75/+85
| | | | | | another specialized mbuf type in the process. Also clean up some of the cruft surrounding IPFW, multicast routing, RSVP, and other ill-explored corners.
* Fixed printf format errors.bde1998-08-182-6/+6
|
* Protect all modifications to v_numoutput with splbio().dfr1998-08-131-2/+2
|
* Don't configure compatibility code for pre-Lite2 mount() calls bybde1998-08-121-4/+4
| | | | default. This code should go away soon.
* If we get an ENOBUFS from the network, it's normally transient networkpeter1998-08-011-1/+11
| | | | | | | | | interface congestion (eg: nfs over a ppp link, etc). Don't log these for UDP mounts, and don't cause syscalls to fail with EINTR. This stops the 'nfs send error 55' warnings. If the error is because the system is really hosed, this is the least of your problems...
* Cast pointers to uintptr_t/intptr_t instead of to u_long/long,bde1998-07-151-3/+3
| | | | | | | respectively. Most of the longs should probably have been u_longs, but this changes is just to prevent warnings about casts between pointers and integers of different sizes, not to fix poorly chosen types.
* VOP_STRATEGY grows an (struct vnode *) argumentjulian1998-07-041-2/+2
| | | | | | as the value in b_vp is often not really what you want. (and needs to be frobbed). more cleanups will follow this. Reviewed by: Bruce Evans <bde@freebsd.org>
* fix buildworld hopefully be3fore anyone complains...jmg1998-06-303-3/+9
| | | | | | | | NFS_*TIMO should possibly be converted to sysctl vars (jkh's suggestion), but in some cases it looks like nfs keeps a copy of the value in a struct hash sizes are already ifdef'd KERNEL, so there aren't userland inpact from them...
* convert some nfs tunables to options, these are:jmg1998-06-303-3/+9
| | | | | | | | | | | | | | | | NFS_MINATTRTIMO VREG attrib cache timeout in sec NFS_MAXATTRTIMO NFS_MINDIRATTRTIMO VDIR attrib cache timeout in sec NFS_MAXDIRATTRTIMO NFS_GATHERDELAY Default write gather delay (msec) NFS_UIDHASHSIZ Tune the size of nfssvc_sock with this NFS_WDELAYHASHSIZ and with this NFS_MUIDHASHSIZ Tune the size of nfsmount with this NFS_NOSERVER (already documented in LINT) NFS_DEBUG turn on NFS debugging also, because NFS_ROOT is used by very different files, it has been renamed to opt_nfsroot.h instead of the old opt_nfs.h....
* Fixed typo in ifdefed code. (NFS_ACDEBUG is not in LINT. Therefore,bde1998-06-211-2/+2
| | | | code controlled by it did not even compile.)
* Avoid an egcs pessimization for 64-bit signed division on i386's.bde1998-06-142-6/+6
| | | | | | | | | Pre-2.8 versions of gcc generate a call to __divdi3() for all 64-bit signed divisions, but egcs optimizes them to a shift and fixup when the divisor is a constant power of 2. Unfortunately, it generates a call to __cmpdi2() for the fixup, although all except possibly ancient versions of gcc and egcs do ordinary 64-bit comparisons inline.
* This commit fixes various 64bit portability problems required fordfr1998-06-072-5/+5
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Make sure we go a nfs_fsinfo() in get/putpages before callingpeter1998-06-011-30/+70
| | | | | | | | readrpc/writerpc, since they assume it's already been done. This could break if the first read/write access to a nfs filesystem was an exec() or mmap() instead of a read(), write() syscall. (or statfs()). nfs_getpages() could return an errno (EOPNOTSUPP) instead of a VM_PAGER_* return code. Some layout tweaks for the get/putpages code.
* Fix post-test pre-commit cleanup typo.peter1998-06-011-2/+2
|
* readlink() returns EINVAL rather than EPERM if called on a non-symlink.peter1998-06-011-2/+2
|
* Preset the maximum file size before we get to nfs_fsinfo(), based onpeter1998-06-011-8/+14
| | | | | | | | | | an (over?) conservative assumption about what the client can store in it's buffer cache using a signed 32-bit 512-byte block number index. Otherwise it's possible for some file access when maxfilesize = 0 (eg: /usr is nfs mounted and doing an execve()) Pointed out by: bde XXX It might make sense to do a preemptive nfs_fsinfo() call at mount time.
* For the on-the-wire protocol, u_long -> u_int32_t; long -> int32_t;peter1998-05-319-287/+296
| | | | | | | int -> int32_t; u_short -> u_int16_t. Also, use mode_t instead of u_short for storing modes (mode_t is a u_int16_t). Obtained from: NetBSD
* Support 'mount -u' remounts. This may require disconnecting and rebindingpeter1998-05-315-106/+178
| | | | | | the socket. Certain mode changes are not allowed. Obtained from: NetBSD
* xdr encode -1 properly.peter1998-05-311-2/+2
| | | | Obtained from: NetBSD
* Fully fill in nfsv2 write rpc requests rather than leaving garbage.peter1998-05-311-4/+11
| | | | Obtained from: NetBSD
* Don't silently fail to set file flags.peter1998-05-311-1/+8
| | | | Obtained from: NetBSD
* Don't blindly accept the server's preferences if they are too small.peter1998-05-311-3/+3
| | | | Obtained from: NetBSD
OpenPOWER on IntegriCloud