summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rpc.lockd
Commit message (Collapse)AuthorAgeFilesLines
* Don't use sys/nfs/rpcv2.h - it is part of the old kernel RPC implementationdfr2009-06-241-1/+0
| | | | and will be removed.
* Re-implement the client side of rpc.lockd in the kernel. This implementationdfr2008-06-261-45/+62
| | | | | | | | | | | | provides the correct semantics for flock(2) style locks which are used by the lockf(1) command line tool and the pidfile(3) library. It also implements recovery from server restarts and ensures that dirty cache blocks are written to the server before obtaining locks (allowing multiple clients to use file locking to safely share data). Sponsored by: Isilon Systems PR: 94256 MFC after: 2 weeks
* Add a missing call to init_nsm().dfr2008-06-021-0/+1
| | | | MFC after: 1 week
* If we can't find or load the kernel NLM support, don't just go ahead anddfr2008-04-101-1/+2
| | | | try to use it anyway.
* Call listen(2) on bound tcp sockets before passing them to svc_tli_create.dfr2008-04-061-0/+3
|
* Remove the '-k' option.dfr2008-03-271-1/+1
|
* Add kernel module support for nfslockd and krpc. Use the module systemdfr2008-03-272-11/+14
| | | | | | | 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.
* Add the new kernel-mode NFS Lock Manager. To use it instead of thedfr2008-03-262-17/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Check the correct variables for malloc failures.matteo2007-11-071-1/+1
| | | | Submitted by: Michiel Boland <michiel@boland.org>
* Add the -h <bindip> option to rpc.lockd, similar to the one inmatteo2007-11-022-111/+348
| | | | | | | | | | | | | | nfsd(8), in mountd(8), and in rpc.statd(8) -h bindip Specify specific IP addresses to bind to for TCP and UDP requests. This option may be specified multiple times. If no -h option is specified, rpc.lockd will bind to INADDR_ANY. Note that when specifying IP addresses with -h, rpc.lockd will automatically add 127.0.0.1 and if IPv6 is enabled, ::1 to the list. PR: bin/98500 MFC after: 1 week
* - Fix compilaton with DUMP_FILELOCK_VERBOSE.kuriyama2007-04-121-8/+8
| | | | | - Use consistent "get_lock_matching_unlock" function name in debuglog().
* Add the "-p" option, which allows to specify a port which the daemonmatteo2007-04-032-8/+92
| | | | | | | | should bind to. PR: bin/100969 Reviewed by: alfred@ MFC after: 1 week
* Fix a typo in a comment, introduced in rev. 1.19.brueffer2007-01-161-1/+1
|
* some whitespace cleanup (which I usually don't bother with)mjacob2007-01-041-57/+55
| | | | | | so I could note that the previous delta was: Reviewed by: Mohan
* Add a function that checks for duplicate requests (basedmjacob2007-01-041-2/+43
| | | | | | | | | on some fairly tight criteria) so we avoid having broken clients spam rpc.lockd to death. PR: 107530 Obtained from: Doug Rudoff MFC after: 1 week
* Set alarm timer for grace period from the grace_period variable, insteadthomas2006-08-231-1/+1
| | | | | | | | of hard-coding a value of 10 seconds. Command line flag -g is thus now correctly taken into account. PR: bin/102176 MFC after: 1 week
* o Style previous.maxim2006-08-171-2/+2
|
* Use setproctitle(3) to provide identification of the client and serverthomas2006-08-161-0/+2
| | | | | | processes created by rpc.lockd. MFC after: 1 week
* Remove extraneous trailing \0 in string literal.thomas2006-08-111-2/+1
| | | | MFC after: 2 weeks
* Move call to ignore SIGPIPE signals before calling fork(),rodrigc2006-05-271-1/+3
| | | | | | | | so that both parent and child processes ignore this signal. PR: bin/97768 Submitted by: Gea-Suan Lin <gslin at csie dot nctu dot edu dot tw> MFC after: 3 days
* Ignore SIGPIPE signals on write() failures.rodrigc2006-05-251-0/+1
| | | | | | | | | We already check for write() failures and handle EPIPE. Failure to handle SIGPIPE was resulting in rpc.lockd terminating. PR: bin/97768 Reported by: Gea-Suan Lin <gslin at csie dot nctu dot edu dot tw> MFC after: 1 day
* When a user is in more than 16 groups the call to authunix_create() willharti2005-11-171-1/+6
| | | | | | | | | result in abort() beeing called. This is because there is a limit of the number of groups in the RPC which is 16. When the actual number of groups is too large it results in xdr_array() returning an error which, in turn, authunix_create() handles by just calling abort(). Fix this by passing only the first 16 groups to authunix_create().
* Add FBSDID. Add missing prototypes. Remove unused variables. Give variablecharnier2005-05-202-14/+15
| | | | an initial value to silent compiler.
* Consumers of nfslockdans() seems to think it should return 0 on success, socognet2005-03-161-1/+1
| | | | make it so.
* Fixed the misplaced $FreeBSD$.ru2005-02-091-1/+1
|
* - Use svc_getrpccaller() rather than svc_getcaller() for usingkuriyama2005-02-031-20/+16
| | | | | | | | xt_rtaddr member of SVCXPRT structure. This allows to use IPv6 address stored in "struct sockaddr_storage" in "struct netbuf". - Output the reason of getnameinfo() error. Reviewed by: alfred
* Sort sections.ru2005-01-181-2/+2
|
* Userland change corresponding to the change in kernel/userland communicationphk2004-12-061-31/+19
| | | | for NFS locking.
* Include <unistd.h> for {g,s}eteuid().stefanf2004-10-091-0/+1
|
* After talking to Colin,mr2004-07-163-64/+70
| | | | | | | | apply the patch of bin/61718 (which should include/elimatate kern/61122 also). It seems to fix a few annoying bugs. PR: bin/61718, kern/61122 Submitted by: bg@sics.se ohartman@mail.physik.uni-mainz.de
* Remove spurious semicolons. Outside of functions they are actually errors butstefanf2004-05-161-1/+1
| | | | | | | | GCC doesn't warn about them without -pedantic. Approved by: das (mentor) PR: 56649 Reviewed by: md5
* Make rpc.lockd bind to a reserved port, since there are NFS clientsroam2004-03-041-0/+18
| | | | | | | | which ignore NLM requests not coming from a reserved port. PR: 56500 Submitted by: Jonathan Lennox <lennox@cs.columbia.edu> MFC after: 1 week
* The callrpc call to unmonitor hosts was passing the wrong xdralfred2004-02-171-2/+2
| | | | | decode/encode functions for the arguments to the statd unmonitor call. Fix it.
* Make this compile cleanly. It passes WARNS=2, but I haven't checkedpeter2003-10-265-29/+44
| | | | it is so on more platforms.
* When getting back an NLM DENIED response for a requested lock from therwatson2003-05-151-2/+2
| | | | | | | | | | | | server, map it to EAGAIN locally rather than EACCES. The NLM spec indicates the DENIED corresponds to lock contention, not a permission failure. This fixes O_EXLOCK/O_SHLOCK with O_NONBLOCK, which would previously give a permission error, which in turn fixes things like mailq(8) and lockf(1) over NFS. Approved by: scottl (re) Reviewed by: truckman, Andrew P Lentvorski, Jr. <bsder@allcaps.org> Idea from: truckman
* Avoid registering for a lock on the server in the event the NFS clientrwatson2003-05-141-6/+11
| | | | | | | | | | | has requested the lock in a non-blocking form, instead returning an immediate failure. This appears to help reduce one of my "locks get lost" symptoms involving lockf(1), which attempts a non-blocking lock attempt before actually blocking on the lock. At this point the client still gets back EACCES, which is an issue we're still working. Approved by: re (scottl) Submitted by: Andrew P. Lentvorski, Jr. <bsder@allcaps.org>
* When receiving NLM_GRANTED_RES or NLM4_GRANTED_RES lock granted messagesrwatson2003-05-141-2/+7
| | | | | | | | | | | | | from the NFS server, following contention on a lock by this or another client, immediately notify the waiting process that the lock has been granted via a wakeup. Without this change, the client rpc.lockd will not wakeup the waiting process until it next re-polls the lock (sometime in the next ten seconds), which can lead to marked latency across all potential lockers, as the lock is held by the client for the duration. Approved by: re (scottl) Submitted by: truckman Reviewed by: Andrew P. Lentvorski, Jr <bsder@allcaps.org>
* init_nsm() is executed after a call to daemon(*, 0), so error andghelmer2003-04-241-2/+4
| | | | | | warning messages should be logged rather than sent to /dev/null. PR: bin/45461
* style.Makefile(5)obrien2003-04-041-2/+0
|
* Implement nonblocking tpc-connections. rpcgen -m does stillmbr2003-01-161-1/+6
| | | | | | | | produce backcompatible code. Reviewed by: rwatson Obtained from: NetBSD MFC after: 1 day
* Remove a case of exposing 'struct ucred' to userspace. Use a struct xucredalfred2002-08-151-7/+7
| | | | | | for LOCKD_MSG instead. Requested by: rwatson
* Add IPv6 support.alfred2002-07-151-5/+15
| | | | Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr>
* The .Nm utilitycharnier2002-07-141-2/+2
|
* When binding to transports if getnetconfigent() fails then actuallyalfred2002-04-111-1/+2
| | | | | | print out the correct transport it failed on rather than always spitting out 'udp', also call nc_sperror() to give a more verbose error message detailing the problem.
* Use char foo[] = "BAR" to avoid direct assignment of const char * into char *.alfred2002-03-221-2/+4
| | | | | | rpcgen can't really make those fields const because the remote side might want to munge them, so we need to pass non-const in. Hackish, but should work.
* Const fix.alfred2002-03-221-1/+1
|
* Remove cast that's not needed.alfred2002-03-221-1/+1
|
* WARNS from 3 to 4. still some warnings about assigning const char * toalfred2002-03-221-1/+1
| | | | char *, but we'll fix those later.
* constify log_from_addr() parameter.alfred2002-03-221-2/+2
|
* Bring code to WARNS=3 level. Mostly fix unused variables.alfred2002-03-213-17/+22
|
OpenPOWER on IntegriCloud