summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* Locking for the per-process resource limits structure.jhb2004-02-041-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - struct plimit includes a mutex to protect a reference count. The plimit structure is treated similarly to struct ucred in that is is always copy on write, so having a reference to a structure is sufficient to read from it without needing a further lock. - The proc lock protects the p_limit pointer and must be held while reading limits from a process to keep the limit structure from changing out from under you while reading from it. - Various global limits that are ints are not protected by a lock since int writes are atomic on all the archs we support and thus a lock wouldn't buy us anything. - All accesses to individual resource limits from a process are abstracted behind a simple lim_rlimit(), lim_max(), and lim_cur() API that return either an rlimit, or the current or max individual limit of the specified resource from a process. - dosetrlimit() was renamed to kern_setrlimit() to match existing style of other similar syscall helper functions. - The alpha OSF/1 compat layer no longer calls getrlimit() and setrlimit() (it didn't used the stackgap when it should have) but uses lim_rlimit() and kern_setrlimit() instead. - The svr4 compat no longer uses the stackgap for resource limits calls, but uses lim_rlimit() and kern_setrlimit() instead. - The ibcs2 compat no longer uses the stackgap for resource limits. It also no longer uses the stackgap for accessing sysctl's for the ibcs2_sysconf() syscall but uses kernel_sysctl() instead. As a result, ibcs2_sysconf() no longer needs Giant. - The p_rlimit macro no longer exists. Submitted by: mtm (mostly, I only did a few cleanups and catchups) Tested on: i386 Compiled on: alpha, amd64
* Bump the NFCv3/TCP defaults for rsize and wsize from 8K to 32K to matchobrien2004-01-311-5/+21
| | | | | | | Solaris and HP-UX. This increases read performance for large files across NFS. PR: 62024 & 26324 Submitted by: Bjoern Groenvall <bg@sics.se>
* Use function pointers to remove the depenancy cross dependancy on nfs4alfred2003-11-226-28/+36
| | | | | | | | and the nfs3 client. Also fix some bugs that happen to be causing crashes in both v3 and v4 introduced by the v4 import. Submitted by: Jim Rees <rees@umich.edu> Approved by: re
* Move the declaration for "struct nfs4_fctx" out from under #ifdef KERNELalfred2003-11-151-14/+14
| | | | for fstat(1).
* unbreak LINT.alfred2003-11-151-7/+7
|
* University of Michigan's Citi NFSv4 kernel client code.alfred2003-11-1416-15/+148
| | | | Submitted by: Jim Rees <rees@umich.edu>
* 1. Consolidate mount struct allocation/destruction into a common code inkan2003-11-121-23/+3
| | | | | | | | | | | | | | | | | | | | | | | vfs_mount_alloc/vfs_mount_destroy functions and take care to completely destroy the mount point along with its locks. Mount struct has grown in coplexity recently and depending on each failure path to destroy it completely isn't working anymore. 2. Eliminate largely identical vfs_mount and vfs_unmount question by moving the code to handle both cases into a newly introduced vfs_domount function. 3. Simplify nfs_mount_diskless to always expect an allocated mount struct and never attempt an allocation/destruction itself. The vfs_allocroot allocation was there to support 'magic' swap space configuration for diskless clients that was already removed by PHK some time ago. 4. Include a vfs_buildopts cleanups by Peter Edwards to validate the sanity of nmount parameters passed from userland. Submitted by: (4) Peter Edwards <peter.edwards@openet-telecom.com> Reviewed by: rwatson
* Stop using shared locks for nfs vop locks.alfred2003-11-111-3/+0
| | | | | | | | | | | | | The reason this was done was to avoid a race to the root when an NFS server went down. However a semi-recent change to the way that the kernel's lookup() routine traverses mount points prevents this. Rev 1.39 of vfs_lookup.c changed the ordering of locks such that we aquire a shared lock on the mount point being accessed and then drop the directory vnode lock before requesting the target lock. With that in place we no longer need shared locks for NFS to prevent race to the root lockups.
* Assert GIANT_REQUIRED where sockets are manipulated. This issam2003-11-074-0/+16
| | | | | | | preparatory for MPSAFE network commits and ongoing socket locking work. Supported by: FreeBSD Foundation
* Remove mntvnode_mtx and replace it with per-mountpoint mutex.kan2003-11-052-10/+11
| | | | | | | | | | Introduce two new macros MNT_ILOCK(mp)/MNT_IUNLOCK(mp) to operate on this mutex transparently. Eventually new mutex will be protecting more fields in struct mount, not only vnode list. Discussed with: jeff
* Take care not to call vput if thread used in corresponding vgetkan2003-11-021-1/+2
| | | | | | | | | | wasn't curthread, i.e. when we receive a thread pointer to use as a function argument. Use VOP_UNLOCK/vrele in these cases. The only case there td != curthread known at the moment is boot() calling sync with thread0 pointer. This fixes the panic on shutdown people have reported.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-312-8/+6
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* DuH!phk2003-10-181-1/+1
| | | | | bp->b_iooffset (the spot on the disk), not bp->b_offset (the offset in the file)
* Initialize bp->b_offset before calling VOP_STRATEGY().phk2003-10-182-8/+1
| | | | Remove KASSERTS and panics with B_PHYS checks which no longer apply.
* We do not get B_PHYS buffers here anymore. /dev/drum is long gone.phk2003-10-181-24/+2
|
* Since the addition of the VI_DOINGINACT flag some time ago,iedowse2003-10-051-15/+1
| | | | | | | VOP_INACTIVE routines need not worry about their vnode getting recycled if they block. Remove the code from nfs_inactive() that used vget() to get an extra vnode reference that was held during the nfs_vinvalbuf() call.
* - Remove an incorrect XXX comment. This code does respect the XLOCK sincejeff2003-10-051-1/+0
| | | | it uses vget() which will fail if the identity changes.
* - Check the XLOCK before we inspect the vnode.jeff2003-10-051-0/+4
|
* - We don't need to cache_purge() in nfs_reclaim(), vclean() does it for us.jeff2003-10-051-2/+0
|
* - Consistently set sopt_dir.jeff2003-10-043-0/+4
| | | | Pointed out by: pete@isilon.com
* - Acquire the vnode interlock prior to dropping the mntvnode_mtx.jeff2003-10-041-1/+2
| | | | | - Make a note of the lack of XLOCK protection in this code. We would access a vnode while it is changing identities without Giant.
* - Remove the backtrace() call from the *_vinvalbuf() functions. Thanks to ajeff2003-10-041-5/+6
| | | | | | | | stack trace supplied by phk, I now understand what's going on here. The check for VI_XLOCK stops us from calling vinvalbuf once the vnode has been partially torn down in vclean(). It is not clear that this would cause a problem. Document this in nfs_bio.c, which is where the other two filesystems copied this code from.
* - Remove interlock protection around VI_XLOCK. The interlock is notjeff2003-09-191-4/+3
| | | | | | | | | | | | | sufficient to guarantee that this race is not hit. The XLOCK will likely have to be redesigned due to the way reference counting and mutexes work in FreeBSD. We currently can not be guaranteed that xlock was not set and cleared while we were blocked on the interlock while waiting to check for XLOCK. This would lead us to reference a vnode which was not the vnode we requested. - Add a backtrace() call inside of INVARIANTS in the hopes of finding out if this condition is ever hit. It should not, since we should be retaining a reference to the vnode in these cases. The reference would be sufficient to block recycling.
* Name the vnode method vectors consistently with the rest of the filesystems.phk2003-09-124-21/+21
| | | | This improves the output of src/tools/tools/vop_table
* Remove now unused BOOTP tags related to NFS swap device.phk2003-09-051-3/+0
|
* KNF: parentheses around return values.dds2003-09-041-4/+4
| | | | | | Suggested by: bde Approved by: schweikh (mentor - blanket) MFC after: 6 weeks
* Fix errno return values to better represent failure reasons fordds2003-09-021-4/+9
| | | | | | | | read and open. Approved by: schweikh (mentor) Agreed: bde MFC after: 6 weeks
* Remove the magic way of configuring NFS backed swap.phk2003-08-154-243/+1
| | | | | | | | | | | | | This code dates back to the very first diskless support on FreeBSD, back when swapon(8) couldn't simply be run on a NFS backed file. Suggested replacement command sequence on the client: dd if=/dev/zero of=/swapfile bs=1k count=1 oseek=100000 swapon /swapfile rm -f /swapfile For whatever value of 100000 you want.
* 0) preallocate per-interface context structures without the ifnet lock heldbillf2003-08-071-25/+38
| | | | | | | | 1) avoid immediately calling bzero() after malloc() by passing M_ZERO 2) do not initialize individual members of the global context to zero 3) remove an unused assignment of ifctx in bootpc_init() Reviewed by: tegge
* Fix a problem that occurs when truncating files on NFSv3 mounts: we needtjr2003-07-291-1/+7
| | | | | | | | | | | | to set np->n_size back to the desired size again after calling nfs_meta_setsize(), since it could end up in nfs_loadattrcache() getting called, which would change n_size back to the value it had before the truncate request was issued. The result of this bug is that the size info cached in the nfsnode becomes incorrect, lseek(fd, ofs, SEEK_END) seeks past the end of the file, stat() returns the wrong size, etc. PR: 41792 MFC after: 2 weeks
* Add fdidx argument to vn_open() and vn_open_cred() and pass -1 throughout.phk2003-07-271-1/+1
|
* Change idle sleep indentifier to "-" for nfsiodphk2003-07-021-1/+1
|
* Lock the vm object when freeing a page.alc2003-06-171-1/+9
|
* Add the same KASSERT to all VOP_STRATEGY and VOP_SPECSTRATEGY implementationsphk2003-06-151-0/+2
| | | | to check that the buffer points to the correct vnode.
* Initialize struct vfsops C99-sparsely.phk2003-06-121-14/+7
| | | | | Submitted by: hmp Reviewed by: phk
* When removing a sillyrename file, make sure that the directory vnodeiedowse2003-06-121-0/+6
| | | | | | | | | | has not been cleaned in the meantime, since this can happen during a forced unmount. Also add a comment that nfs_removeit() should really be locking the directory vnode before calling nfs_removerpc(). Reported by: mbr Tested by: mbr MFC after: 1 week
* Use __FBSDID().obrien2003-06-111-1/+3
|
* Add the comment I meant to add about not passing in PCATCH to therwatson2003-06-111-0/+8
| | | | tsleep(). Note the XXX.
* On a socket creation error, don't close the socket.hsu2003-06-091-1/+2
|
* Remove unsed variables.phk2003-05-311-7/+2
| | | | | | Add explicit breaks to switch Found by: FlexeLint
* The IO_NOWDRAIN and B_NOWDRAIN hacks are no longer needed to preventphk2003-05-311-6/+0
| | | | | | deadlocks with vnode backed md(4) devices because md now uses a kthread to run the bio requests instead of doing it directly from the bio down path.
* rpc.lockd stability workaround: remove PCATCH from the tsleep() inrwatson2003-05-301-1/+1
| | | | | | | | | | | | | | | | | nfs_lock.c. Right now, if we permit a signal to interrupt the sleep, we will slip the lock and no process on that client, the server, or any other client will be able to acquire the lock. This can happen, for example, if a user hits Ctrl-C or Ctrl-T while a process is waiting for the lock. By removing PCATCH, we prevent that from happening, at the cost of not permitting a user-requested lock abort: also nasty. However, a user interface bug might be preferable to a serious semantic bug, so we go with that for now. We need to teach the rpc.lockd/kernel protocol how to abort lock requests, and rpc.lockd how to handle aborted lock requests; patches for the kernel bit are floating around, but no rpc.lockd bit yet. Approved by: re (scottl)
* Deal with the possibility of negative available space from the file serverpeter2003-05-191-3/+6
| | | | | | | | to avoid Bad Things(TM) happening (eg: df crashing with a floating point exception). Submitted by: Harold Gutch <logix@foobar.franken.de> Approved by: re (scottl)
* This change grabs the vnode lock for NFS client vnodes when callingrwatson2003-05-152-1/+7
| | | | | | | | | | VOP_SETATTR() or VOP_GETATTR(); without these locks (a) VFS_DEBUG_LOCKS will panic, and (b) it may be possible to corrupt entries in the cached vnode attributes in the nfsnode, since nfsnode attribute cache data is also protected by the vnode lock. Approved by: re (jhb) Pointed out by: VFS_DEBUG_LOCKS
* - Merge struct procsig with struct sigacts.jhb2003-05-131-1/+3
| | | | | | | | | | | | | | | | | - Move struct sigacts out of the u-area and malloc() it using the M_SUBPROC malloc bucket. - Add a small sigacts_*() API for managing sigacts structures: sigacts_alloc(), sigacts_free(), sigacts_copy(), sigacts_share(), and sigacts_shared(). - Remove the p_sigignore, p_sigacts, and p_sigcatch macros. - Add a mutex to struct sigacts that protects all the members of the struct. - Add sigacts locking. - Remove Giant from nosys(), kill(), killpg(), and kern_sigaction() now that sigacts is locked. - Several in-kernel functions such as psignal(), tdsignal(), trapsignal(), and thread_stopped() are now MP safe. Reviewed by: arch@ Approved by: re (rwatson)
* Instead of recording the Unix time in a process when it starts, record thedes2003-05-011-0/+1
| | | | | | | uptime. Where necessary, convert it back to Unix time by adding boottime to it. This fixes a potential problem in the accounting code, which would compute the elapsed time incorrectly if the Unix time was stepped during the lifetime of the process.
* Deprecate machine/limits.h in favor of new sys/limits.h.kan2003-04-292-4/+2
| | | | | | | Change all in-tree consumers to include <sys/limits.h> Discussed on: standards@ Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>
* VOP_FSYNC() expects to be called with the vnode locked, so lock fvp intruckman2003-04-241-1/+9
| | | | | | nfs_rename() before calling VOP_FSYNC() and unlock fvp immediately after. Reviewed by: bde
* Fix a bug with df on large (>1TB) nfsv3 file servers on 32 bit clientpeter2003-04-241-11/+23
| | | | | | | machines where the 'long' number of blocks in struct statfs wont fit. Instead of chosing an artificial 512 byte block size, simply scale it up until we avoid an overflow. NFSv3 reports the sizes in bytes, and the blocksize is a figment of nfsclient's imagination.
* Release the vnode interlock in nfs_flush() before calling nfs_sigintr(),truckman2003-04-231-1/+2
| | | | | and grab it again later if necessary. This prevents a lock order reversal because nfs_sigintr() calls PROC_LOCK().
OpenPOWER on IntegriCloud