summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
Commit message (Collapse)AuthorAgeFilesLines
* 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
* 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>
OpenPOWER on IntegriCloud