Home | History | Annotate | Download | only in nfs
History log of /src/sys/nfs/nfs_var.h
RevisionDateAuthorComments
 1.97  07-Dec-2024  riastradh sys/nfs/nfs: Add some missing includes and include guards.

Fix up some minor KNF issues while here.

No functional change intended (except to enable things to build that
might not have built before because of previously required #include
ordering).
 1.96  27-Apr-2022  hannken As VOP_GETATTR() needs a shared lock at least move the preopattr lookup
inside nfs_namei() where we may lock the start directory without violating
the lock order.
 1.95  04-Jun-2021  hannken Add flag/command NFSSVC_REPLACEEXPORTSLIST to nfssvc(2) system call.

Works like NFSSVC_SETEXPORTSLIST but supports "mel_nexports > 1"
and will atomically update the complete exports list for a file system.
 1.94  15-Jul-2015  manu branches: 1.94.34; 1.94.38;
Fix soft NFS force unmount

For many reasons, forcibly unmounting a soft NFS mount could hang forever.
Here are the fixes:
- Introduce decents timeouts in operation that awaited NFS server reply.
- On timeout, fails operations on soft mounts with EIO.
- Introduce NFSMNT_DISMNTFORCE to let the filesystem know that a
force unmount is ongoing. This causes timeouts to be reduced and
prevents the NFS client to attempt reconnecting to the NFS server.

Also fix a race condition where some asynchronous I/O could reference
destroyed mount structures. We fix this by awaiting asynchronous I/O
to drain before proceeding.

Reviewed by Chuck Silvers.
 1.93  22-Jun-2015  mrg add netbsd32 support for nfssvc(2). we do this by defining 5 copyin/out
functions that do all the ugly work, are just plain copyin/out for the
native system calls, and do the necessary translations for netbsd32.

with this i'm able to run 32 bit nfsd and mountd on 64 bit kernel and
mount the file systems remotely.
 1.92  30-May-2014  hannken branches: 1.92.2; 1.92.4;
Change NFS from rbtree to vcache.
 1.91  14-Dec-2013  christos branches: 1.91.2;
don't allow the nfs server module to unload if it has exported filesystems.
 1.90  02-Mar-2010  pooka branches: 1.90.10; 1.90.20; 1.90.24;
Get rid of dependency on fs_nfs.h, i.e. source modules with
conditional content depending on if the NFS client is wanted or
not. The server can now be made an independent module not depending
on the nfs client.

Tested with rump_nfs (standalone client), rump_nfsd (standalone
nfsd) and a qemu installation with both the client and the server.
 1.89  03-Sep-2009  tls branches: 1.89.2;
...and one more missed in the earlier commit (sigh). Kernels should build
again now.
 1.88  07-Jul-2009  christos The compatibility call to re-export from sys_mount() calls
mountd_set_exports_list, with the mnt_updating mutex held. Account for that
to avoid a locking against myself panic.
 1.87  23-May-2009  ad - Fix a race between umount()/mount() and nfssvc().
- Toss netexport state on nfsserver module unload.
 1.86  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.85  28-Nov-2008  pooka branches: 1.85.4;
g/c unused malloc types
 1.84  19-Nov-2008  ad Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
 1.83  14-Nov-2008  ad Remove COMPAT ifdefs that might as well be comments (i.e., they cost us
almost nothing).
 1.82  22-Oct-2008  matt branches: 1.82.2;
Don't need nfs_vfs_reinit anymore since we don't resize tables anymore.
Move reinit code to init case.
 1.81  22-Oct-2008  matt Change NFS to use a RB-tree for its FH->nfsnode lookups.
 1.80  30-Sep-2008  pooka Initialize nfsnode pools and malloc type dynamically in the
constructor instead of depending on link sets. Consequently, rename
nfs_nh{init,reinit,done} to nfs_node_{init,reinit,done}, respectively,
to better convey the function.
 1.79  28-Apr-2008  martin branches: 1.79.2; 1.79.6;
Remove clause 3 and 4 from TNF licenses
 1.78  10-Apr-2008  yamt branches: 1.78.2; 1.78.4;
- make nfs_receive and nfs_reply static.
- ansify.
 1.77  02-Jan-2008  yamt branches: 1.77.6;
