summaryrefslogtreecommitdiffstats
path: root/sys/nfs
Commit message (Collapse)AuthorAgeFilesLines
* select -> pollpeter1997-09-141-19/+18
| | | | flag missing vnode op table entries
* Don't repeat checks done at general level.phk1997-09-101-8/+3
|
* Remove a couple of stubborn NetBSD #if's.phk1997-09-102-15/+2
|
* unifdef -U__NetBSD__ -D__FreeBSD__phk1997-09-107-67/+7
|
* Removed more vestiges of config-time swap configuration.bde1997-09-072-6/+4
|
* Added used #include - don't depend on <sys/mbuf.h> includingbde1997-09-025-5/+10
| | | | <sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).
* Uncut&paste cache_lookup().phk1997-08-261-53/+5
| | | | | | | | | | | | | | | This unifies several times in theory indentical 50 lines of code. The filesystems have a new method: vop_cachedlookup, which is the meat of the lookup, and use vfs_cache_lookup() for their vop_lookup method. vfs_cache_lookup() will check the namecache and pass on to the vop_cachedlookup method in case of a miss. It's still the task of the individual filesystems to populate the namecache with cache_enter(). Filesystems that do not use the namecache will just provide the vop_lookup method as usual.
* Fix all areas of the system (or at least all those in LINT) to avoid storingwollman1997-08-1614-240/+260
| | | | | | | | socket addresses in mbufs. (Socket buffers are the one exception.) A number of kernel APIs needed to get fixed in order to make this happen. Also, fix three protocol families which kept PCBs in mbufs to not malloc them instead. Delete some old compatibility cruft while we're at it, and add some new routines in the in_cksum family.
* Removed unused #includes.bde1997-08-023-14/+3
|
* Correct some dumb mistakes in the WebNFS stuff.dfr1997-07-222-16/+32
| | | | Submitted by: bde
* Allow NULL cookie verifiers for non-NULL offsets. This is needed fordfr1997-07-221-3/+3
| | | | Digital Unix boxes since they appear to always send null verifiers.
* Merge WebNFS changes from NetBSD.dfr1997-07-168-121/+513
| | | | Obtained from: NetBSD
* Fix a condition where nfs_statfs() can precipitate a panic. There iswpaul1997-06-271-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code that says this: nfsm_request(vp, NFSPROC_FSSTAT, p, cred); if (v3) nfsm_postop_attr(vp, retattr); if (!error) nfsm_dissect(sfp, struct nfs_statfs *, NFSX_STATFS(v3)); The problem here is that if error != 0, nfsm_dissect() will not be called, which leaves sfp == NULL. But nfs_statfs() does not bail out at this point: it continues processing until it tries to dereference sfp, which causes a panic. I was able to generate this crash under the following conditions: 1) Set up a machine as an NFS server and NFS client, with amd running (using NIS maps). /usr/local is exported, though any exported fs can can be used to trigger the bug. 2) Log in as normal user, with home directory mounted from a SunOS 4.1.3 NFS server via amd (along with a few other NFS filesystems from same machine). 3) Su to root and type the following: # mount localhost:/usr/local /mnt # df To fix the panic, I changed the code to read: if (!error) { nfsm_dissect(sfp, struct nfs_statfs *, NFSX_STATFS(v3)); } else goto nfsmout; This is a bit kludgy in that nfsmout is a label defined by the nfsm_subs.h macros, but these macros are themselves more than a little kludgy. This stops the machine from crashing, but does not fix the overall bug: 'error' somehow becomes 5 (EIO) when a statfs() is performed on the locally mounted NFS filesystem. This seems to only happen the first time the filesystem is accesed: on subsequent accesses, it seems to work fine again. Now, I know there's no practical use in mounting a local filesystem via NFS, but doing it shouldn't cause the system to melt down.
* Clear nfs_iodwant[myiod] when the nfsiod process exits due to a signal.tegge1997-06-251-1/+2
|
* Avoid small synchronous writes when an application does lots of random-accessdfr1997-06-251-19/+115
| | | | short writes within a block (e.g. ld).
* Make nfs_lookup return a NULLVP on error so that DIAGNOSTIC kernels don'tdfr1997-06-251-4/+8
| | | | panic.
* Upgrade NFS to support the new vfs_bio resource/buffer management.dyson1997-06-162-2/+14
|
* Don't require superuser privileges for creating fifos. The v2 case wasbde1997-06-141-3/+4
| | | | | | | | | broken when support for v3 was introduced in rev.1.16. The v3 case has always been broken in FreeBSD. Should be in 2.2. PR: 3838
* Move commonly used code into static functions in order to reduce kernel bloat.tegge1997-06-121-139/+93
|
* Remove unused routines.tegge1997-06-122-100/+2
|
* Fix a problem caused by removing large numbers of files from a directorydfr1997-06-061-2/+6
| | | | which could cause a bad size to be given to uiomove, causing a page fault.
* Various fixes from NetBSD:dfr1997-06-036-21/+32
| | | | | | | | | Use u_int for rpc procedure numbers. Some fixes to NQNFS. A rare NULL pointer dereference. Ignore NFSMNT_NOCONN for TCP mounts. Obtained from: NetBSD
* Implement the async mount option for NFSv3. This makes NFS pretend that alldfr1997-06-032-3/+8
| | | | | | | | | writes sent to the server were synchronous and therefore no commits are needed. This is the same as the vfs.nfs.async variable on the server but allows each client to choose whether to work this way. Also make the vfs.nfs.async variable do the 'right' thing for NFSv3, i.e. pretend that the write was synchronous.
* Fix a problem with nfs_flush where if many B_NEEDCOMMIT buffers aredfr1997-06-031-8/+50
| | | | | | | | | attached to the vnode, some of them could be re-written synchronously (if they overflowed the fixed size array nfs_flush had for them). The fix involves mallocing an array if there are more than its limited size stack buffer. Reviewed by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
* Fix some performance problems with the NFS mmap fixes.dfr1997-06-031-4/+4
|
* Plug a memory leak in nfs_link.dfr1997-05-201-2/+2
| | | | PR: kern/1001
* Fix a few bugs with NFS and mmap caused by NFS' use of b_validoffdfr1997-05-194-9/+92
| | | | | | | | and b_validend. The changes to vfs_bio.c are a bit ugly but hopefully can be tidied up later by a slight redesign. PR: kern/2573, kern/2754, kern/3046 (possibly) Reviewed by: dyson
* Remove redundant check for vp == dvp (done in VFS before calling).phk1997-05-171-7/+1
|
* Use same syntax as netboot for root and swap mounts.tegge1997-05-141-163/+155
| | | | | Handle mount options. Ignore T16 (swap server address) and T6 (DNS server).
* Check the B_CLUSTER flag when choosing whether to use unstable or filesyncdfr1997-05-131-2/+2
| | | | | | | writes. PR: kern/3438 Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
* Don't keep addresses in mbuf chains. This should simplify the next rounddfr1997-05-133-38/+53
| | | | | | of network changes from Garret. Reviewed by: Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
* Use the old nfs arguments in the nfs_diskless structure, to betegge1997-05-122-51/+58
| | | | | | compatible with boot proms made from the 2.2 source. Convert the nfs arguments when copying to the new diskless structure. Copy the gateway field in the diskless structure.
* Bring in some kernel bootp support. This removes the need for netboottegge1997-05-115-16/+1985
| | | | | | | | to fill in the nfs_diskless structure, at the cost of some kernel bloat. The advantage is that this code works on a wider range of network adapters than netboot. Several new kernel options are documented in LINT. Obtained from: parts of the code comes from NetBSD.
* Implement a separate control for write gathering on NFSv3. This is turneddfr1997-05-102-4/+14
| | | | | | | off for NFSv3 by default since write gathering seems to reduce performance for NFSv3 by up to 60%. Add sysctl knobs to control both variables.
* Fix a nasty hang connected with write gathering. Also add debug printdfr1997-05-104-20/+42
| | | | statements to bits of the server which helped me find the hang.
* Prevent a mapped root which appears on the server as e.g. nobody fromdfr1997-05-091-3/+47
| | | | | | | | | accessing files which it shouldn't be able to. This required a better approximation of VOP_ACCESS for NFSv2 (NFSv3 already has an ACCESS rpc which is a better solution) and adding a call to VOP_ACCESS from VOP_LOOKUP. PR: kern/876, kern/2635 Submitted by: David Malone <dwmalone@maths.tcd.ie> (for kern/2635)
* Fix memory leak caused by the fact that the directory offset cookies anddfr1997-05-091-4/+4
| | | | the sillyrename information are stored in the same place.
* Now I can even execute "df" on my diskless :-)phk1997-05-041-31/+32
|
* 1. Add a {pointer, v_id} pair to the vnode to store the reference to thephk1997-05-041-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ".." vnode. This is cheaper storagewise than keeping it in the namecache, and it makes more sense since it's a 1:1 mapping. 2. Also handle the case of "." more intelligently rather than stuff the namecache with pointless entries. 3. Add two lists to the vnode and hang namecache entries which go from or to this vnode. When cleaning a vnode, delete all namecache entries it invalidates. 4. Never reuse namecache enties, malloc new ones when we need it, free old ones when they die. No longer a hard limit on how many we can have. 5. Remove the upper limit on namelength of namecache entries. 6. Make a global list for negative namecache entries, limit their number to a sysctl'able (debug.ncnegfactor) fraction of the total namecache. Currently the default fraction is 1/16th. (Suggestions for better default wanted!) 7. Assign v_id correctly in the face of 32bit rollover. 8. Remove the LRU list for namecache entries, not needed. Remove the #ifdef NCH_STATISTICS stuff, it's not needed either. 9. Use the vnode freelist as a true LRU list, also for namecache accesses. 10. Reuse vnodes more aggresively but also more selectively, if we can't reuse, malloc a new one. There is no longer a hard limit on their number, they grow to the point where we don't reuse potentially usable vnodes. A vnode will not get recycled if still has pages in core or if it is the source of namecache entries (Yes, this does indeed work :-) "." and ".." are not namecache entries any longer...) 11. Do not overload the v_id field in namecache entries with whiteout information, use a char sized flags field instead, so we can get rid of the vpid and v_id fields from the namecache struct. Since we're linked to the vnodes and purged when they're cleaned, we don't have to check the v_id any more. 12. NFS knew about the limitation on name length in the namecache, it shouldn't and doesn't now. Bugs: The namecache statistics no longer includes the hits for ".." and "." hits. Performance impact: Generally in the +/- 0.5% for "normal" workstations, but I hope this will allow the system to be selftuning over a bigger range of "special" applications. The case where RAM is available but unused for cache because we don't have any vnodes should be gone. Future work: Straighten out the namecache statistics. "desiredvnodes" is still used to (bogusly ?) size hash tables in the filesystems. I have still to find a way to safely free unused vnodes back so their number can shrink when not needed. There is a few uses of the v_id field left in the filesystems, scheduled for demolition at a later time. Maybe a one slot cache for unused namecache entries should be implemented to decrease the malloc/free frequency.
* Make nfs roots (diskless) functional again. It may still not be correct,phk1997-05-031-1/+5
| | | | but it is functional.
* Allow NULL rpcs on non-privileged ports at all times to work around brokendfr1997-04-301-2/+3
| | | | | | | clients. PR: kern/3298 Submitted by: Tor Egge <Tor.Egge@idi.ntnu.no>
* The long-awaited mega-massive-network-code- cleanup. Part I.wollman1997-04-272-25/+35
| | | | | | | | | | | | | | | | | | | | | | | | This commit includes the following changes: 1) Old-style (pr_usrreq()) protocols are no longer supported, the compatibility glue for them is deleted, and the kernel will panic on boot if any are compiled in. 2) Certain protocol entry points are modified to take a process structure, so they they can easily tell whether or not it is possible to sleep, and also to access credentials. 3) SS_PRIV is no more, and with it goes the SO_PRIVSTATE setsockopt() call. Protocols should use the process pointer they are now passed. 4) The PF_LOCAL and PF_ROUTE families have been updated to use the new style, as has the `raw' skeleton family. 5) PF_LOCAL sockets now obey the process's umask when creating a socket in the filesystem. As a result, LINT is now broken. I'm hoping that some enterprising hacker with a bit more time will either make the broken bits work (should be easy for netipx) or dike them out.
* Fix broken usage of nm_readdirsize and increase the socket buffers for UDPdfr1997-04-222-13/+8
| | | | | | | | | to prevent possible socket overflows. 2.2 candidate. PR: kern/3304 Reviewed by: Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
* Fix a bug where a program which appended many small records to a file coulddfr1997-04-191-1/+3
| | | | | | | | | | | | | wind up writing zeros instead of real data when the file is on an NFSv2 mounted directory. While tracking this bug down, I noticed that nfs_asyncio was waking *all* the iods when a block was written instead of just one per block. Fixing this gives a 25% performance improvment for writes on v2 (less for v3). Both are 2.2 candidates. PR: kern/2774
* Don't allow partial buffers to be cluster-comitted.dfr1997-04-181-4/+7
| | | | | | | Zero the b_dirty{off,end} after cluster-comitting a group of buffers. With these fixes, I was able to complete a 'make world' with remote src and obj directories.
* Fix various bugs in the locking protocol, allowing proper shared locksdfr1997-04-045-24/+7
| | | | to be used. This should fix the lock panics that people are seeing.
* The code which recovered from a modified directory situation did not checkdfr1997-04-031-1/+8
| | | | | for eof when re-caching the directory. This could cause it to loop forever if a directory was truncated.
* Removed #include of <ufs/ufs/dir.h>. Nfs no longer depends on any ufsbde1997-03-292-4/+2
| | | | | features, and the one thing that it depended on (DIRBLKSIZ) now has conflicting spelling.
* Define our own version of DIRBLKSIZ instead of (ab)using ufs's value.bde1997-03-291-43/+5
| | | | | | | | | | | | | | | | | | | Use the same value of 512 (ufs actually uses DEV_BSIZE). There are too many versions of DIRBLKSIZ, one for ufs, one for ext2fs, one for nfs, one for ibcs2, one for linux, one for applications, ... I think nfs's DIRBLKSIZ needs to be a divisor of the directory blocks sizes of all supported file systems. There is also NFS_DIRBLKSIZ, which is different from nfs's DIRBLKSIZ but is sometimes confused with it in comments. Removed a bogus #ifdef KERNEL that hid the tunable constants for nfs. This came in undocumented with the Lite2 merge although it isn't in Lite2. It required more-bogus #define KERNEL's in fstat and pstat to make the constants visible. Restored a spelling fix from rev.1.17. Removed duplicate #defines of all the the NFS mount option flags.
* Add code that will reject nfs requests in teh kernel from nonprivilegedguido1997-03-272-2/+25
| | | | | | ports. This option will be automatically set/cleraed when mount is run without/with the -n option. Reviewed by: Doug Rabson
OpenPOWER on IntegriCloud