summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Make VFS_ROOT() and vflush() take a thread argument.alfred2004-07-121-2/+2
| | | | | | This is to allow filesystems to decide based on the passed thread which vnode to return. Several filesystems used curthread, they now use the passed thread.
* Use SO_REUSEADDR and SO_REUSEPORT when reconnecting NFS mounts.alfred2004-07-121-2/+10
| | | | | | | Tune the timeout from 5 seconds to 12 seconds. Provide a sysctl to show how many reconnects the NFS client has done. Seems to fix IPv6 from: kuriyama
* Change the following environment variables to kernel options:brian2004-07-082-91/+81
| | | | | | | | | | | | | bootp -> BOOTP bootp.nfsroot -> BOOTP_NFSROOT bootp.nfsv3 -> BOOTP_NFSV3 bootp.compat -> BOOTP_COMPAT bootp.wired_to -> BOOTP_WIRED_TO - i.e. back out the previous commit. It's already possible to pxeboot(8) with a GENERIC kernel. Pointed out by: dwmalone
* Change the following kernel options to environment variables:brian2004-07-082-81/+91
| | | | | | | | | | | | | | | | | | BOOTP -> bootp BOOTP_NFSROOT -> bootp.nfsroot BOOTP_NFSV3 -> bootp.nfsv3 BOOTP_COMPAT -> bootp.compat BOOTP_WIRED_TO -> bootp.wired_to This lets you PXE boot with a GENERIC kernel by putting this sort of thing in loader.conf: bootp="YES" bootp.nfsroot="YES" bootp.nfsv3="YES" bootp.wired_to="bge1" or even setting the variables manually from the OK prompt.
* Acquire socket lock in nfs_connect() connection/sleep loop to protectrwatson2004-07-061-6/+6
| | | | socket state and avoid missed wakeups.
* use vfs_suser() to restrict access to the nfs mount's timeout.alfred2004-07-061-0/+3
|
* NFS mobility Phase VI:alfred2004-07-061-1/+50
| | | | | Export NFS mount state via sysctl. Export timeout via sysctl.
* NFS mobility PHASE I, II & III (phase VI, and V pending):alfred2004-07-066-94/+267
| | | | | | | | | | | | | | | Rebind the client socket when we experience a timeout. This fixes the case where our IP changes for some reason. Signal a VFS event when NFS transitions from up to down and vice versa. Add a placeholder vfs_sysctl where we will put status reporting shortly. Also: Make down NFS mounts return EIO instead of EINTR when there is a soft timeout or force unmount in progress.
* When we traverse the vnodes on a mountpoint we need to look out forphk2004-07-042-16/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | our cached 'next vnode' being removed from this mountpoint. If we find that it was recycled, we restart our traversal from the start of the list. Code to do that is in all local disk filesystems (and a few other places) and looks roughly like this: MNT_ILOCK(mp); loop: for (vp = TAILQ_FIRST(&mp...); (vp = nvp) != NULL; nvp = TAILQ_NEXT(vp,...)) { if (vp->v_mount != mp) goto loop; MNT_IUNLOCK(mp); ... MNT_ILOCK(mp); } MNT_IUNLOCK(mp); The code which takes vnodes off a mountpoint looks like this: MNT_ILOCK(vp->v_mount); ... TAILQ_REMOVE(&vp->v_mount->mnt_nvnodelist, vp, v_nmntvnodes); ... MNT_IUNLOCK(vp->v_mount); ... vp->v_mount = something; (Take a moment and try to spot the locking error before you read on.) On a SMP system, one CPU could have removed nvp from our mountlist but not yet gotten to assign a new value to vp->v_mount while another CPU simultaneously get to the top of the traversal loop where it finds that (vp->v_mount != mp) is not true despite the fact that the vnode has indeed been removed from our mountpoint. Fix: Introduce the macro MNT_VNODE_FOREACH() to traverse the list of vnodes on a mountpoint while taking into account that vnodes may be removed from the list as we go. This saves approx 65 lines of duplicated code. Split the insmntque() which potentially moves a vnode from one mount point to another into delmntque() and insmntque() which does just what the names say. Fix delmntque() to set vp->v_mount to NULL while holding the mountpoint lock.
* When updating sb_flags, acquire the socket buffer lock to preventrwatson2004-06-241-0/+4
| | | | races.
* Second half of the dev_t cleanup.phk2004-06-171-1/+1
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Remove bad cookie vp kernel printf; while it does notify about anrwatson2004-06-171-1/+0
| | | | | interesting event, there's little or nothing the user can do about it.
* Convert GIANT_REQUIRED to NET_ASSERT_GIANT where Giant is used torwatson2004-06-163-6/+6
| | | | | protect socket operations. Leave one "as-is" as it also frobs rootvp.
* Make vm_page's PG_ZERO flag immutable between the time of the page'salc2004-05-061-2/+0
| | | | | | | | | | allocation and deallocation. This flag's principal use is shortly after allocation. For such cases, clearing the flag is pointless. The only unusual use of PG_ZERO is in vfs_bio_clrbuf(). However, allocbuf() never requests a prezeroed page. So, vfs_bio_clrbuf() never sees a prezeroed page. Reviewed by: tegge@
* Let the NFS client notice a file's size changing as a modification.peadar2004-04-143-3/+13
| | | | | | | | | This avoids presenting invalid data to the client's applications when the file is modified, and then extended within the window of the resolution of the modifcation timestamp. Reviewed By: iedowse PR: kern/64091
* Unbreak build: s/TAILQ_ISEMPTY/TAILQ_EMPTY/gmarcel2004-04-111-1/+1
|
* Clean up properly when unloading NFS client module.peadar2004-04-114-2/+35
| | | | | | | | | This includes a modified form of some code from Thomas Moestl (tmm@) to properly clean up the UMA zone and the "nfsnodehashtbl" hash table. Reviewed By: iedowse PR: 16299
* Remove advertising clause from University of California Regent'simp2004-04-0715-60/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Spell 2 as SHUT_RDWR when used as an argument to soshutdown().rwatson2004-04-041-1/+1
|
* Flush cached access mode after modifying a files attributes forpeadar2004-04-031-0/+2
| | | | | | | | | | NFSv3. It's likely that modifying the attributes will affect the file's accessibility. This version of the patch is one suggested by Ian Dowse after reviewing my original attempt in the PR Reviewed By: iedowse PR: kern/44336 MFC after: 3 days
* Reset callout if in nfs_timeout and rpcclnt_timeout functions. Timerkan2004-03-281-0/+1
| | | | | | | | | are supposed to continue firing as long as there is work to do, not stop after the first invocation. This is damage control after a patch that has been committed prematurely. Tested by: kris
* only do nfs rpc callouts if there is work to do.rees2004-03-253-6/+8
| | | | | Submitted by: kan Approved by: alfred
* Add a comment with an explanation why we don't report EPIPE errors onpjd2004-03-171-0/+5
| | | | | | nfs sockets. Requested by: ru
* Don't report EPIPE errors on nfs sockets. These can be due to idle tcppjd2004-03-171-2/+5
| | | | | | mounts which will be closed by netapp, solaris, etc. if left idle too long. Obtained from: NetBSD
* Calculate NFS timeouts in units of 10ms, not 5ms. This matches the defaultpeter2004-03-141-1/+1
| | | | | | clock precision on i386. This is a NOP change on i386. But this stops the mount_nfs units from suddenly changing to units of 1/20 of a second (vs the normal 1/10 of a second) if HZ is increased.
* Allow kernel with the BOOTP option to boot when DHCP/BOOTP sets the rootbrooks2004-03-121-11/+37
| | | | | | | | | | path to an absolute path without a host name. Previously, there was a nasty POLA violation where a system would PXE boot until you added the BOOTP option and then it would panic instead. Reviewed by: tegge, Dirk-Willem van Gulik <dirkx at webweaving.org> (a previous version) Submitted by: tegge (getip function)
* Properly vector all bwrite() and BUF_WRITE() calls through the same pathphk2004-03-112-3/+3
| | | | and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().
* Remove unused second arg to vfinddev().phk2004-03-111-3/+4
| | | | Don't call addaliasu() on VBLK nodes.
* Rename dup_sockaddr() to sodupsockaddr() for consistency with otherrwatson2004-03-011-1/+1
| | | | | | | | | | | | functions in kern_socket.c. Rename the "canwait" field to "mflags" and pass M_WAITOK and M_NOWAIT in from the caller context rather than "1" or "0". Correct mflags pass into mac_init_socket() from previous commit to not include M_ZERO. Submitted by: sam
* NFSv4 fixes from Connectathon 2004:rees2004-02-271-2/+0
| | | | | | | | | | | | remove unused pid field of file context struct map nfs4 error codes to errnos eliminate redundant code from nfs4_request use zero stateid on setattr that doesn't set file size use same clientid on all mounts until reboot invalidate dirty bufs in nfs4_close, to play it safe open file for writing if truncating and it's not already open Approved by: alfred
* If mountnfs returns an error, it will have already freed nam; no need tocperciva2004-02-221-1/+0
| | | | | | | free it again. Reported by: "Ted Unangst" <tedu@coverity.com> Approved by: rwatson (mentor)
* 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.
OpenPOWER on IntegriCloud