use kmem_alloc instead of malloc.
 1.76  20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.75  04-Dec-2007  yamt branches: 1.75.4;
merge non-intrusive nfs changes from vmlocking.
 1.74  28-Oct-2007  yamt branches: 1.74.2; 1.74.4;
make NFS_ATTRTIMEO a function.
 1.73  21-Oct-2007  yamt remove lwp argument from nfs_reconnect and always use &lwp0
because who triggers a reconnect doesn't really matter here. PR/37145.
 1.72  10-Aug-2007  yamt branches: 1.72.2; 1.72.6;
- instead of scanning an array of iods, maintain a list of idle iods.
- make nfs_getset_niothreads MP friendly.
 1.71  27-Jul-2007  yamt branches: 1.71.4; 1.71.6;
stop nfs tick when we have nothing to do.
 1.70  20-Jul-2007  yamt - fix decreasing of vfs.nfs.iothreads after the recent partial merge
of vmlocking.
- don't make nfsiod exit with requests left.
- make NFSSVC_BIOD a dummy so that nfsiod can be simplified.
 1.69  12-Jul-2007  dsl branches: 1.69.2;
Change the VFS_MOUNT() interface so that the 'data' buffer passed to the
fs code is a kernel buffer, pass though the length of the buffer as well.
Since the length of the userspace buffer isn'it (yet) passed through the mount
system call, add a field to the vfsops structure containing the default length.
Split sys_mount() for calls from compat code.
Ride one of the recent kernel version changes - old fs LKMs will load, but
sys_mount() will reject any attempt to use them.
 1.68  28-May-2007  yamt - remove nfs_exit exit hook. ok'ed by christos@.
- as far as i understand the code, it shouldn't be necessary
because nfs_request can't return without removing its request
and r->r_lwp is either curlwp or NULL.
- even if it's necessary, leaking requests is not the correct way
to recover from the condition.
- nfs_request: add a related assertion.
 1.67  29-Apr-2007  yamt use mutex and condver.
 1.66  04-Mar-2007  christos branches: 1.66.2; 1.66.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.65  21-Feb-2007  thorpej Replace the Mach-derived boolean_t type with the C99 bool type. A
future commit will replace use of TRUE and FALSE with true and false.
 1.64  27-Dec-2006  yamt branches: 1.64.2;
remove nqnfs.
 1.63  02-Sep-2006  yamt branches: 1.63.2;
nfsd: deal with variable-sized filehandles.
 1.62  01-Jul-2006  yamt if a file is sillyrename'ed because it's a destination of rename,
make sillyrename (try to) use LINK operation rather than RENAME.
PR/33861 from Jed Davis. he provided the almost same patch.
according to him, it also happen to be what opensolaris does in this case.

from the PR:
> In nfs_rename(), if the destination appears to exist and is "in use"
> (this check is apparently satisfied even if the file isn't in use by
> anything except the rename itself), it will sillyrename it, then delete
> the sillyrenamed file even if the rename fails -- for instance, because
> the "from" file no longer exists on the server.

> mkdir a b; touch a/x; perl -e 'fork(); rename("a/x","b/x") or die "$!\n"'
>
> Afterwards, neither a/x nor b/x will exist.

> 1) Lookup of b/x; fails with NOENT.
> 2) Rename from a/x to b/x; succeeds.
> 3) Lookup of b/x; fails with NOENT.
> 4) Rename from b/x to b/.nfsA23a3; succeeds.
> 5) Rename from a/x to b/x; fails with NOENT.
> 6) Remove of b/.nfsA23a3; succeeds.
 1.61  19-May-2006  yamt branches: 1.61.2; 1.61.4;
- fix compilation problem for !NFSSERVER && NFS.
pointed by Tom Spindler on source-changes@.
- make nfs_srvdesc_pool static.
 1.60  18-May-2006  yamt - fix some leaks in nfsd, introduced by kauth changes.
- simplify code.
- add some assertions.
- wrap some long lines.
- remove an unnecessary ";".
 1.59  14-May-2006  elad integrate kauth.
 1.58  05-Jan-2006  yamt branches: 1.58.2; 1.58.4; 1.58.6; 1.58.8; 1.58.10;
