aboutsummaryrefslogtreecommitdiff
path: root/sys/rpc
Commit message (Collapse)AuthorAgeFilesLines
* Fix some issues that showed up during Kris' testing.Doug Rabson2008-04-111-2/+8
| | | | | | | | Reported by: kris MFC after: 3 days Notes: svn path=/head/; revision=178112
* Minor changes to improve compatibility with older FreeBSD releases.Doug Rabson2008-03-2814-14/+22
| | | | Notes: svn path=/head/; revision=177685
* Add kernel module support for nfslockd and krpc. Use the module systemDoug Rabson2008-03-271-0/+21
| | | | | | | | | | to detect (or load) kernel NLM support in rpc.lockd. Remove the '-k' option to rpc.lockd and make kernel NLM the default. A user can still force the use of the old user NLM by building a kernel without NFSLOCKD and/or removing the nfslockd.ko module. Notes: svn path=/head/; revision=177662
* Add the new kernel-mode NFS Lock Manager. To use it instead of theDoug Rabson2008-03-2635-7/+11882
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | user-mode lock manager, build a kernel with the NFSLOCKD option and add '-k' to 'rpc_lockd_flags' in rc.conf. Highlights include: * Thread-safe kernel RPC client - many threads can use the same RPC client handle safely with replies being de-multiplexed at the socket upcall (typically driven directly by the NIC interrupt) and handed off to whichever thread matches the reply. For UDP sockets, many RPC clients can share the same socket. This allows the use of a single privileged UDP port number to talk to an arbitrary number of remote hosts. * Single-threaded kernel RPC server. Adding support for multi-threaded server would be relatively straightforward and would follow approximately the Solaris KPI. A single thread should be sufficient for the NLM since it should rarely block in normal operation. * Kernel mode NLM server supporting cancel requests and granted callbacks. I've tested the NLM server reasonably extensively - it passes both my own tests and the NFS Connectathon locking tests running on Solaris, Mac OS X and Ubuntu Linux. * Userland NLM client supported. While the NLM server doesn't have support for the local NFS client's locking needs, it does have to field async replies and granted callbacks from remote NLMs that the local client has contacted. We relay these replies to the userland rpc.lockd over a local domain RPC socket. * Robust deadlock detection for the local lock manager. In particular it will detect deadlocks caused by a lock request that covers more than one blocking request. As required by the NLM protocol, all deadlock detection happens synchronously - a user is guaranteed that if a lock request isn't rejected immediately, the lock will eventually be granted. The old system allowed for a 'deferred deadlock' condition where a blocked lock request could wake up and find that some other deadlock-causing lock owner had beaten them to the lock. * Since both local and remote locks are managed by the same kernel locking code, local and remote processes can safely use file locks for mutual exclusion. Local processes have no fairness advantage compared to remote processes when contending to lock a region that has just been unlocked - the local lock manager enforces a strict first-come first-served model for both local and remote lockers. Sponsored by: Isilon Systems PR: 95247 107555 115524 116679 MFC after: 2 weeks Notes: svn path=/head/; revision=177633
* Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.Ruslan Ermilov2008-03-251-8/+8
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=177599
* Remove the now-unused NET_{LOCK,UNLOCK,ASSERT}_GIANT() macros, whichRobert Watson2007-08-061-16/+0
| | | | | | | | | | | | | | | | | | previously conditionally acquired Giant based on debug.mpsafenet. As that has now been removed, they are no longer required. Removing them significantly simplifies error-handling in the socket layer, eliminated quite a bit of unwinding of locking in error cases. While here clean up the now unneeded opt_net.h, which previously was used for the NET_WITH_GIANT kernel option. Clean up some related gotos for consistency. Reviewed by: bz, csjp Tested by: kris Approved by: re (kensmith) Notes: svn path=/head/; revision=171744
* Check for a NULL return from rpcclnt_buildheader- it can fail ifMatt Jacob2007-06-161-0/+13
| | | | | | | | | | | | the passed in auth_type is unacceptable to rpcauth_buildheader- this avoids a null pointer panic. Clean up allocations if this happens. This also quiets a gcc 4.2 complaint about ussing mheadend without it being initialized. Reviewed by: alfred Notes: svn path=/head/; revision=170819
* Move rpc/types.h under sys/, as this is used by ZFS kernel module.Pawel Jakub Dawidek2007-04-101-0/+2
| | | | | | | Repo-copied by: simon Notes: svn path=/head/; revision=168606
* Replace GIANT_REQUIRED's present for socket locking with NET_LOCK_GIANT().Robert Watson2007-03-251-9/+20
| | | | | | | | | | If/when someone does the necessary MPSAFEty locking for the NFSv4 client, the socket code is generally MPSAFE now. Spotted by: kris Notes: svn path=/head/; revision=167885
* Fix up some cut-n-paste damage and some out-of-date comments.Jim Rees2006-01-201-29/+34
| | | | | | | | | No code changes. Submitted by: cel@citi.umich.edu Notes: svn path=/head/; revision=154582
* Use thread0 instead of user's thread for sobind.Jim Rees2006-01-201-1/+5
| | | | | | | | | | | | This fixes reconnect after, for example, tcp idle disconnection. Previously this would fail if a normal user tried to bind to a privileged port. Submitted by: cel@citi.umich.edu MFC after: 1 week Notes: svn path=/head/; revision=154581
* Fix -Wundef.Ruslan Ermilov2005-12-041-3/+3
| | | | Notes: svn path=/head/; revision=153072
* Add GIANT_REQUIRED and WITNESS sleep warnings to uprintf() and tprintf(),Robert Watson2005-09-191-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as they both interact with the tty code (!MPSAFE) and may sleep if the tty buffer is full (per comment). Modify all consumers of uprintf() and tprintf() to hold Giant around calls into these functions. In most cases, this means adding an acquisition of Giant immediately around the function. In some cases (nfs_timer()), it means acquiring Giant higher up in the callout. With these changes, UFS no longer panics on SMP when either blocks are exhausted or inodes are exhausted under load due to races in the tty code when running without Giant. NB: Some reduction in calls to uprintf() in the svr4 code is probably desirable. NB: In the case of nfs_timer(), calling uprintf() while holding a mutex, or even in a callout at all, is a bad idea, and will generate warnings and potential upset. This needs to be fixed, but was a problem before this change. NB: uprintf()/tprintf() sleeping is generally a bad ideas, as is having non-MPSAFE tty code. MFC after: 1 week Notes: svn path=/head/; revision=150335
* - Don't call rpcclnt_realign() if we don't have any mbufs to realign.David Schultz2005-03-191-15/+12
| | | | | | | | | | - Remove a bogus and unneeded null pointer check. Found by: Coverity Prevent analysis tool Approved by: alfred Notes: svn path=/head/; revision=143828
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-073-6/+6
| | | | Notes: svn path=/head/; revision=139825
* Prefer C99's __func__ over GCC's __FUNCTION__.Stefan Farfeleder2004-09-231-1/+1
| | | | | | | Approved by: alfred Notes: svn path=/head/; revision=135629
* fix array index out of bounds in rpc->rc_srtt[], rpc->rc_sdrtt[]Jim Rees2004-07-151-3/+3
| | | | | | | | Noticed by: tedu Approved by: alfred Notes: svn path=/head/; revision=132227
* Constify 'rpcclnt_backoff'.Robert Watson2004-07-121-1/+1
| | | | Notes: svn path=/head/; revision=132046
* Remove advertising clause from University of California Regent'sWarner Losh2004-04-072-8/+0
| | | | | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson Notes: svn path=/head/; revision=127977
* Reset callout if in nfs_timeout and rpcclnt_timeout functions. TimerAlexander Kabaev2004-03-281-0/+2
| | | | | | | | | | | | 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 Notes: svn path=/head/; revision=127515
* only do nfs rpc callouts if there is work to do.Jim Rees2004-03-251-5/+6
| | | | | | | | Submitted by: kan Approved by: alfred Notes: svn path=/head/; revision=127421
* Calculate NFS timeouts in units of 10ms, not 5ms. This matches the defaultPeter Wemm2004-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. Notes: svn path=/head/; revision=126962
* Convert from timeout to callout API.Alexander Kabaev2004-03-071-4/+4
| | | | Notes: svn path=/head/; revision=126722
* Don't panic because of RPC proto mismatches. Whitespace cleanup.Alfred Perlstein2004-01-171-35/+37
| | | | | | | Submitted by: Jim Rees <rees@umich.edu> Notes: svn path=/head/; revision=124640
* Prevent a panic when mounting a v2/v3 only server with mount_nfs4.Alfred Perlstein2004-01-131-0/+2
| | | | | | | | Submitted by: Jim Rees <rees@umich.edu> Reported/testing: Florian C. Smeets <flo@kasimir.com> Notes: svn path=/head/; revision=124453
* Fix a panic when attempting a v4 op against a v3/v2-only server.Alfred Perlstein2004-01-101-10/+12
| | | | | | | | | | It happens because rpcclnt_request is incorrectly returning 0 in the case of an rpc mismatch or auth error. Submitted by: Jim Rees <rees@umich.edu> Notes: svn path=/head/; revision=124323
* Change the definition of NULL on ia64 (for LP64 compilations) fromMarcel Moolenaar2003-12-071-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an int constant to a long constant. This change improves consistency in the following two ways: 1. The first 8 arguments are always passed in registers on ia64, which by virtue of the generated code implicitly widens ints to longs and allows the use of an 32-bit integral type for 64-bit arguments. Subsequent arguments are passed onto the memory stack, which does not exhibit the same behaviour and consequently do not allow this. In practice this means that variadic functions taking pointers and given NULL (without cast) work as long as the NULL is passed in one of the first 8 arguments. A SIGSEGV is more likely the result if such would be done for stack-based arguments. This is due to the fact that the upper 4 bytes remain undefined. 2. All 64-bit platforms that FreeBSD supports, with the obvious exception of ia64, allow 32-bit integral types (specifically NULL) when 64-bit pointers are expected in variadic functions by way of how the compiler generates code. As such, code that works correctly (whether rightfully so or not) on any platform other than ia64, may fail on ia64. To more easily allow tweaking of the definition of NULL, this commit removes the 12 definitions in the various headers and puts it in a new header that can be included whenever NULL is to be made visible. This commit fixes GNOME, emacs, xemacs and a whole bunch of ports that I don't particularly care about at this time... Notes: svn path=/head/; revision=123257
* Remove unneeded file. (could be repo removed as nothing ever referenced it.)Alfred Perlstein2003-11-201-101/+0
| | | | | | | Submitted by: Jim Rees <rees@umich.edu> Notes: svn path=/head/; revision=122911
* Use %zu to printf a size_t instead of an int cast.Alfred Perlstein2003-11-151-3/+3
| | | | | | | Requested by: jmallett, wollman Notes: svn path=/head/; revision=122725
* Fix compilation warnings on sparc.Alfred Perlstein2003-11-151-2/+2
| | | | | | | Cast sizeof to int for printing with %d. Notes: svn path=/head/; revision=122721
* University of Michigan's Citi NFSv4 kernel client code.Alfred Perlstein2003-11-144-0/+2675
| | | | | | | Submitted by: Jim Rees <rees@umich.edu> Notes: svn path=/head/; revision=122698
* Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) andAlfred Perlstein2001-03-191-6/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | associated changes that had to happen to make this possible as well as bugs fixed along the way. Bring in required TLI library routines to support this. Since we don't support TLI we've essentially copied what NetBSD has done, adding a thin layer to emulate direct the TLI calls into BSD socket calls. This is mostly from Sun's tirpc release that was made in 1994, however some fixes were backported from the 1999 release (supposedly only made available after this porting effort was underway). The submitter has agreed to continue on and bring us up to the 1999 release. Several key features are introduced with this update: Client calls are thread safe. (1999 code has server side thread safe) Updated, a more modern interface. Many userland updates were done to bring the code up to par with the recent RPC API. There is an update to the pthreads library, a function pthread_main_np() was added to emulate a function of Sun's threads library. While we're at it, bring in NetBSD's lockd, it's been far too long of a wait. New rpcbind(8) replaces portmap(8) (supporting communication over an authenticated Unix-domain socket, and by default only allowing set and unset requests over that channel). It's much more secure than the old portmapper. Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded to support TI-RPC and to support IPV6. Umount(8) is also fixed to unmount pathnames longer than 80 chars, which are currently truncated by the Kernel statfs structure. Submitted by: Martin Blapp <mb@imp.ch> Manpage review: ru Secure RPC implemented by: wpaul Notes: svn path=/head/; revision=74462
* $Id$ -> $FreeBSD$Peter Wemm1999-08-271-1/+1
| | | | Notes: svn path=/head/; revision=50473
* Resolve conflicts.Bill Paul1997-05-281-1/+1
| | | | Notes: svn path=/head/; revision=26211
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-231-1/+1
| | | | Notes: svn path=/head/; revision=23037
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* First commit of a series of cleanups for the libc rpc code which has beenPeter Wemm1996-12-301-7/+3
| | | | | | | | | | | | | | suffering a bad case neglect for the last few years. - Add full prototypes, including to function pointers. - Make the wire protocols 64-bit type safe, eg: 32 bit quantities are int32_t, not long. The orginal rpc code was implemented when an int could be 16 bits. Obtained from: a diff of FreeBSD vs. OpenBSD/NetBSD rpc code. Notes: svn path=/head/; revision=21059
* Fix a bunch of spelling errors in the comment fieldsMike Pritchard1996-01-301-2/+2
| | | | | | | of a bunch of system include files. Notes: svn path=/head/; revision=13771
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-6/+6
| | | | Notes: svn path=/head/; revision=8858
* Use the header files that are compatible with the code just moved overGarrett Wollman1994-08-071-13/+16
| | | | | | | from 1.1.5. Notes: svn path=/head/; revision=1903
* Install RPC headers from include, like they always should have been.Garrett Wollman1994-08-041-0/+63
Notes: svn path=/head/; revision=1839