summaryrefslogtreecommitdiffstats
path: root/sys/nfs
Commit message (Collapse)AuthorAgeFilesLines
* Revert rev 192323 (nfs_common.c only):marcel2009-07-121-3/+2
| | | | | | | | | | | | | | | | | The D-cache flushing added here was to deal with I-cache incoherency observed on ia64. However, the problem was in the implementation of pmap_enter_object() for ia64: it was missing I-cache coherency logic for prefaulted pages. After this got added in rev 195625, testing showed that no D-cache flushing was required. The SIGILL that was observed on Book-E (see commit log for rev 192323) ended up not being related to I-cache incoherency, but was found to be caused by bad memory. This discovery further undermined the need for D-cache flushing in the NFS I/O code, triggering the reversal. Approved by: re (kensmith)
* Remove the old kernel RPC implementation and the NFS_LEGACYRPC option.dfr2009-06-302-109/+0
| | | | Approved by: re
* Replace AUDIT_ARG() with variable argument macros with a set more morerwatson2009-06-271-1/+1
| | | | | | | | | | | | | | specific macros for each audit argument type. This makes it easier to follow call-graphs, especially for automated analysis tools (such as fxr). In MFC, we should leave the existing AUDIT_ARG() macros as they may be used by third-party kernel modules. Suggested by: brooks Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 week
* Add cpu_flush_dcache() for use after non-DMA based I/O so that amarcel2009-05-181-2/+3
| | | | | | | | | | | | | | | | | | | | | possible future I-cache coherency operation can succeed. On ARM for example the L1 cache can be (is) virtually mapped, which means that any I/O that uses temporary mappings will not see the I-cache made coherent. On ia64 a similar behaviour has been observed. By flushing the D-cache, execution of binaries backed by md(4) and/or NFS work reliably. For Book-E (powerpc), execution over NFS exhibits SIGILL once in a while as well, though cpu_flush_dcache() hasn't been implemented yet. Doing an explicit D-cache flush as part of the non-DMA based I/O read operation eliminates the need to do it as part of the I-cache coherency operation itself and as such avoids pessimizing the DMA-based I/O read operations for which D-cache are already flushed/invalidated. It also allows future optimizations whereby the bcopy() followed by the D-cache flush can be integrated in a single operation, which could be implemented using on-chips DMA engines, by-passing the D-cache altogether.
* Adding sys/nfs/nfssvc.h and sys/nfs/nfs_nfssvc.c in preparation forrmacklem2009-04-072-0/+220
| | | | | | | | | | | sharing of the nfssvc() system call between nfsserver and the nfsv4 server. Building of nfs_nfssvc.c will be committed later, at the time the .c files in sys/nfsserver are updated. To do so now would result in nfssvc() multiply defined. Submitted by: rmacklem Reviewed by: dfr Approved by: kib (mentor)
* Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.ru2008-03-251-2/+2
| | | | | | | | | | Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true since the advent of MBUMA. Reviewed by: arch There are ongoing disputes as to whether we want to switch to directly using UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.
* NFSv4 client:rees2006-11-281-15/+17
| | | | | Add support for va_birthtime Fix va_ctime to use TIME_METADATA, not TIME_CREATE
* Fixes for NFS crashes on architectures that require strict alignment.ps2005-07-142-3/+18
| | | | | | | | | | - Fix nfsm_disct() so that after pulling up data, the remaining data is aligned if necessary. - Fix nfs_clnt_tcp_soupcall() to bcopy() the rpc length out of the mbuf (instead of casting m_data to a uint32). Submitted by: Pyun YongHyeon Reviewed by: Mohan Srinivasan
* /* -> /*- for license, minor formatting changesimp2005-01-075-5/+5
|
* Add non-blocking versions of nfsm_dissect() and friends, for use fromps2004-12-062-4/+29
| | | | | | | | | 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
* Remove advertising clause from University of California Regent'simp2004-04-075-20/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* University of Michigan's Citi NFSv4 kernel client code.alfred2003-11-142-7/+296
| | | | Submitted by: Jim Rees <rees@umich.edu>
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Change iov_base's type from `char *' to the standard `void *'. Allmike2002-10-111-1/+2
| | | | | uses of iov_base which assume its type is `char *' (in order to do pointer arithmetic) have been updated to cast iov_base to `char *'.
* nfsnode.h was moved to ../nfsclient ages ago. I forgot to remove it here.peter2002-09-061-210/+0
|
* Remove unused include.jeff2002-03-201-1/+0
|
* Remove __P.alfred2002-03-201-10/+10
|
* When the old nfsm_adv() macro was moved to nfsm_adv_xx(), a '>='iedowse2001-12-311-1/+1
| | | | | | | | | | | must have been inadvertently changed to '>'. This broke nfsm_adv() in the case where the advancement count is equal to the amount of data remaining in the current mbuf. Instead of moving the current position N bytes forward, nfs_adv() could end up moving it back to N bytes from the start of the mbuf data. This should fix the client-side readdirplus problems that have been reported since September.
* Avoid passing the variable `tl' to functions that just use it foriedowse2001-12-182-10/+10
| | | | | | | | | | | | | temporary storage. In the old NFS code it wasn't at all clear if the value of `tl' was used across or after macro calls, but I'm fairly confident that the convention was to keep its use local. Each ex-macro function now uses a local version of this variable, so all of the double-indirection goes away. The only exception to the `local use' rule for `tl' is nfsm_clget(), which is left unchanged by this commit. Reviewed by: peter
* Unwind some more macros. NFSMADV() was kinda silly since it was rightpeter2001-09-282-36/+42
| | | | | | | | | | next to equivalent m_len adjustments. Move the nfsm_subs.h macros into groups depending on which phase they are used in, since that affects the error recovery requirements. Collect some of the common error checking into a single macro as preparation for unwinding some more. Have nfs_rephead return a value instead of secretly modifying args. Remove some unused function arguments that were being passed around. Clarify nfsm_reply()'s error handling (I hope).
* Make nfsm_dissect() have an obvious return value.peter2001-09-272-33/+32
|
* Tidy up nfsm_build usage. This is only partially finished.peter2001-09-272-9/+8
|
* Oops, forgot to rm this last time.peter2001-09-261-564/+0
|
* Cleanup and split of nfs client and server code.peter2001-09-1827-25120/+133
| | | | This builds on the top of several repo-copies.
* nfs_strategy calls nfs_asyncio with td as NULL. So add a bandaid thatimp2001-09-181-1/+1
| | | | | | | | | | will pass NULL as the struct proc when td is NULL. This has stopped crashing on my machine. Note: The passing of NULL may be bogus, but I'll let others fix that problem. Reviewed by: jhb
* Sync some differences that were different between the copies of the filespeter2001-09-151-3/+3
| | | | that were in nfs/nfs.h and nfsserver/nfs.h in the p4 tree.
* KSE Milestone 2julian2001-09-1217-612/+621
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Fix some signed/unsigned integer confusion, and add bounds checking ofkris2001-09-101-4/+4
| | | | | | | | arguments to some functions. Obtained from: NetBSD Reviewed by: peter MFC after: 2 weeks
* Pushdown Giant for nfs syscalls (nfssvc())dillon2001-08-311-12/+23
|
* Stupid error from my side in prev. commit: || -> &&ache2001-08-231-1/+1
|
* Implement l_len<0 per POSIX check.ache2001-08-231-4/+6
| | | | Check for valid l_whence too.
* Even better move: suppose that server is able to handle SEEK_END,ache2001-08-231-6/+6
| | | | | so check arguments for all but not SEEK_END case, leaving SEEK_END handling for server
* Apparently SEEK_END locking not supported by NFS. Previous variantache2001-08-231-1/+5
| | | | returns EINVAL in that case, change it to EOPNOTSUPP.
* Move <machine/*> after <sys/*>ache2001-08-231-1/+2
| | | | Pointed by: bde
* adv. lock:ache2001-08-231-5/+5
| | | | | detect off_t overflow _before_ it occurse and return EOVERFLOW instead of EINVAL
* Fix a client-side memory leak in nfs_flush(). The code allocatesiedowse2001-08-011-2/+2
| | | | | | | | | | | | | a temporary array to store struct buf pointers if the list doesn't fit in a local array. Usually it frees the array when finished, but if it jumps to the 'again' label and the new list does fit in the local array then it can forget to free a previously malloc'd M_TEMP memory. Move the free() up a line so that it frees any previously allocated memory whether or not it needs to malloc a new array. Reviewed by: dillon
* Check the filehandle size when mounting.peter2001-07-301-0/+2
| | | | Obtained from: Constantine Sapuntzakis <csapuntz@openbsd.org>
* - Sort includes.jhb2001-07-041-5/+10
| | | | - Update vmmeter statistics for vnode pagein/pageouts in getpages/putpages.
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-043-18/+12
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* - Protect the mnt_vnode list with the mntvnode lock.jhb2001-06-283-9/+24
| | | | - Use queue(9) macros.
* Unlock the process returned from pfind() if it does not return NULL.jake2001-06-011-1/+4
| | | | | | | | This fixes a witness lock violation for nfssvc returning with locks held. Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr> PR: kern/27776
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* Assert Giant is held by the caller rather than getting it and releasingjhb2001-05-231-10/+2
| | | | it in getpages/putpages.
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-231-1/+1
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-193-3/+32
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Change the second argument of vflush() to an integer that specifiesiedowse2001-05-161-28/+4
| | | | | | | | | | | | | | | | | | | | the number of references on the filesystem root vnode to be both expected and released. Many filesystems hold an extra reference on the filesystem root vnode, which must be accounted for when determining if the filesystem is busy and then released if it isn't busy. The old `skipvp' approach required individual filesystem xxx_unmount functions to re-implement much of vflush()'s logic to deal with the root vnode. All 9 filesystems that hold an extra reference on the root vnode got the logic wrong in the case of forced unmounts, so `umount -f' would always fail if there were any extra root vnode references. Fix this issue centrally in vflush(), now that we can. This commit also fixes a vnode reference leak in devfs, which could result in idle devfs filesystems that refuse to unmount. Reviewed by: phk, bp
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-015-23/+35
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Add a vop_stdbmap(), and make it part of the default vop vector.phk2001-04-291-35/+0
| | | | | | Make 7 filesystems which don't really know about VOP_BMAP rely on the default vector, rather than more or less complete local vop_nopbmap() implementations.
* Remove incorrect comment.alfred2001-04-291-1/+0
| | | | | Submitted by: quinot@inf.enst.fr <quinot@inf.enst.fr> PR: kern/26893
OpenPOWER on IntegriCloud