summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* If the NFS/TCP stream is out of sync between the client and server,ps2005-01-051-1/+1
| | | | | | | | and if the client (erroneously) reads the RPC length as 0 bytes, the client can loop around in the socket callback. Explicitly check for the length being 0 case and teardown/re-connect. Submitted by: Mohan Srinivasan
* Turn NFS directio off until the stability issues are resolved.ps2004-12-231-1/+1
|
* Change the NFS sillyrename convention so that we won't run outps2004-12-162-12/+18
| | | | | | | | | | | | of sillyrenames (which were limited to 58 per pid per directory, for no good reason). The new format of sillyrenames looks like .nfs.0000b31a.00d24.4 ^^^^^^^^ ^^^^^ ticks pid Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* First cut of NFS direct IO support.ps2004-12-156-4/+228
| | | | | | | | | | | | | | - NFS direct IO completely bypasses the buffer and page caches. If a file is open for direct IO all caching is disabled. - Direct IO for Directories will be addressed later. - 2 new NFS directio related sysctls are added. One is a knob to disable NFS direct IO completely (direct IO is enabled by default). The other is to disallow mmaped IO on a file that has at least one O_DIRECT open (see the comment in nfs_vnops.c for more details). The default is to allow mmaps on a file that has O_DIRECT opens. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* Revert rev 1.233. The null-pointer function call (a dereference onmarcel2004-12-111-3/+3
| | | | | | | | | ia64) was not the result of a change in the vector operations. It was caused by the NFS locking code using a FIFO and those bypassing the vnode. This indirectly caused the panic. The NFS locking code has been changed. Requested by: phk
* In nfs_rename(), skip the otw rename operation if the fsync (tops2004-12-101-3/+10
| | | | | | | | either src or dst) fails. This closes a potential data loss case (where the fsync failed with ENOSPC, for example). Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* Store a hint in the nfsnode to detect sequential access of the file.ps2004-12-103-1/+6
| | | | | | | | Kick off a readahead only when sequential access is detected. This eliminates wasteful readaheads in random file access. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Obtained from: Yahoo!
* Fix for a Lock Order Reversal in the nfs_flush() path, between theps2004-12-071-4/+8
| | | | | | | vnode interlock and the proc lock. Reported by: marcel Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Don't clobber mnt_stat.f_mntonnamephk2004-12-071-13/+8
|
* The remaining part of nmount/omount/rootfs mount changes. I cannot sensiblyphk2004-12-071-21/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | split the conversion of the remaining three filesystems out from the root mounting changes, so in one go: cd9660: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() nfs(client): Convert to nmount (the simple way, mount_nfs(8) is still necessary). Add omount compat shims. Drop COMPAT_PRELITE2 mount arg compatibility. ffs: Convert to nmount. Add omount compat shims. Remove dedicated rootfs mounting code. Use vfs_mountedfrom() Rely on vfs_mount.c calling VFS_STATFS() Remove vfs_omount() method, all filesystems are now converted. Remove MNTK_WANTRDWR, handling RO/RW conversions is a filesystem task, and they all do it now. Change rootmounting to use DEVFS trampoline: vfs_mount.c: Mount devfs on /. Devfs needs no 'from' so this is clean. symlink /dev to /. This makes it possible to lookup /dev/foo. Mount "real" root filesystem on /. Surgically move the devfs mountpoint from under the real root filesystem onto /dev in the real root filesystem. Remove now unnecessary getdiskbyname(). kern_init.c: Don't do devfs mounting and rootvnode assignment here, it was already handled by vfs_mount.c. Remove now unused bdevvp(), addaliasu() and addalias(). Put the few necessary lines in devfs where they belong. This eliminates the second-last source of bogo vnodes, leaving only the lemming-syncer. Remove rootdev variable, it doesn't give meaning in a global context and was not trustworth anyway. Correct information is provided by statfs(/).
* Always issue wakeups() to the NFS requestors under the mutexps2004-12-071-7/+17
| | | | | | to close all potential cases of missed wakeups. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Rewrite of the NFS client's reply handling. We now have NFS socketps2004-12-068-418/+571
| | | | | | | | upcalls which do RPC header parsing and match up the reply with the request. NFS calls now sleep on the nfsreq structure. This enables us to eliminate the NFS recvlock. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* 2 fixes that improve on the consistency of the NFS client cache.ps2004-12-064-17/+24
| | | | | | | | | | | - Change the cached mtime to a 'struct timespec' from a time_t. Improving the precision of the cached mtime tightens up NFS' "close-to-open" consistency considerably. - Always force an over-the-wire consistency check from nfs_open() (unless the file is marked modified). This further improves NFS' "close-to-open" consistency. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Serialize NFS vinvalbuf operations by acquiring/upgrading to theps2004-12-064-31/+24
| | | | | | | | | | | | | vnode EXCLUSIVE lock. This prevents threads from adding pages to the vnode while an invalidation is in progress, closing potential races. In the bioread() path, callers acquire the SHARED vnode lock - so while an invalidate was in progress, it was possible to fault in new pages onto the vnode causing the invalidation to take a while or fail. We saw these races at Yahoo! with very large files+heavy concurrent access. Forcing an upgrade to EXCLUSIVE lock before doing the invalidation closes all these races. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Add non-blocking versions of nfsm_dissect() and friends, for use fromps2004-12-061-1/+1
| | | | | | | | | socket callbacks or similar callers, from both the NFS client and the server. Instituted nfsm_dissect_nonblock(), nfsm_dissect_xx_nonblock(). And nfsm_disct() now takes an extra M_TRYWAIT/M_DONTWAIT argument. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* - If all data has been committed to stable storage on the server, itps2004-12-061-3/+7
| | | | | | | | | | is safe to turn off the nfsnode's NMODIFIED flag. - Move the check for signals to the top of the loop where we loop around the dirty buffers on the vnode, scheduling writes. This ensures that we'll break ouf of the flush operation on reception of a signal. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com
* Correct a typo in a comment.rwatson2004-12-061-1/+1
|
* For reasons unknown, the nfs locking code used a fifo to send requests tophk2004-12-065-88/+159
| | | | | | | | | | | | | userland and a dedicated system call to get replies. The vnode-bypass of fifos broke this into a panic. Ditch all the magic and create a device /dev/nfslock instead, and use that for both directions apart from the shorter path, this is also faster because the device driver runs Giant free using the vnode bypass. Noticed by: marcel
* Convert GIANT_REQUIRED; in nfs_mountroot() to NET_ASSERT_GIANT(),rwatson2004-12-051-1/+6
| | | | | | | | | and annotate that nfs_mountroot assumes it is OK to step on the values in the global NFSv3 diskless structure as the mountroot function is called during a serialized part of the boot, before any other NFS client activity occurs. MFC after: 2 weeks
* Convert a GIANT_REQUIRED; into a NET_ASSERT_GIANT();, as sockets arerwatson2004-12-051-1/+1
| | | | now only conditionally protected by Giant based on debug.mpsafenet.
* VFS_STATFS(mp, ...) is mostly called with &mp->mnt_stat, but a few casesphk2004-12-051-5/+0
| | | | | | | | doesn't. Most of the implementations have grown weeds for this so they copy some fields from mnt_stat if the passed argument isn't that. Fix this the cleaner way: Always call the implementation on mnt_stat and copy that in toto to the VFS_STATFS argument if different.
* Fix null-pointer indirect function calls introduced in the previousmarcel2004-12-051-3/+3
| | | | | | | | | | | | commit. In the new world order, the transitive closure on the vector operations is not precomputed. As such, it's unsafe to actually use any of the function pointers in an indirect function call. They can be null, and we need to use the default vector in that case. This is mostly a quick fix for the four function pointers that are ed explicitly. A more generic or scalable solution is likely to see the light of day. No pathos on: current@
* Back when VOP_* was introduced, we did not have new-style structphk2004-12-014-61/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initializations but we did have lofty goals and big ideals. Adjust to more contemporary circumstances and gain type checking. Replace the entire vop_t frobbing thing with properly typed structures. The only casualty is that we can not add a new VOP_ method with a loadable module. History has not given us reason to belive this would ever be feasible in the the first place. Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc. Give coda correct prototypes and function definitions for all vop_()s. Generate a bit more data from the vnode_if.src file: a struct vop_vector and protype typedefs for all vop methods. Add a new vop_bypass() and make vop_default be a pointer to another struct vop_vector. Remove a lot of vfs_init since vop_vector is ready to use from the compiler. Cast various vop_mumble() to void * with uppercase name, for instance VOP_PANIC, VOP_NULL etc. Implement VCALL() by making vdesc_offset the offsetof() the relevant function pointer in vop_vector. This is disgusting but since the code is generated by a script comparatively safe. The alternative for nullfs etc. would be much worse. Fix up all vnode method vectors to remove casts so they become typesafe. (The bulk of this is generated by scripts)
* Remove redundant functions (repo-copied from nfsclient) for dealing withphk2004-12-011-4/+0
| | | | fifos.
* Scripted modification of vop_* prototypes to use typedefs.phk2004-12-011-25/+25
|
* Add missing #includephk2004-12-011-0/+1
|
* Fix for a race between lookup and readdirplus, that causesps2004-12-011-0/+28
| | | | | | | | | | | a deadlock (with NFS exclusive vnode locks enabled). Lookup grabs the parent's lock and wants to lock child. Readdirplus locks the child and wants to lock parent (for loading the attrs for ".."). The fix is to not load the attrs for ".." in readdirplus. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Reviewed by: rwatson
* Clean all dirty pages (dirtied by mmap'ed writes) in nfs_close().ps2004-12-011-0/+18
| | | | | | | | | | This closes a major hole in close-to-open consistency support. Added a new sysctl so that this can be disabled for single NFS client applications with very large amounts of mmap'ed IO (for performance). Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Reviewed by: rwatson
* Fix for a (blocks) underrun bug where negative values were beingps2004-12-011-3/+4
| | | | | | | | returned back to df from a statfs call. Causing df to print negative values. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Reviewed by: rwatson
* Fix for a bug in nfs_mkdir() that called vrele() instead of vput()ps2004-11-291-2/+2
| | | | | | | in the error cases, causing panics. Submitted by: Mohan Srinivasan mohans at yahoo-inc dot com Reviewed by: rwatson
* - Eliminate the acquisition and release of the bqlock in bremfree() byjeff2004-11-181-0/+2
| | | | | | | | | | | | | | | | | | | | setting the B_REMFREE flag in the buf. This is done to prevent lock order reversals with code that must call bremfree() with a local lock held. This also reduces overhead by removing two lock operations per buf for fsync() and similar. - Check for the B_REMFREE flag in brelse() and bqrelse() after the bqlock has been acquired so that we may remove ourself from the free-list. - Provide a bremfreef() function to immediately remove a buf from a free-list for use only by NFS. This is done because the nfsclient code overloads the b_freelist queue for its own async. io queue. - Simplify the numfreebuffers accounting by removing a switch statement that executed the same code in every possible case. - getnewbuf() can encounter locked bufs on free-lists once Giant is removed. Remove a panic associated with this condition and delay asserts that inspect the buf until after it is locked. Reviewed by: phk Sponsored by: Isilon Systems, Inc.
* Detect root mount attempts on the flag, not on the NULL path.phk2004-11-091-1/+1
|
* Retire b_magic now, we have the bufobj containing the same hint.phk2004-11-041-1/+0
|
* Move the buffer method vector (buf->b_op) to the bufobj.phk2004-10-244-36/+26
| | | | | | | | | | | | | | | | | Extend it with a strategy method. Add bufstrategy() which do the usual VOP_SPECSTRATEGY/VOP_STRATEGY song and dance. Rename ibwrite to bufwrite(). Move the two NFS buf_ops to more sensible places, add bufstrategy to them. Add inlines for bwrite() and bstrategy() which calls through buf->b_bufobj->b_ops->b_{write,strategy}(). Replace almost all VOP_STRATEGY()/VOP_SPECSTRATEGY() calls with bstrategy().
* Add b_bufobj to struct buf which eventually will eliminate the need for b_vp.phk2004-10-224-12/+10
| | | | | | | | | | | | | | | | | | Initialize b_bufobj for all buffers. Make incore() and gbincore() take a bufobj instead of a vnode. Make inmem() local to vfs_bio.c Change a lot of VI_[UN]LOCK(bp->b_vp) to BO_[UN]LOCK(bp->b_bufobj) also VI_MTX() to BO_MTX(), Make buf_vlist_add() take a bufobj instead of a vnode. Eliminate other uses of bp->b_vp where bp->b_bufobj will do. Various minor polishing: remove "register", turn panic into KASSERT, use new function declarations, TAILQ_FOREACH_SAFE() etc.
* Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAITphk2004-10-212-16/+10
| | | | | | | | | | Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write count on a bufobj. Bufobj_wdrop() replaces vwakeup(). Use these functions all relevant places except in ffs_softdep.c where the use if interlocked_sleep() makes this impossible. Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.
* Add a missing newline character.pjd2004-10-141-1/+2
|
* nfsclient/nfs_bio.c has a PHOLD() without a PRELE(). Neither shoulddas2004-10-011-3/+1
| | | | be necessary here. Also, use killproc() instead of psignal().
* Remove support for using NFS device nodes.phk2004-09-283-97/+2
|
* Remove NFS4 vop method vector for devices: we are desupporing device nodesphk2004-09-271-1/+2
| | | | | | | on anything but DEVFS and in this case it was not even used (see below). Put the NFS4 vop method for fifo's behind "#if 0" because it is unused. Add a XXX comment to say that I think the unusedness is a bug.
* style consistency.phk2004-09-271-1/+1
|
* Remove unused B_WRITEINPROG flagphk2004-09-152-13/+3
|
* Explicitly pass vnode to nfs_doio() and mountpoint to nfs_asyncio().phk2004-09-074-22/+15
|
* In nfs_timer(), pass curthread rather than &thread0 into the protocolrwatson2004-08-251-4/+2
| | | | | | | | | | | send routine. In IPv6 UDP, the thread will be passed to suser(), which asserts that if a thread is used for a super user check, it be curthread. Many of these protocol entry points probably need to accept credentials instead of threads. MT5 candidate. Noticed/tested by: kuriyama
* Put a version element in the VFS filesystem configuration structurephk2004-07-301-4/+3
| | | | | | | | | | | | | | | | | | and refuse initializing filesystems with a wrong version. This will aid maintenance activites on the 5-stable branch. s/vfs_mount/vfs_omount/ s/vfs_nmount/vfs_mount/ Name our filesystems mount function consistently. Eliminate the namiedata argument to both vfs_mount and vfs_omount. It was originally there to save stack space. A few places abused it to get hold of some credentials to pass around. Effectively it is unused. Reorganize the root filesystem selection code.
* Move a relic to its correct location(s): Put nfs diskless initializationphk2004-07-282-0/+17
| | | | calls with the code they call. (Yet another example of mindless copy&paste).
* Remove global variable rootdevs and rootvp, they are unused as such.phk2004-07-281-2/+0
| | | | | | | | Add local rootvp variables as needed. Remove checks for miniroot's in the swappartition. We never did that and most of the filesystems could never be used for that, but it had still been copy&pasted all over the place.
* Eliminate unused second argument to reassignbuf() and simplify itphk2004-07-251-1/+1
| | | | accordingly.
* Turn off SO_REUSEADDR and SO_REUSEPORT, they were causing EADDRINUSEalfred2004-07-131-5/+1
| | | | | | to be returned from the protocol stack. Pointy hat to me for not groking what those options _really_ mean.
* Rename Alfred's kern_setsockopt to so_setsockopt, as this seems adwmalone2004-07-121-2/+2
| | | | | | | | a better name. I have a kern_[sg]etsockopt which I plan to commit shortly, but the arguments to these function will be quite different from so_setsockopt. Approved by: alfred
OpenPOWER on IntegriCloud