ensure the export list is not changed during nfsd operations.
 1.57  03-Jan-2006  yamt de-__P.
 1.56  03-Jan-2006  yamt move function prototypes from nfs.h to nfs_var.h.
 1.55  11-Dec-2005  christos branches: 1.55.2;
merge ktrace-lwp.
 1.54  22-Nov-2005  yamt - reduce number of linear search per rpc.
- coalesce mount_netexport_pair into netexport.
 1.53  25-Sep-2005  jmmv branches: 1.53.6;
Add some COMPAT_30 code to let old mountd binaries work after the NFS
exports rototill.
 1.52  23-Sep-2005  jmmv Apply the NFS exports list rototill patch:

- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
file sys/nfs/nfs_export.c. The former was becoming large and its code
is always compiled, regardless of the build options. Using the latter,
the code is only compiled in when NFSSERVER is enabled. While doing this,
also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
path and a set of export entries. At the moment it can only clear the
exports list or append entries, one by one, but it is done in a way that
allows setting the whole set of entries atomically in the future (see the
comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
that it becomes file system agnostic. In fact, all this whole thing was
done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
exports initialization; done internally by the kernel when initializing
the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
subsystems can run arbitrary code upon receipt of specific VFS events.
At the moment, this only provides support for unmount and is used to
destroy NFS exports lists from the file systems being unmounted, though it
has room for extension.

Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
 1.51  07-Jul-2005  christos 1. use p = uio->uio_procp consistently and eliminate suspicious uses
of curproc (where uio->uio_procp should be used?). Don't do this
for nfs_commit(), because yamt says it is possibly wrong.
2. nfs_doio() does not use struct proc; remove it and the code to compute it.
3. use copyin_proc() and copyout_proc() instead of copyin() and copyout().
4. check return of copyout_proc(). and mark return from copyin_proc() XXX
5. Eliminate check p == curproc assertion check from nfs_write;
nfs_read does not have it and we might be called in a different
process context anyway (PR 20138).
 1.50  29-May-2005  christos branches: 1.50.2;
- sprinkle const
- avoid shadowed variables
- mark bad const use with XXXUNCONST
 1.49  27-Jan-2005  yamt branches: 1.49.4; 1.49.6;
keep directory eof cache when inactivating vnode
because there's no reason to throw it away.
(fix an unintended side effect of nfs_subs.c rev.1.144.)
 1.48  19-Jan-2005  yamt branches: 1.48.2;
implement inaccurate mtime/ctime detection.
namely, if mtime or ctime are same between pre_op_attr and post_op_attr
when we expected them to be changed, don't trust the server.
 1.47  14-Dec-2004  yamt branches: 1.47.2;
- centerize code to invalidate stale cache.
- don't ignore errors when invalidating buffers in nfs_open.
 1.46  15-Sep-2004  yamt fix access-after-free bugs in dircache code by refcounting nfsdircache.
PR/26864.
 1.45  22-May-2004  jonathan Eliminate several uses of `curproc' from the socket-layer code and from NFS.

Add a new explicit `struct proc *p' argument to socreate(), sosend().
Use that argument instead of curproc. Follow-on changes to pass that
argument to socreate(), sosend(), and (*so->so_send)() calls.
These changes reviewed and independently recoded by Matt Thomas.

Changes to soreceive() and (*dom->dom_exernalize() from Matt Thomas:
pass soreceive()'s struct uio* uio->uio_procp to unp_externalize().
Eliminate curproc from unp_externalize. Also, now soreceive() uses
its uio->uio_procp value, pass that same value downward to
((pr->pru_usrreq)() calls for consistency, instead of (struct proc * )0.

Similar changes in sys/nfs to eliminate (most) uses of curproc,
either via the req-> r_procp field of a struct nfsreq *req argument,
or by passing down new explicit struct proc * arguments.

Reviewed by: Matt Thomas, posted to tech-kern.
NB: The (*pr->pru_usrreq)() change should be tested on more (all!) protocols.
 1.44  10-May-2004  yamt don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.
 1.43  05-Apr-2004  yamt nfs_readdirplusrpc: fix a deadlock problem.
don't wait for vnode lock to load attributes.
otherwise, because READDIRPLUS returns DOTDOT entry as well,
we violate locking order.
 1.42  23-Jul-2003  yamt branches: 1.42.2;
when rexmitting a request due to NFSERR_JUKEBOX,
use a new xid as RFC1813 says.
 1.41  29-Jun-2003  fvdl branches: 1.41.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.40  29-Jun-2003  thorpej Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget(). Turns out
that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
just to appease the above.
 1.39  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.38  09-Jun-2003  yamt rework zero padding of rpc reply.
- for READ procedure, don't send back more bytes than requested.
- don't have doubtful assumptions on mbuf chain structure.
- rename a function (nfsm_adj -> nfs_zeropad) to avoid confusion as
the semantics of the function was changed.
 1.37  22-May-2003  yamt poolify nfsrv_descript.
 1.36  22-May-2003  yamt avoid double free with xlatecookie.
 1.35  22-May-2003  yamt interlock for nfs_rcvlock.
 1.34  21-May-2003  yamt eliminate memcpy in the common and easy case of write.
 1.33  07-May-2003  yamt simple lock for nfs iod.
 1.32  05-May-2003  yamt keep things not needed by userland in #ifdef _KERNEL.
(e.g. prototypes for in-kernel functions)
 1.31  03-May-2003  yamt better handling of write verifier change.
 1.30  24-Apr-2003  drochner Change some subordinate functions to take a "struct nfsnode" argument
instead of "struct vnode". This saves a number of pointer dereferences;
it sums up to about half a kB for me. And it paves the way for future
fixes.
While cleaning up, eliminate a write-only member of "struct nfsreq"
and a pointless assignment in the NFS_V2_ONLY case.
 1.29  28-Mar-2003  yamt i forgot to check this in with the previous (reply ENAMETOOLONG properly).
 1.28  02-Feb-2003  christos protect <sys/mallocvar.h> ifdef _KERNEL
 1.27  01-Feb-2003  thorpej Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant. Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
 1.26  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.25  23-Oct-2002  jdolecek merge kqueue branch into -current

kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
 1.24  21-Oct-2002  yamt fix a page locking deadlock problem for nfs.

add a flag that specify if the file can be truncated safely or not
to nfsm_loadattr and friends. when it isn't safe, just mark the nfsnode
as "should be truncated later".

ok'ed by Frank van der Linden and Chuck Silvers.
close kern/18036.
 1.23  17-Mar-2002  christos use the exithook mechanism to remove the exiting process from the list
of processes to be signalled in a soft mount.
 1.22  11-Mar-2002  jdolecek nfs_enterdircache() had last two parameter types swapped
Noted in kern/14742 by John Franklin.
 1.21  05-Dec-2001  lukem don't need nfs_hash prototype here
 1.20  15-Sep-2001  chs add a new VFS op, vfs_reinit, which is called when desiredvnodes is
adjusted via sysctl. file systems that have hash tables which are
sized based on the value of this variable now resize those hash tables
using the new value. the max number of FFS softdeps is also recalculated.

convert various file systems to use the <sys/queue.h> macros for
their hash tables.
 1.19  27-Nov-2000  chs branches: 1.19.2; 1.19.4; 1.19.6;
Initial integration of the Unified Buffer Cache project.
 1.18  19-Sep-2000  fvdl Add prototypes for commitrange functions.
 1.17  15-Apr-2000  tsarna branches: 1.17.4;
Death to nfsiod!

It is replaced by kernel threads that do the same thing. The number of
kernel threads used is set with the vfs.nfs.iothreads sysctl.
 1.16  16-Mar-2000  jdolecek Add new VFS op routine - vfs_done and call it on filesystem detach
in vfs_detach(). vfs_done may free global filesystem's resources,
typically those allocated in respective filesystem's init function.
Needed so those filesystems which went in via LKM have a chance to
clean after themselves before unloading. This fixes random panics
when LKM for filesystem using pools was loaded and unloaded several
times.

For each leaf filesystem, add appropriate vfs_done routine.
 1.15  05-Sep-1998  christos branches: 1.15.12;
Assign copyright to TNF.
 1.14  25-Jun-1998  thorpej - Rename nqnfs_vop_lease_check() to genfs_lease_check(). If NFSSERVER is
not in the kernel, genfs_lease_check() is simply a no-op. This allows
LKM'd file systems to be exported (previously did not work properly
due to a compile-time decision based on -DNFSSERVER).
- defopt NFSSERVER
 1.13  29-Mar-1998  mrg add forward decl for union nethostaddr.
 1.12  30-Jan-1998  fvdl Only take the receive lock before disconnecting when doing it from
nfs_decode_args. Otherwise we might just end up locking against ourselves.

XXX workaround, will do ok for now. Proper fix forthcoming.
 1.11  19-Oct-1997  fvdl branches: 1.11.2;
* Implement optional 32 <-> 64 bit directory cookie translation. This uses
the directory cache as translation table. See nfs_subs.c for comments.
Makes the code a bit more complex to look at than I would have liked,
but doesn't affect the speed of the default behavior.
* Optimize caching behavior a bit when buffers are invalidated.
* Save some RPCs in readdir operations by not bothering if there is
a small amount left to do to fill the buffer. It'll be done in the
next RPC with a larger chunk anyway. Wastes a bit of buffer space
but is faster.
* Make n_vattr an allocated vattr struct. This avoids nfsnode bloat,
and is friendlier to the malloc routines.
 1.10  10-Oct-1997  fvdl * New directory entry caching system. Provides full caching of any
directory cookie that may be thrown back at us from userspace, up
to a size limit. Fixes double entry problem.
* Split flags for internal and external use in the NFS mount structure.
* Fix some buffer structure fields that weren're being used correctly.
* Fix missing directory cache inval call in nfs_open.
* Limit on NFS_DIRBLKSIZ no longer needed, bumped to the more reasonable
value of 8k.
* Various other things that I forget, all related to the dir caching
somehow, though.
 1.9  29-Aug-1997  gwr The nfs_boot_xxx functions are declared in nfsdiskless.h
so remove the duplicate declarations here.
 1.8  14-Jul-1997  fvdl branches: 1.8.2;
Don't assume that pointers into mbuf data remain valid across nfsm_dissect.
In readdirplus, don't keep such pointers but store the file attributes
in a variable instead until they are needed. Change nfsm_loadattr*
a bit so it can accept a direct pointer to an nfs_fattr structure.
 1.7  24-Jun-1997  fvdl Add prototype for nfs_ispublicfh, change the ones for nfs_namei and
nfsrv_fhtovp.
 1.6  11-Dec-1996  fvdl Give permission to the owner of the file to preserve semantics only
in the relevant cases (read, write). Fixes PR 3017.
 1.5  25-Oct-1996  cgd make the namei struct members ni_dirp and ni_next, and the componentname
struct member cn_nameptr 'const', since they should never be used to
modify the path name. (Only the pathname buffer, cn_pnbuf, should be
modified.) Propagate the const poisoning to code that uses the namei
and componentname structs.
 1.4  01-Sep-1996  mycroft Add a set of generic file system operations that most file systems use.
Also, fix some time stamp bogosities.
 1.3  18-Feb-1996  fvdl Bring in a merge of Rick Macklem's NFSv3 code from Lite2
 1.2  13-Feb-1996  christos add 2 missing fwd struct declarations
 1.1  09-Feb-1996  christos nfs prototype changes
 1.8.2.2  14-Oct-1997  thorpej Update marc-pcmcia branch from trunk.
 1.8.2.1  01-Sep-1997  thorpej Update marc-pcmcia branch from trunk.
 1.11.2.1  07-Feb-1998  mellon Pull up 1.12
 1.15.12.2  08-Dec-2000  bouyer Sync with HEAD.
 1.15.12.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.17.4.1  14-Dec-2000  he Pull up revision 1.18 (requested by fvdl):
Improve NFS performance, possibly with as much as 100% in
throughput. Please note: this implies a kernel interface change,
VOP_FSYNC gains two arguments.
 1.19.6.1  01-Oct-2001  fvdl Catch up with -current.
 1.19.4.4  30-Sep-2002  jdolecek add support for kevents to NFS
to detect file changes on server by other NFS clients, polling kernel thread
is used to periodically check for attribute changes of watched files;
the NFS server is only contacted when the vnode expires from local attrcache
(which takes 5-60 seconds currently), to keep network&CPU overhead low

the routine checking for remote changes is quite simplistic, but hopefully
doing it's job well enough
 1.19.4.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.19.4.2  16-Mar-2002  jdolecek Catch up with -current.
 1.19.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.19.2.6  11-Nov-2002  nathanw Catch up to -current
 1.19.2.5  22-Oct-2002  thorpej Sync with HEAD.
 1.19.2.4  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.19.2.3  08-Jan-2002  nathanw Catch up to -current.
 1.19.2.2  21-Sep-2001  nathanw Catch up to -current.
 1.19.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.41.2.11  11-Dec-2005  christos Sync with head.
 1.41.2.10  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.41.2.9  04-Feb-2005  skrll Sync with HEAD.
 1.41.2.8  24-Jan-2005  skrll Sync with HEAD.
 1.41.2.7  18-Dec-2004  skrll Sync with HEAD.
 1.41.2.6  21-Sep-2004  skrll Fix the sync with head I botched.
 1.41.2.5  18-Sep-2004  skrll Sync with HEAD.
 1.41.2.4  24-Aug-2004  skrll Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget(). Turns out
that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
just to appease the above.
 1.41.2.3  18-Aug-2004  skrll Revert to passing struct proc for {exit,exec}hook.
 1.41.2.2  03-Aug-2004  skrll Sync with HEAD
 1.41.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.42.2.3  11-Jan-2005  jmc Pullup patch (requested by yamy in ticket #1078)

Don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.
 1.42.2.2  18-Sep-2004  he branches: 1.42.2.2.2;
Pull up revision 1.46 (requested by yamt in ticket #858):
Fix access-after-free bugs in dircache code by reference
counting nfsdircache. Fixes PR#26864.
 1.42.2.1  10-Jul-2004  tron Pull up revision 1.43 (requested by tls in ticket #634):
nfs_readdirplusrpc: fix a deadlock problem.
don't wait for vnode lock to load attributes.
otherwise, because READDIRPLUS returns DOTDOT entry as well,
we violate locking order.
 1.42.2.2.2.1  11-Jan-2005  jmc Pullup patch (requested by yamy in ticket #1078)

Don't do kludge for a reply to a retransmitted request
unless we actually retransmitted the request.
 1.47.2.1  29-Apr-2005  kent sync with -current
 1.48.2.1  12-Feb-2005  yamt sync with head.
 1.49.6.1  16-Jul-2006  ghen Pull up following revision(s) (requested by jld in ticket #1424):
sys/nfs/nfs_vnops.c: revision 1.240 via patch
sys/nfs/nfs_var.h: revision 1.62 via patch
Fix race condition in NFS renaming that could cause the renamed file to be
deleted (PR/33861).
 1.49.4.1  16-Jul-2006  ghen Pull up following revision(s) (requested by jld in ticket #1424):
sys/nfs/nfs_vnops.c: revision 1.240 via patch
sys/nfs/nfs_var.h: revision 1.62 via patch
Fix race condition in NFS renaming that could cause the renamed file to be
deleted (PR/33861).
 1.50.2.8  21-Jan-2008  yamt sync with head
 1.50.2.7  07-Dec-2007  yamt sync with head
 1.50.2.6  15-Nov-2007  yamt sync with head.
 1.50.2.5  27-Oct-2007  yamt sync with head.
 1.50.2.4  03-Sep-2007  yamt sync with head.
 1.50.2.3  26-Feb-2007  yamt sync with head.
 1.50.2.2  30-Dec-2006  yamt sync with head.
 1.50.2.1  21-Jun-2006  yamt sync with head.
 1.53.6.4  22-Nov-2005  yamt sync with head.
 1.53.6.3  22-Nov-2005  yamt remove uvm_ractx forward decl. which is no longer used.
 1.53.6.2  18-Nov-2005  yamt - associate read-ahead context to vnode, rather than file.
- revert VOP_READ prototype.
 1.53.6.1  15-Nov-2005  yamt adapt ffs, lfs, nfs.
 1.55.2.1  15-Jan-2006  yamt sync with head.
 1.58.10.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.58.8.3  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.58.8.2  10-Mar-2006  elad Cleanup more interface abuse.

Make nfsrv_setcred() take a kauth_cred_t * as outcred. The original code
just modified it directly; we can't do that, nor do we want to.

Get rid of another case of kauth_cred_zero() followed by kauth_cred_hold()
and use kauth_cred_clone() to make sure we don't leave out important
members.

Add another DIAGNOSTIC check for reference count of above one.

Again, this should be tested.
 1.58.8.1  08-Mar-2006  elad Adapt to kernel authorization KPI.

This could use some testing...
 1.58.6.3  03-Sep-2006  yamt sync with head.
 1.58.6.2  11-Aug-2006  yamt sync with head
 1.58.6.1  24-May-2006  yamt sync with head.
 1.58.4.1  01-Jun-2006  kardel Sync with head.
 1.58.2.1  09-Sep-2006  rpaulo sync with head
 1.61.4.1  13-Jul-2006  gdamore Merge from HEAD.
 1.61.2.2  19-May-2006  yamt - fix compilation problem for !NFSSERVER && NFS.
pointed by Tom Spindler on source-changes@.
- make nfs_srvdesc_pool static.
 1.61.2.1  19-May-2006  yamt file nfs_var.h was added on branch chap-midi on 2006-05-19 13:53:12 +0000
 1.63.2.1  12-Jan-2007  ad Sync with head.
 1.64.2.3  07-May-2007  yamt sync with head.
 1.64.2.2  12-Mar-2007  rmind Sync with HEAD.
 1.64.2.1  28-Feb-2007  yamt sync with head. (somehow missed in the previous)
 1.66.4.1  11-Jul-2007  mjf Sync with head.
 1.66.2.5  26-Aug-2007  yamt - mark nfssvc(2) MPSAFE and move the most of nfsd out of the kernel lock.
- remove unused ns_solock.
- remove some of KERNEL_LOCK/UNLOCK which are not necessary on this branch.
 1.66.2.4  20-Aug-2007  ad Sync with HEAD.
 1.66.2.3  15-Jul-2007  ad Sync with head.
 1.66.2.2  09-Jun-2007  ad Sync with head.
 1.66.2.1  08-Jun-2007  ad Sync with head.
 1.69.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.71.6.2  27-Jul-2007  yamt stop nfs tick when we have nothing to do.
 1.71.6.1  27-Jul-2007  yamt file nfs_var.h was added on branch matt-mips64 on 2007-07-27 10:03:59 +0000
 1.71.4.4  09-Dec-2007  jmcneill Sync with HEAD.
 1.71.4.3  29-Oct-2007  joerg Sync with HEAD.
 1.71.4.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.71.4.1  16-Aug-2007  jmcneill Sync with HEAD.
 1.72.6.2  13-Nov-2007  bouyer Sync with HEAD
 1.72.6.1  25-Oct-2007  bouyer Sync with HEAD.
 1.72.2.2  09-Jan-2008  matt sync with HEAD
 1.72.2.1  06-Nov-2007  matt sync with HEAD
 1.74.4.4  26-Dec-2007  ad Sync with head.
 1.74.4.3  08-Dec-2007  ad Sync with head.
 1.74.4.2  04-Dec-2007  yamt apply the following change, which seems to get lost during
vmlocking -> vmlocking2 transition.

Module Name: src
Committed By: yamt
Date: Sun Oct 21 08:23:20 UTC 2007

Modified Files:
src/sys/nfs: nfs_socket.c nfs_var.h

Log Message:
remove lwp argument from nfs_reconnect and always use &lwp0
because who triggers a reconnect doesn't really matter here. PR/37145.


To generate a diff of this commit:
cvs rdiff -r1.163 -r1.164 src/sys/nfs/nfs_socket.c
cvs rdiff -r1.72 -r1.73 src/sys/nfs/nfs_var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
 1.74.4.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.74.2.3  18-Feb-2008  mjf Sync with HEAD.
 1.74.2.2  27-Dec-2007  mjf Sync with HEAD.
 1.74.2.1  08-Dec-2007  mjf Sync with HEAD.
 1.75.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.77.6.3  17-Jan-2009  mjf Sync with HEAD.
 1.77.6.2  05-Oct-2008  mjf Sync with HEAD.
 1.77.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.78.4.8  11-Mar-2010  yamt sync with head
 1.78.4.7  16-Sep-2009  yamt sync with head
 1.78.4.6  18-Jul-2009  yamt sync with head.
 1.78.4.5  20-Jun-2009  yamt sync with head
 1.78.4.4  04-May-2009  yamt fix merge botches.
 1.78.4.3  04-May-2009  yamt sync with head.
 1.78.4.2  16-May-2008  yamt sync with head.
 1.78.4.1  27-Apr-2008  yamt commit some work-in-progress changes to make nfs client mp-safe to a branch,
so that they won't get lost.
- sprinkle some locking
- mark the filesystem, nfstimer callout, and kq kthread mp-safe
- add assertions and comments
- disable upgrade mount for now
- some unrelated cosmetic changes
 1.78.2.1  18-May-2008  yamt sync with head.
 1.79.6.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.79.6.1  19-Oct-2008  haad Sync with HEAD.
 1.79.2.1  10-Oct-2008  skrll Sync with HEAD.
 1.82.2.2  28-Apr-2009  skrll Sync with HEAD.
 1.82.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.85.4.2  23-Jul-2009  jym Sync with HEAD.
 1.85.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.89.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.90.24.1  18-May-2014  rmind sync with head
 1.90.20.2  03-Dec-2017  jdolecek update from HEAD
 1.90.20.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.90.10.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.91.2.1  10-Aug-2014  tls Rebase.
 1.92.4.1  22-Sep-2015  skrll Sync with HEAD
 1.92.2.2  04-Nov-2015  riz Pull up following revision(s) (requested by mrg in ticket #956):
sys/compat/netbsd32/files.netbsd32: revision 1.36
sys/compat/netbsd32/netbsd32_sysent.c: revision 1.115
sys/compat/netbsd32/netbsd32_syscallargs.h: revision 1.116
sys/nfs/nfs_var.h: revision 1.93
sys/compat/netbsd32/netbsd32_conv.h: revision 1.30
sys/compat/netbsd32/netbsd32_syscall.h: revision 1.116
sys/compat/netbsd32/netbsd32_syscalls.c: revision 1.115
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.1
sys/compat/netbsd32/netbsd32_nfssvc.c: revision 1.3
sys/nfs/nfs_syscalls.c: revision 1.156
sys/compat/netbsd32/syscalls.master: revision 1.108
sys/compat/netbsd32/netbsd32.h: revision 1.107
add netbsd32 support for nfssvc(2). we do this by defining 5 copyin/out
functions that do all the ugly work, are just plain copyin/out for the
native system calls, and do the necessary translations for netbsd32.
with this i'm able to run 32 bit nfsd and mountd on 64 bit kernel and
mount the file systems remotely.
don't copy the first netbsd32_export_args nexports times, but actually
advance the userland pointer each entry through the loop. oops.
 1.92.2.1  04-Nov-2015  riz Pull up following revision(s) (requested by manu in ticket #882):
sbin/umount/umount.c: revision 1.48
sys/nfs/nfsmount.h: revision 1.53
sys/nfs/nfs_var.h: revision 1.94
sys/nfs/nfs_iod.c: revision 1.7
sys/nfs/nfs_socket.c: revision 1.197
sys/nfs/nfs_bio.c: revision 1.191
sys/nfs/nfs_vfsops.c: revision 1.230
sys/nfs/nfs_clntsocket.c: revision 1.3
Remove useless and harmful sync(2) call in umount(8)
Remove sync(2) call before unmount(2) in umount(8). This sync(2) is useless
since unmount(2) will perform a VFS_SYNC anyway.
But moreover, this sync(2) may be harmful, as there are some situation where
it cannot return (unreachable NFS server, for instance), causing umount -f
to be uneffective.
Fix soft NFS force unmount
For many reasons, forcibly unmounting a soft NFS mount could hang forever.
Here are the fixes:
- Introduce decents timeouts in operation that awaited NFS server reply.
- On timeout, fails operations on soft mounts with EIO.
- Introduce NFSMNT_DISMNTFORCE to let the filesystem know that a
force unmount is ongoing. This causes timeouts to be reduced and
prevents the NFS client to attempt reconnecting to the NFS server.
Also fix a race condition where some asynchronous I/O could reference
destroyed mount structures. We fix this by awaiting asynchronous I/O
to drain before proceeding.
Reviewed by Chuck Silvers.
 1.94.38.1  06-Jun-2021  cjep sync with head
 1.94.34.1  17-Jun-2021  thorpej Sync w/ HEAD.

RSS XML Feed